File tree Expand file tree Collapse file tree 2 files changed +65
-0
lines changed
Expand file tree Collapse file tree 2 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 2727
2828 readarray -t changed_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.added_modified }}')"
2929 ~/go/bin/editorconfig-checker ${changed_files[@]}
30+ - name : Lint and format Python with Ruff
31+ uses : astral-sh/ruff-action@v1
3032
3133 typo :
3234 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -21,3 +21,66 @@ testpaths = ["."]
2121[build-system ]
2222requires = [" poetry-core" ]
2323build-backend = " poetry.core.masonry.api"
24+
25+ [tool .ruff ]
26+ # Exclude a variety of commonly ignored directories.
27+ exclude = [
28+ " .bzr" ,
29+ " .direnv" ,
30+ " .eggs" ,
31+ " .git" ,
32+ " .git-rewrite" ,
33+ " .hg" ,
34+ " .ipynb_checkpoints" ,
35+ " .mypy_cache" ,
36+ " .nox" ,
37+ " .pants.d" ,
38+ " .pyenv" ,
39+ " .pytest_cache" ,
40+ " .pytype" ,
41+ " .ruff_cache" ,
42+ " .svn" ,
43+ " .tox" ,
44+ " .venv" ,
45+ " .vscode" ,
46+ " __pypackages__" ,
47+ " _build" ,
48+ " buck-out" ,
49+ " build" ,
50+ " dist" ,
51+ " node_modules" ,
52+ " site-packages" ,
53+ " venv" ,
54+ ]
55+
56+ # Same as Black.
57+ line-length = 88
58+ indent-width = 4
59+
60+ # Assume Python 3.9
61+ target-version = " py39"
62+
63+ [tool .ruff .lint ]
64+ # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
65+ select = [" E4" , " E7" , " E9" , " F" ]
66+ ignore = []
67+
68+ # Allow fix for all enabled rules (when `--fix`) is provided.
69+ fixable = [" ALL" ]
70+ unfixable = []
71+
72+ # Allow unused variables when underscore-prefixed.
73+ dummy-variable-rgx = " ^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
74+
75+ [tool .ruff .format ]
76+ # Like Black, use double quotes for strings.
77+ quote-style = " double"
78+
79+ # Like Black, indent with spaces, rather than tabs.
80+ indent-style = " space"
81+
82+ # Like Black, respect magic trailing commas.
83+ skip-magic-trailing-comma = false
84+
85+ # Like Black, automatically detect the appropriate line ending.
86+ line-ending = " auto"
You can’t perform that action at this time.
0 commit comments