-
Notifications
You must be signed in to change notification settings - Fork 44
[CVAT] [Exchange Oracle] Add ruff #2395
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
Merged
Merged
Changes from all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
87698f9
[Exchange Oracle] Add Ruff
Bobronium 6de538f
[Exchange Oracle] Reformat code with Ruff
Bobronium 430602c
[Exchange Oracle] Autofix ANN204: missing-return-type-special-method
Bobronium 31f4f1e
[Exchange Oracle] Autofix E713: not-in-test
Bobronium 3ab7776
[Exchange Oracle] Autofix F541: f-string-missing-placeholders
Bobronium 072c9fa
[Exchange Oracle] Autofix F841: unused-variable
Bobronium 52ffe89
[Exchange Oracle] Autofix RET501: unnecessary-return-none
Bobronium 99f07fb
[Exchange Oracle] Autofix RET505: superfluous-else-return
Bobronium 16b158f
[Exchange Oracle] Autofix RET506: superfluous-else-raise
Bobronium e34b403
[Exchange Oracle] Autofix RET507: superfluous-else-continue
Bobronium ca8bcab
[Exchange Oracle] Autofix SIM201: negate-equal-op
Bobronium 5ef64a4
[Exchange Oracle] Autofix SIM910: dict-get-with-none-default
Bobronium 5d421a9
[Exchange Oracle] Autofix UP005: deprecated-unittest-alias
Bobronium d97e6e7
[Exchange Oracle] Autofix UP006: non-pep585-annotation
Bobronium 809a949
[Exchange Oracle] Autofix UP007: non-pep604-annotation
Bobronium b691dcd
[Exchange Oracle] Autofix UP032: f-string
Bobronium fb59e0b
[Exchange Oracle] Autofix UP035: deprecated-import
Bobronium 19e66ef
[Exchange Oracle] Autofix UP037: quoted-annotation
Bobronium 7bb3178
[Exchange Oracle] Unsafe autofix ANN204: missing-return-type-special-…
Bobronium fc17925
[Exchange Oracle] Unsafe autofix ANN205: missing-return-type-static-m…
Bobronium 35029dc
[Exchange Oracle] Unsafe autofix ANN206: missing-return-type-class-me…
Bobronium 4409a7f
[Exchange Oracle] Unsafe autofix B006: mutable-argument-default
Bobronium e655ec3
[Exchange Oracle] Unsafe autofix B007: unused-loop-control-variable
Bobronium f99c48b
[Exchange Oracle] Unsafe autofix B011: assert-false
Bobronium 822954c
[Exchange Oracle] Unsafe autofix C400: unnecessary-generator-list
Bobronium e1a1df5
[Exchange Oracle] Unsafe autofix C401: unnecessary-generator-set
Bobronium ab0b890
[Exchange Oracle] Unsafe autofix C408: unnecessary-collection-call
Bobronium 21a0f38
[Exchange Oracle] Unsafe autofix E731: lambda-assignment
Bobronium e0b704d
[Exchange Oracle] Unsafe autofix F841: unused-variable
Bobronium 5dd9c05
[Exchange Oracle] Unsafe autofix FLY002: static-join-to-f-string
Bobronium d6348b4
[Exchange Oracle] Unsafe autofix PT009: pytest-unittest-assertion
Bobronium 535ba96
[Exchange Oracle] Unsafe autofix PT018: pytest-composite-assertion
Bobronium 1ffc29d
[Exchange Oracle] Unsafe autofix PT027: pytest-unittest-raises-assertion
Bobronium d3e11ee
[Exchange Oracle] Unsafe autofix RET503: implicit-return
Bobronium b32be09
[Exchange Oracle] Unsafe autofix RET504: unnecessary-assign
Bobronium a2eee86
[Exchange Oracle] Unsafe autofix RUF013: implicit-optional
Bobronium 7d754d7
[Exchange Oracle] Unsafe autofix SIM101: duplicate-isinstance-call
Bobronium 1874418
[Exchange Oracle] Unsafe autofix SIM102: collapsible-if
Bobronium b57d223
[Exchange Oracle] Unsafe autofix SIM103: needless-bool
Bobronium c46d719
[Exchange Oracle] Unsafe autofix SIM108: if-else-block-instead-of-if-exp
Bobronium c2486a1
[Exchange Oracle] Unsafe autofix TCH001: typing-only-first-party-import
Bobronium ae57360
[Exchange Oracle] Unsafe autofix TCH003: typing-only-standard-library…
Bobronium 5919cd0
[Exchange Oracle] Unsafe autofix TRY201: verbose-raise
Bobronium e821c6f
[Exchange Oracle] Unsafe autofix TRY400: error-instead-of-exception
Bobronium 93d8f47
[Exchange Oracle] Unsafe autofix UP031: printf-string-formatting
Bobronium 272d783
[Exchange Oracle] Unsafe autofix SIM300: yoda-conditions
Bobronium ab8917e
[Exchange Oracle] Autofix UP032: f-string
Bobronium ed3d67d
[Exchange Oracle] Autofix UP038: non-pep604-isinstance
Bobronium 39cea4f
[Exchange Oracle] Add missing __init__.py modules
Bobronium afbb801
[Exchange Oracle] Restore commented out test code and use xfail
Bobronium 2b7d8f4
[Exchange Oracle] Use iterable unpacking instead of concatenation
Bobronium 9acc8b6
[Exchange Oracle] Rewrite the last two self.assert*Equal
Bobronium 127ab0d
[Exchange Oracle] Add missing __init__.py modules to tests
Bobronium 4c1c3d3
[Exchange Oracle] Add __init__.py to alembic.versions
Bobronium f256f79
[Exchange Oracle] Use pytest.raises with match
Bobronium 83b25d1
[Exchange Oracle] Fix/ignore remaining issues
Bobronium 27c89ea
[Exchange Oracle] Change comments slightly
Bobronium 158f9c4
[Exchange Oracle] Ignore all rules conflicting with `ruff format`
Bobronium b25b582
[Exchange Oracle] Use % formatting on string with `{` and `}` symbols
Bobronium 5dc42d7
[Exchange Oracle] Fix removal of `LockNotAvailable` in `src.db.errors`
Bobronium ce819b2
[Exchange Oracle] Partially revert "Autofix UP032: f-string"
Bobronium c09f0f8
[Exchange Oracle] Enable E501 rule
Bobronium 3473816
[Exchange Oracle] Ignore UP032
Bobronium 8bb6d60
[Exchange Oracle] Visually separate if conditions
Bobronium c7fc560
[Exchange Oracle] Remove unnecessary line breaks in with statements
Bobronium 3fc87a5
[Exchange Oracle] Fix tests
Bobronium abc9b4f
Revert "[Exchange Oracle] Unsafe autofix C401: unnecessary-generator-…
Bobronium 6eb0704
Revert "[Exchange Oracle] Autofix RET505: superfluous-else-return"
Bobronium f726a4d
[Exchange Oracle] Ignore controversial rules
Bobronium File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: CVAT Exchange Oracle Lint | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - 'packages/examples/cvat/exchange-oracle/**' | ||
| - '.github/workflows/ci-lint-cvat-exchange-oracle.yaml' | ||
|
|
||
| env: | ||
| WORKING_DIR: ./packages/examples/cvat/exchange-oracle | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: ./packages/examples/cvat/exchange-oracle | ||
|
|
||
| jobs: | ||
| cvat-exo-lint: | ||
| name: CVAT Exchange Oracle Lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| cache: 'pip' | ||
| cache-dependency-path: ${{ env.WORKING_DIR }}/poetry.lock | ||
| - run: python -m pip install poetry | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.10' | ||
| cache: 'poetry' | ||
| cache-dependency-path: ${{ env.WORKING_DIR }}/poetry.lock | ||
| - run: poetry install --no-root --only dev | ||
| - run: poetry run pre-commit run --all-files |
24 changes: 15 additions & 9 deletions
24
packages/examples/cvat/exchange-oracle/.pre-commit-config.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,17 @@ | ||
| repos: | ||
| - repo: https://github.com/psf/black | ||
| rev: 22.6.0 | ||
| - repo: local | ||
| hooks: | ||
| - id: black | ||
| language_version: python3.11 | ||
| - repo: https://github.com/PyCQA/isort | ||
| rev: 5.12.0 | ||
| hooks: | ||
| - id: isort | ||
| language_version: python3.11 | ||
| - id: lint | ||
| name: lint | ||
| entry: ruff check --fix --unsafe-fixes --show-fixes | ||
| language: system | ||
| require_serial: true | ||
| files: "^packages/examples/cvat/exchange-oracle/.*" | ||
| types: [python] | ||
| - id: format | ||
| name: format | ||
| entry: ruff format | ||
| require_serial: true | ||
| language: system | ||
| files: "^packages/examples/cvat/exchange-oracle/.*" | ||
| types: [python] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/examples/cvat/exchange-oracle/alembic/versions/16ecc586d685_init.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.