Browse Source

Use ruff

pull/492/head
Simon Conseil 3 years ago
parent
commit
33b6bafbde
  1. 7
      .pre-commit-config.yaml
  2. 10
      pyproject.toml
  3. 2
      src/sigal/plugins/compress_assets.py

7
.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

10
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 = [

2
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

Loading…
Cancel
Save