-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from infocusp/hetul/add-ruff
Add ruff for automatic linting and formatting
- Loading branch information
Showing
10 changed files
with
397 additions
and
201 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,20 @@ | ||
name: Linting | ||
on: | ||
push: | ||
pull_request: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install ruff | ||
# Update output format to enable automatic inline annotations. | ||
- name: Run Ruff | ||
run: ruff check --output-format=github . |
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
site/* | ||
.vscode/* | ||
site/* |
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,5 @@ | ||
{ | ||
"recommendations": [ | ||
"charliermarsh.ruff" | ||
] | ||
} |
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,5 @@ | ||
{ | ||
"editor.rulers": [ | ||
80 | ||
] | ||
} |
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,21 @@ | ||
[tool.ruff] | ||
lint.select = [ | ||
"D", # pydocstyle | ||
"E", # pycodestyle | ||
"F", # pyflakes | ||
"I", # isort | ||
"T201", # print | ||
"E501" # line-too-long | ||
] | ||
# Set the maximum line length to 79. | ||
line-length = 79 | ||
|
||
# TODO(hetul): Fix the formatting and do not exclude this dir. | ||
exclude = ["./session_4/part_2_finetuning_lms_to_human_preferences/mingpt/*"] | ||
|
||
# Ignore import violations in all `__init__.py` files and missing docstring. | ||
[tool.ruff.lint.per-file-ignores] | ||
"__init__.py" = ["E402", "F401", "F403", "F811", "D104"] | ||
|
||
[tool.ruff.lint.pydocstyle] | ||
convention = "google" |
Oops, something went wrong.