-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ruff lint workflow and address linting issues (#6)
* Add linting and formatting checks in workflow * Address linting and formatting issues identified by Ruff
- Loading branch information
1 parent
ac112fe
commit 0501a77
Showing
10 changed files
with
153 additions
and
62 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,37 @@ | ||
# ruff.toml | ||
|
||
line-length = 120 | ||
|
||
# Exclude specific files or directories. | ||
exclude = [ | ||
"build/", | ||
"dist/", | ||
".venv/", | ||
"__pycache__/", | ||
] | ||
|
||
[lint] | ||
# Enable all basic PEP 8 checks and other common linting rules. | ||
select = [ | ||
"E", # PEP 8 rules (formatting issues) | ||
"F", # Pyflakes rules (undefined names, etc.) | ||
"W", # Additional PEP 8 rules (warning-level issues) | ||
"I", # Import order checker (ensuring imports are ordered correctly) | ||
"ERA", # flake8-eradicate (identifying commented-out code) | ||
"N" # Naming convention rules | ||
] | ||
|
||
ignore = [ | ||
"F811", # Ignore the error for multimethod function | ||
] | ||
|
||
[lint.flake8-annotations] | ||
allow-star-arg-any = true | ||
|
||
[format] | ||
quote-style = "preserve" | ||
indent-style = "space" | ||
docstring-code-format = true | ||
docstring-code-line-length = 100 | ||
|
||
|
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,44 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Run Linter | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install ruff | ||
- name: Lint Python Code with Ruff | ||
run: | | ||
ruff check --config .github/ruff.toml | ||
- name: Check Python Code Formatting with Ruff | ||
run: | | ||
ruff format --check --config .github/ruff.toml | ||
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
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
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.