diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index abb0ca85c79..4277e23a666 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -65,7 +65,7 @@ repos: - --comment-style - "|#|" - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.1.14 + rev: v0.2.0 hooks: - id: ruff - id: ruff-format diff --git a/bin/compile-requirements.sh b/bin/compile-requirements.sh index 315d2ef3bf7..3c010bd96f9 100755 --- a/bin/compile-requirements.sh +++ b/bin/compile-requirements.sh @@ -16,7 +16,7 @@ pip install -U pip==23.3.2 pip install pip-tools==7.3.0 # Drop the compiled reqs files, to help us pick up automatic subdep updates, too -rm -f requirements/*.txt +#rm -f requirements/*.txt pip-compile --generate-hashes -r requirements/prod.in --resolver=backtracking --rebuild pip-compile --generate-hashes -r requirements/dev.in --resolver=backtracking --rebuild diff --git a/pyproject.toml b/pyproject.toml index 3370270b7d7..4cd57681213 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,9 @@ [tool.ruff] +line-length = 150 +target-version = 'py39' +extend-exclude = ["docs", "assets", "static", "bedrock/externalfiles/files_cache"] + +[tool.ruff.lint] # Set what ruff should check for. # See https://beta.ruff.rs/docs/rules/ for a list of rules. select = [ @@ -13,18 +18,15 @@ select = [ "Q", # flake8-quotes errors "W", # pycodestyle warnings ] -line-length = 150 # To match flake8 -target-version = 'py39' -extend-exclude = ["__pycache__", "docs", "assets", "static", "bedrock/externalfiles/files_cache"] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "bedrock/settings/__init__.py" = ["F405"] "bedrock/contentful/tests/data.py" = ["E501"] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["bedrock", "lib", "pages"] section-order = ["future", "standard-library", "django", "third-party", "first-party", "local-folder"] combine-as-imports = true -[tool.ruff.isort.sections] +[tool.ruff.lint.isort.sections] django = ["django"] diff --git a/requirements/dev.in b/requirements/dev.in index fbaca028534..ae11623e60d 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -18,7 +18,7 @@ pytest-parallel==0.1.1 pytest-rerunfailures==13.0 pytest-selenium==4.0.1 responses==0.24.1 -ruff==0.1.14 +ruff==0.2.0 selenium==4.9.1 # Pinned to 4.9.1 until https://github.com/pytest-dev/pytest-selenium/issues/315 is resolved translate-toolkit==3.12.1 # Related to moz-l10n-lint, used in CI diff --git a/requirements/dev.txt b/requirements/dev.txt index 53282f7c49d..d334969899b 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1417,24 +1417,24 @@ rpds-py==0.17.1 \ # -r requirements/prod.txt # jsonschema # referencing -ruff==0.1.14 \ - --hash=sha256:1c8eca1a47b4150dc0fbec7fe68fc91c695aed798532a18dbb1424e61e9b721f \ - --hash=sha256:2270504d629a0b064247983cbc495bed277f372fb9eaba41e5cf51f7ba705a6a \ - --hash=sha256:269302b31ade4cde6cf6f9dd58ea593773a37ed3f7b97e793c8594b262466b67 \ - --hash=sha256:62ce2ae46303ee896fc6811f63d6dabf8d9c389da0f3e3f2bce8bc7f15ef5488 \ - --hash=sha256:653230dd00aaf449eb5ff25d10a6e03bc3006813e2cb99799e568f55482e5cae \ - --hash=sha256:6b3dadc9522d0eccc060699a9816e8127b27addbb4697fc0c08611e4e6aeb8b5 \ - --hash=sha256:7060156ecc572b8f984fd20fd8b0fcb692dd5d837b7606e968334ab7ff0090ab \ - --hash=sha256:722bafc299145575a63bbd6b5069cb643eaa62546a5b6398f82b3e4403329cab \ - --hash=sha256:80258bb3b8909b1700610dfabef7876423eed1bc930fe177c71c414921898efa \ - --hash=sha256:87b3acc6c4e6928459ba9eb7459dd4f0c4bf266a053c863d72a44c33246bfdbf \ - --hash=sha256:96f76536df9b26622755c12ed8680f159817be2f725c17ed9305b472a757cdbb \ - --hash=sha256:a53d8e35313d7b67eb3db15a66c08434809107659226a90dcd7acb2afa55faea \ - --hash=sha256:ab3f71f64498c7241123bb5a768544cf42821d2a537f894b22457a543d3ca7a9 \ - --hash=sha256:ad3f8088b2dfd884820289a06ab718cde7d38b94972212cc4ba90d5fbc9955f3 \ - --hash=sha256:b2027dde79d217b211d725fc833e8965dc90a16d0d3213f1298f97465956661b \ - --hash=sha256:bea9be712b8f5b4ebed40e1949379cfb2a7d907f42921cf9ab3aae07e6fba9eb \ - --hash=sha256:e3d241aa61f92b0805a7082bd89a9990826448e4d0398f0e2bc8f05c75c63d99 +ruff==0.2.0 \ + --hash=sha256:30ad74687e1f4a9ff8e513b20b82ccadb6bd796fe5697f1e417189c5cde6be3e \ + --hash=sha256:3826fb34c144ef1e171b323ed6ae9146ab76d109960addca730756dc19dc7b22 \ + --hash=sha256:3d3c641f95f435fc6754b05591774a17df41648f0daf3de0d75ad3d9f099ab92 \ + --hash=sha256:3fbaff1ba9564a2c5943f8f38bc221f04bac687cc7485e45237579fee7ccda79 \ + --hash=sha256:3ff35433fcf4dff6d610738712152df6b7d92351a1bde8e00bd405b08b3d5759 \ + --hash=sha256:63856b91837606c673537d2889989733d7dffde553828d3b0f0bacfa6def54be \ + --hash=sha256:638ea3294f800d18bae84a492cb5a245c8d29c90d19a91d8e338937a4c27fca0 \ + --hash=sha256:6d232f99d3ab00094ebaf88e0fb7a8ccacaa54cc7fa3b8993d9627a11e6aed7a \ + --hash=sha256:8153a3e4128ed770871c47545f1ae7b055023e0c222ff72a759f5a341ee06483 \ + --hash=sha256:87057dd2fdde297130ff99553be8549ca38a2965871462a97394c22ed2dfc19d \ + --hash=sha256:a7e3818698f8460bd0f8d4322bbe99db8327e9bc2c93c789d3159f5b335f47da \ + --hash=sha256:ba918e01cdd21e81b07555564f40d307b0caafa9a7a65742e98ff244f5035c59 \ + --hash=sha256:bf9faafbdcf4f53917019f2c230766da437d4fd5caecd12ddb68bb6a17d74399 \ + --hash=sha256:e155147199c2714ff52385b760fe242bb99ea64b240a9ffbd6a5918eb1268843 \ + --hash=sha256:e8a75a98ae989a27090e9c51f763990ad5bbc92d20626d54e9701c7fe597f399 \ + --hash=sha256:eceab7d85d09321b4de18b62d38710cf296cb49e98979960a59c6b9307c18cfe \ + --hash=sha256:edf23041242c48b0d8295214783ef543847ef29e8226d9f69bf96592dba82a83 # via -r requirements/dev.in s3transfer==0.10.0 \ --hash=sha256:3cdb40f5cfa6966e812209d0994f2a4709b561c88e90cf00c2696d2df4e56b2e \