From 6309dd4f9326b4ac7b421590899ff02ae42d3634 Mon Sep 17 00:00:00 2001 From: Amjith Ramanujam Date: Thu, 6 May 2021 21:20:12 -0700 Subject: Blacken. --- .pre-commit-config.yaml | 2 +- pgcli/main.py | 3 ++- pgcli/pgcompleter.py | 15 ++++++--------- tests/utils.py | 2 +- 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 = [] -- cgit v1.2.3