Skip to content

Commit 4d3d5e4

Browse files
author
Lorena Mesa
committed
Update GitHub actions linter check and add ruff config for codebase
1 parent d597867 commit 4d3d5e4

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed

.github/workflows/github-actions-linter.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ jobs:
99
- uses: actions/setup-python@v3
1010
- uses: chartboost/ruff-action@v1
1111
with:
12-
args: --check .
13-
fix_args: --fix .
12+
args: check --fix .
1413
config: .ruff.toml
1514
- uses: stefanzweifel/git-auto-commit-action@v4
1615
with:

.ruff.toml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Exclude a variety of commonly ignored directories.
2+
exclude = [
3+
".bzr",
4+
".direnv",
5+
".eggs",
6+
".git",
7+
".git-rewrite",
8+
".hg",
9+
".ipynb_checkpoints",
10+
".mypy_cache",
11+
".nox",
12+
".pants.d",
13+
".pyenv",
14+
".pytest_cache",
15+
".pytype",
16+
".ruff_cache",
17+
".svn",
18+
".tox",
19+
".venv",
20+
".vscode",
21+
"__pypackages__",
22+
"_build",
23+
"buck-out",
24+
"build",
25+
"dist",
26+
"node_modules",
27+
"site-packages",
28+
"venv",
29+
]
30+
31+
# Same as Black.
32+
line-length = 88
33+
indent-width = 4
34+
35+
# Assume Python 3.8
36+
target-version = "py310"
37+
38+
[lint]
39+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
40+
select = ["E4", "E7", "E9", "F"]
41+
ignore = []
42+
43+
# Allow fix for all enabled rules (when `--fix`) is provided.
44+
fixable = ["ALL"]
45+
unfixable = []
46+
47+
# Allow unused variables when underscore-prefixed.
48+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
49+
50+
[format]
51+
# Like Black, use double quotes for strings.
52+
quote-style = "double"
53+
54+
# Like Black, indent with spaces, rather than tabs.
55+
indent-style = "space"
56+
57+
# Like Black, respect magic trailing commas.
58+
skip-magic-trailing-comma = false
59+
60+
# Like Black, automatically detect the appropriate line ending.
61+
line-ending = "auto"

0 commit comments

Comments
 (0)