Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace black with ruff #365

Merged
merged 120 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
6df20ce
ci: introduce ruff
sujuka99 Sep 26, 2023
b94737f
ci: exclude snapshots
sujuka99 Sep 26, 2023
0833e1b
ci(ruff): ignore F401 in tests/*/__init__.py
sujuka99 Sep 26, 2023
a4c92a7
ci(ruff): fix order
sujuka99 Sep 26, 2023
c8bd70c
ci(ruff): comment out rules in nursery, remove comment
sujuka99 Sep 26, 2023
c7bb733
ci(ruff): Autofix "D"
sujuka99 Sep 26, 2023
6379c78
ci(ruff): improve comments
sujuka99 Sep 26, 2023
c70873c
ci(ruff-pydocstyle): improve rule selection
sujuka99 Sep 26, 2023
738e21b
ci(ruff): autofix "D"
sujuka99 Sep 26, 2023
11a54a5
chore: fix docstrings flagged by "D"
sujuka99 Sep 26, 2023
53ba27d
ci(ruff-pyupgrade): autofix
sujuka99 Sep 26, 2023
d090ff0
chore: manually fix code flagged by "UP"
sujuka99 Sep 26, 2023
feb6df3
chore: update snapshots
sujuka99 Sep 26, 2023
cc06875
ci(ruff): add rule ignores for "B"
sujuka99 Sep 26, 2023
687f37d
ci(ruff): configure "B"
sujuka99 Sep 26, 2023
1b6e29c
chore: manually fix code flagged by "B"
sujuka99 Sep 26, 2023
1621db1
chore: fix code flagged by "INP"
sujuka99 Sep 26, 2023
d0eefab
chore(ruff): fix code flagged by "BLE"
sujuka99 Sep 26, 2023
301284e
ci(ruff-commas): autofix
sujuka99 Sep 26, 2023
c7b3251
chore(ruff-comprehensions): ignore "C408"
sujuka99 Sep 26, 2023
0c2c7c1
ci(ruff-errmsg): autofix "EM"
sujuka99 Sep 26, 2023
0160c08
ci(ruff-pie): autofix
sujuka99 Sep 26, 2023
dd29e3a
ci(ruff-pie): exclude "PIE804"
sujuka99 Sep 26, 2023
49e9e4a
ci(ruff-pytest): autofix "PT"
sujuka99 Sep 26, 2023
b93c3d8
chore(ruff-pytest): manually fix code flagged by "PT"
sujuka99 Sep 26, 2023
9a8678a
ci(ruff-raise): autofix "RSE"
sujuka99 Sep 26, 2023
f90dd22
ci(ruff-return): autofix "RET"
sujuka99 Sep 26, 2023
68b824b
ci(ruff-simplify): autofix "SIM"
sujuka99 Sep 26, 2023
57fd749
ci(ruff-type-checking): disable "TCH" temporarily
sujuka99 Sep 26, 2023
57d9b50
ci(ruff): remove "ARG"
sujuka99 Sep 26, 2023
4e2dd33
ci(ruff-pathlib): autofix "PTH"
sujuka99 Sep 26, 2023
2d8129e
chore(ruff-pathlib): manually fix code flagged by "PTH"
sujuka99 Sep 26, 2023
07bf0f4
chore(ruff-pygrep): manually fix code flagged by "PGH"
sujuka99 Sep 26, 2023
8664342
ci(ruff-pylint): autofix "PL"
sujuka99 Sep 26, 2023
0d65ea8
ci(ruff): ignore "PLW2901"
sujuka99 Sep 26, 2023
54d4b4e
chore(ruff-pylint): manually fix code flagged by "PL"
sujuka99 Sep 26, 2023
8be0263
ci(ruff-tryceratops): autofix "TRY"
sujuka99 Sep 26, 2023
e73f9ab
chore(ruff-tryceratops): manually fix code flagged by "TRY"
sujuka99 Sep 26, 2023
794c60d
chore(pre-commit): pass pre-commit checks
sujuka99 Sep 26, 2023
d3d430d
Merge remote-tracking branch 'origin/main' into ci/introduce-ruff
sujuka99 Sep 26, 2023
14c3c99
chore: lint
sujuka99 Sep 26, 2023
c272a06
ci(ruff): enable "TCH" partly
sujuka99 Sep 26, 2023
750555f
ci(ruff): enable "TCH002"
sujuka99 Sep 26, 2023
502574b
ci(ruff): configure
sujuka99 Sep 26, 2023
31cd2be
chore: remove leftover file
sujuka99 Sep 26, 2023
9d4a761
ci: update workflow
sujuka99 Sep 26, 2023
25b0c08
chore: pass tests
sujuka99 Sep 26, 2023
0b9f26c
ci(ruff-type-checking): Add "TCH001" with proper config
sujuka99 Sep 27, 2023
bdee94d
style: one-liner
sujuka99 Sep 27, 2023
847d4e9
ci(ruff): Ignore COM812
sujuka99 Sep 27, 2023
5a6c3d1
Revert "ci(ruff-commas): autofix"
sujuka99 Sep 27, 2023
1e03e1a
test: whether matcher works
sujuka99 Sep 27, 2023
2fab625
test: problem checker
sujuka99 Sep 27, 2023
e3b7122
fix: ci
sujuka99 Sep 27, 2023
884445f
ci(ruff): format output as "text" in the CI only
sujuka99 Sep 27, 2023
0eb104d
fix(ruff): pre-commit wrong arg
sujuka99 Sep 27, 2023
47b3377
fix: ruff args in pre-commit
sujuka99 Sep 27, 2023
60a500b
fix(ci): ruff pre-commit hook
sujuka99 Sep 27, 2023
571c43f
ci: attempt to fix
sujuka99 Sep 27, 2023
3283ec0
fix: problem matcher regex
sujuka99 Sep 27, 2023
6622b59
fix: regex problem matchr
sujuka99 Sep 27, 2023
797aec7
ci: only lint once with ruff
sujuka99 Sep 27, 2023
fcfbcaf
chore: lint ci
sujuka99 Sep 27, 2023
049a3db
fix(ci): deduplicate pre-commit run
sujuka99 Sep 27, 2023
5229ff1
ci: always run ruff
sujuka99 Sep 27, 2023
ed8b99d
fix(ci): windows
sujuka99 Sep 27, 2023
4a82df1
chore: lint and format
sujuka99 Sep 27, 2023
966dd85
docs: add ruff badge
sujuka99 Sep 27, 2023
2712048
ci(ruff): configure isort
sujuka99 Sep 28, 2023
22409bf
chore(ruff): remove comment
sujuka99 Sep 28, 2023
b255ea3
tests: rewrite snapshots
sujuka99 Oct 2, 2023
2b6ac1b
ci: better access to python version
sujuka99 Oct 2, 2023
d1aeac5
ci: remove ruff-ci pre-commit hook
sujuka99 Oct 2, 2023
c56ef96
ci: remove repeating repo definitions pre-commit
sujuka99 Oct 2, 2023
a2c5a7f
chore: typing
sujuka99 Oct 2, 2023
e673acc
ci: replace black with ruff
sujuka99 Oct 2, 2023
83d9b46
ci: remove black
sujuka99 Oct 2, 2023
1d7a04b
ci: update ruff
sujuka99 Oct 2, 2023
51ce484
Merge remote-tracking branch 'origin/ci/introduce-ruff' into ci/repla…
sujuka99 Oct 3, 2023
8190be7
ci: format with ruff
sujuka99 Oct 3, 2023
b07517b
Merge remote-tracking branch 'origin/main' into ci/replace-black-with…
sujuka99 Oct 21, 2023
713b6a6
chore: upgrade ruff
sujuka99 Oct 21, 2023
e138200
Merge remote-tracking branch 'origin/main' into ci/replace-black-with…
sujuka99 Oct 25, 2023
e9d351f
chore: update and configure ruff
sujuka99 Oct 25, 2023
93cf92e
ci(ruff): adjust
sujuka99 Oct 25, 2023
43cf454
ci: rename ruff lint hook
sujuka99 Oct 25, 2023
b9076e4
fix: ci
sujuka99 Oct 25, 2023
5974578
docs(dev): python code style
sujuka99 Oct 25, 2023
da136a2
style: mroe accurate order of ruff config
sujuka99 Oct 25, 2023
37e52ed
fix: docs
sujuka99 Oct 25, 2023
f6ff99e
docs: Add repository name
sujuka99 Oct 25, 2023
7e7d5e8
docs: structure, add custom admonition
sujuka99 Oct 25, 2023
9b81cfc
docs: create CONTRIBUTING.md
sujuka99 Oct 25, 2023
12616c0
ci: add script that copies contributing into docs
sujuka99 Oct 25, 2023
033ccad
ci: copy file
sujuka99 Oct 25, 2023
a938bdf
ci(dprint): ignore admonition
sujuka99 Oct 25, 2023
7e3d678
ci: format
sujuka99 Oct 25, 2023
e117d14
fix: generated doc formatting
sujuka99 Oct 25, 2023
d2c2813
docs: reword a sentence
sujuka99 Oct 25, 2023
f84641d
fix: ci
sujuka99 Oct 25, 2023
7f876c4
docs: document autogeneration
sujuka99 Oct 25, 2023
1300b4a
fix: path in generated file header
sujuka99 Oct 25, 2023
ce8afab
fix: EOF
sujuka99 Oct 26, 2023
aa8fbe5
chore: update ruff
sujuka99 Oct 31, 2023
27e5eba
style: feedback
sujuka99 Oct 31, 2023
cdc4ce6
ci(pre-commit): Run ruff only on modified files
sujuka99 Oct 31, 2023
ab52824
feat: make copying func generic, hook to copy changelog
sujuka99 Nov 2, 2023
de1346b
chore: lint and format
sujuka99 Nov 2, 2023
e04819a
refactor: add header by default
sujuka99 Nov 2, 2023
520b888
style: remove 1 newline
sujuka99 Nov 2, 2023
982a433
chore: remove space
sujuka99 Nov 2, 2023
ea75e6f
fix: avoid clash between hook and dprint
sujuka99 Nov 2, 2023
3b31813
fix: don't use binary mode
sujuka99 Nov 2, 2023
48ff29b
fix: newline problem
sujuka99 Nov 2, 2023
31fdf62
fix: copying files
sujuka99 Nov 2, 2023
ea8a49c
refactor: use symbolic links instead of scripts
sujuka99 Nov 2, 2023
dfc5824
chore: delete unused files
sujuka99 Nov 2, 2023
6e1c6ac
ci: change target path for changelog
sujuka99 Nov 2, 2023
c00d519
fix: changelog file path
sujuka99 Nov 3, 2023
bc96e7d
docs: remove leftover text, improve title
sujuka99 Nov 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ jobs:
echo "::add-matcher::.github/ruff-matcher.json"
poetry run ruff check . --config pyproject.toml --output-format text --no-fix
else
poetry run pre-commit run ruff --all-files --show-diff-on-failure
poetry run pre-commit run ruff-lint --all-files --show-diff-on-failure
fi;

- name: Formatting (black)
run: poetry run pre-commit run black --all-files --show-diff-on-failure
- name: Formatting (ruff)
run: poetry run pre-commit run ruff-format --all-files --show-diff-on-failure
raminqaf marked this conversation as resolved.
Show resolved Hide resolved

- name: Typing (pyright)
run: poetry run pre-commit run pyright --all-files
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
poetry-version: "1.5.1"
changelog: true
changelog-config: "./.github/changelog-config.json"
changelog-file: "./docs/docs/user/changelog.md"
secrets:
github-username: "${{ secrets.GH_USERNAME }}"
github-email: "${{ secrets.GH_EMAIL }}"
Expand Down
21 changes: 11 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
repos:
- repo: local
hooks:
- id: ruff
name: ruff
entry: ruff check .
args: [ --config, pyproject.toml, --fix, --show-fixes, --exit-non-zero-on-fix ]
- id: ruff-lint
name: ruff-lint
entry: ruff check
args: [ --force-exclude, --config, pyproject.toml, --fix, --show-fixes, --exit-non-zero-on-fix ]
language: system
types_or: [python]
require_serial: true # run once for all files
pass_filenames: false
- id: black
name: black
entry: black
- id: ruff-format
name: ruff-format
entry: ruff format
args: [ --force-exclude, --config, pyproject.toml ]
language: system
types_or: [python, pyi]
disrupted marked this conversation as resolved.
Show resolved Hide resolved
types_or: [python]
require_serial: true # run once for all files
exclude: ^tests/.*snapshots/
disrupted marked this conversation as resolved.
Show resolved Hide resolved
- id: pyright
name: pyright
entry: pyright
Expand All @@ -38,13 +37,15 @@ repos:
types: [python]
require_serial: true
exclude: ^tests/.*snapshots/
pass_filenames: false
- id: gen-docs-env-vars
name: gen-docs-env-vars
entry: python hooks/gen_docs/gen_docs_env_vars.py
language: system
types: [python]
require_serial: true
exclude: ^tests/.*snapshots/
pass_filenames: false
- id: gen-docs-components
name: gen-docs-components
entry: python hooks/gen_docs/gen_docs_components.py
Expand Down
Loading