diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7db921b..f7db156 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,8 +26,7 @@ repos: hooks: - id: black -- repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 +- repo: https://github.com/charliermarsh/ruff-pre-commit + rev: 'v0.0.246' hooks: - - id: flake8 - types: [file, python] + - id: ruff diff --git a/pyproject.toml b/pyproject.toml index dafa9da..431e6de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,13 +66,13 @@ write_to = "src/sigal/version.py" line-length = 88 target-version = ['py38'] -[tool.flake8] -max-line-length = "88" -ignore = "E203,W503,E731" - -[tool.distutils.isort] +[tool.isort] profile = "black" +[tool.ruff] +select = ["E", "F"] +ignore = ["E731"] + [tool.coverage.run] source = ["sigal"] omit = [ diff --git a/src/sigal/plugins/compress_assets.py b/src/sigal/plugins/compress_assets.py index 226cace..6c2b365 100644 --- a/src/sigal/plugins/compress_assets.py +++ b/src/sigal/plugins/compress_assets.py @@ -80,7 +80,7 @@ class BaseCompressor: Otherwise, it returns False. """ - if not os.path.splitext(filename)[1][1:] in self.suffixes_to_compress: + if os.path.splitext(filename)[1][1:] not in self.suffixes_to_compress: return False file_stats = None