summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmjith Ramanujam <amjith@netflix.com>2021-05-06 21:20:12 -0700
committerAmjith Ramanujam <amjith@netflix.com>2021-05-06 21:20:12 -0700
commit6309dd4f9326b4ac7b421590899ff02ae42d3634 (patch)
tree2d64cb293bc364cfaccb237ab363a432c4019e98
parent1d2570f462a565e5034658000c6cbb60f259b2dc (diff)
Blacken.
-rw-r--r--.pre-commit-config.yaml2
-rw-r--r--pgcli/main.py3
-rw-r--r--pgcli/pgcompleter.py15
-rw-r--r--tests/utils.py2
4 files changed, 10 insertions, 12 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index b970ac5e..9e27ab8e 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
- rev: stable
+ rev: 21.5b0
hooks:
- id: black
language_version: python3.7
diff --git a/pgcli/main.py b/pgcli/main.py
index ecf041bb..2202c1a7 100644
--- a/pgcli/main.py
+++ b/pgcli/main.py
@@ -1248,7 +1248,8 @@ def cli(
else:
print("Config file is now located at", config_full_path)
print(
- "Please move the existing config file ~/.pgclirc to", config_full_path,
+ "Please move the existing config file ~/.pgclirc to",
+ config_full_path,
)
if list_dsn:
try:
diff --git a/pgcli/pgcompleter.py b/pgcli/pgcompleter.py
index 269b810f..227e25c6 100644
--- a/pgcli/pgcompleter.py
+++ b/pgcli/pgcompleter.py
@@ -140,7 +140,7 @@ class PGCompleter(Completer):
return "'{}'".format(self.unescape_name(name))
def unescape_name(self, name):
- """ Unquote a string."""
+ """Unquote a string."""
if name and name[0] == '"' and name[-1] == '"':
name = name[1:-1]
@@ -491,14 +491,11 @@ class PGCompleter(Completer):
def get_column_matches(self, suggestion, word_before_cursor):
tables = suggestion.table_refs
- do_qualify = (
- suggestion.qualifiable
- and {
- "always": True,
- "never": False,
- "if_more_than_one_table": len(tables) > 1,
- }[self.qualify_columns]
- )
+ do_qualify = suggestion.qualifiable and {
+ "always": True,
+ "never": False,
+ "if_more_than_one_table": len(tables) > 1,
+ }[self.qualify_columns]
qualify = lambda col, tbl: (
(tbl + "." + self.case(col)) if do_qualify else self.case(col)
)
diff --git a/tests/utils.py b/tests/utils.py
index fcd725e3..460ea469 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -73,7 +73,7 @@ def drop_tables(conn):
def run(
executor, sql, join=False, expanded=False, pgspecial=None, exception_formatter=None
):
- " Return string output for the sql to be run "
+ "Return string output for the sql to be run"
results = executor.run(sql, pgspecial, exception_formatter)
formatted = []