-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Ran ruff for quality * Again + isort * Add quality workflow on PR * typo * Let's not use extras while optimum-nvidia is not pip installable * Valid syntax * More quality * Attempt to understand why ruff is not so happy right now * Format * Disable ruff verbose
- Loading branch information
1 parent
77c5fa5
commit 4034bbf
Showing
34 changed files
with
371 additions
and
319 deletions.
There are no files selected for viewing
This file contains 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,31 @@ | ||
name: Run code quality checks | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check_code_quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.9" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install black ruff isort | ||
- name: Check quality | ||
run: | | ||
ruff check examples tests src scripts | ||
ruff format examples tests src scripts --check |
This file contains 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 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,27 @@ | ||
[tool.ruff] | ||
# Never enforce `E501` (line length violations). | ||
ignore = ["C901", "E501", "E741", "F402", "F823" ] | ||
select = ["C", "E", "F", "I", "W"] | ||
line-length = 119 | ||
|
||
# Ignore import violations in all `__init__.py` files. | ||
[tool.ruff.per-file-ignores] | ||
"__init__.py" = ["E402", "F401", "F403", "F811"] | ||
"examples/*.py" = ["E402"] | ||
|
||
[tool.ruff.isort] | ||
lines-after-imports = 2 | ||
known-first-party = ["optimum"] | ||
|
||
[tool.ruff.format] | ||
# Like Black, use double quotes for strings. | ||
quote-style = "double" | ||
|
||
# Like Black, indent with spaces, rather than tabs. | ||
indent-style = "space" | ||
|
||
# Like Black, respect magic trailing commas. | ||
skip-magic-trailing-comma = false | ||
|
||
# Like Black, automatically detect the appropriate line ending. | ||
line-ending = "auto" |
This file contains 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 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 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.