Skip to content

Commit c673972

Browse files
committed
switch to Ruff linter
1 parent 0b148fb commit c673972

File tree

2 files changed

+82
-5
lines changed

2 files changed

+82
-5
lines changed

.github/workflows/pylint.yml .github/workflows/ruff_linting.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pylint
1+
name: Ruff linting
22

33
on: [push]
44

@@ -18,8 +18,8 @@ jobs:
1818
- name: Install dependencies
1919
run: |
2020
python -m pip install --upgrade pip
21-
pip install gpflow>=2.6.0 numpy pandas==1.5.3 pylint rpy2==3.4.5 scipy statsmodels
22-
- name: Analysing the code with pylint
21+
pip install gpflow>=2.6.0 numpy pandas==1.5.3 rpy2==3.4.5 ruff scipy statsmodels
22+
- name: Analysing the code with Ruff
2323
run: |
24-
pylint $(git ls-files '*.py') --disable=line-too-long,missing-class-docstring,missing-function-docstring,missing-module-docstring --fail-under=7
25-
# continue-on-error: true
24+
ruff check . --exit-zero
25+
continue-on-error: true

ruff.toml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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.10
36+
target-version = "py310"
37+
38+
[lint]
39+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
40+
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
41+
# McCabe complexity (`C901`) by default.
42+
select = ["E4", "E7", "E9", "F"]
43+
ignore = []
44+
45+
# Allow fix for all enabled rules (when `--fix`) is provided.
46+
fixable = ["ALL"]
47+
unfixable = []
48+
49+
# Allow unused variables when underscore-prefixed.
50+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
51+
52+
[format]
53+
# Like Black, use double quotes for strings.
54+
quote-style = "double"
55+
56+
# Like Black, indent with spaces, rather than tabs.
57+
indent-style = "space"
58+
59+
# Like Black, respect magic trailing commas.
60+
skip-magic-trailing-comma = false
61+
62+
# Like Black, automatically detect the appropriate line ending.
63+
line-ending = "auto"
64+
65+
# Enable auto-formatting of code examples in docstrings. Markdown,
66+
# reStructuredText code/literal blocks and doctests are all supported.
67+
#
68+
# This is currently disabled by default, but it is planned for this
69+
# to be opt-out in the future.
70+
docstring-code-format = false
71+
72+
# Set the line length limit used when formatting code snippets in
73+
# docstrings.
74+
#
75+
# This only has an effect when the `docstring-code-format` setting is
76+
# enabled.
77+
docstring-code-line-length = "dynamic"

0 commit comments

Comments
 (0)