diff --git a/com/win32comext/adsi/demos/scp.py b/com/win32comext/adsi/demos/scp.py index 6f2c252839..b2ff016ec9 100644 --- a/com/win32comext/adsi/demos/scp.py +++ b/com/win32comext/adsi/demos/scp.py @@ -199,7 +199,7 @@ def AllowAccessToScpProperties( setattr(scpObject, attribute, sd) # SetInfo updates the SCP object in the directory. scpObject.SetInfo() - logger.info(f"Set security on object for account '{trustee}'") + logger.info("Set security on object for account %r", trustee) # Service Principal Names functions from the same sample. diff --git a/ruff.toml b/ruff.toml index 733c24839b..dfe936c5c0 100644 --- a/ruff.toml +++ b/ruff.toml @@ -3,8 +3,27 @@ target-version = "py37" [lint] select = [ + "C4", # flake8-comprehensions + "F811", # redefined-while-unused "I", # isort "PLC", # Pylint Convention + "PLE", # Pylint Error + "RSE", # flake8-raise + "W", # pycodestyle Warning + "YTT", # flake8-2020 + + # String formatting, concatenating, interpolation, ... + "ISC001", # single-line-implicit-string-concatenation + # TODO: Do in a separate PR + # "ISC002", # multi-line-implicit-string-concatenation + "FLY", # static-join-to-f-string + "G", # flake8-logging-format + "UP025", # Remove unicode literals from strings + "UP030", # Use implicit references for positional format fields + # TODO: Still lots of manual fixes needed + # "UP031", # Use format specifiers instead of percent format + # "UP032", # Use f-string instead of format call + # Ensure modern type annotation syntax and best practices # Not including those covered by type-checkers "FA", # flake8-future-annotations @@ -19,6 +38,8 @@ select = [ [lint.per-file-ignores] # Explicit re-exports is fine in __init__.py, still a code smell elsewhere. "__init__.py" = ["PLC0414"] +# TODO: Make adodbapi changes in their own PRs +"adodbapi/*" = ["C4", "YTT301", "UP031", "UP032", "ISC002"] [lint.isort] combine-as-imports = true @@ -33,3 +54,6 @@ known-third-party = [ "distutils", ] extra-standard-library = ["setuptools"] + +[lint.flake8-implicit-str-concat] +allow-multiline = false # ignore ISC003 with this option disabled diff --git a/setup.py b/setup.py index 4c50fb6fde..f8954603fb 100644 --- a/setup.py +++ b/setup.py @@ -2132,7 +2132,7 @@ def convert_optional_data_files(files): except RuntimeError as details: if not str(details.args[0]).startswith("No file"): raise - logging.info("NOTE: Optional file %s not found - skipping" % file) + logging.info("NOTE: Optional file %s not found - skipping", file) else: ret.append(temp[0]) return ret