Skip to content

Commit 0cbd0e9

Browse files
authored
Fix lint during dependency workflow (#435)
1 parent a9277dc commit 0cbd0e9

File tree

5 files changed

+25
-14
lines changed

5 files changed

+25
-14
lines changed

.github/workflows/dependency_checker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
run: |
1717
python -m pip install .[dev]
1818
make check-deps OUTPUT_FILEPATH=latest_requirements.txt
19+
make fix-lint
1920
- name: Create pull request
2021
id: cpr
2122
uses: peter-evans/create-pull-request@v4

copulas/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ def _find_addons():
6969
try:
7070
addon = entry_point.load()
7171
except Exception as e: # pylint: disable=broad-exception-caught
72-
msg = (
73-
f'Failed to load "{entry_point.name}" from "{entry_point.value}" '
74-
f'with error:\n{e}'
75-
)
72+
msg = f'Failed to load "{entry_point.name}" from "{entry_point.value}" with error:\n{e}'
7673
warnings.warn(msg)
7774
continue
7875

copulas/multivariate/vine.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ class VineCopula(Multivariate):
7676
def __init__(self, vine_type, random_state=None):
7777
if sys.version_info > (3, 8):
7878
warnings.warn(
79-
'Vines have not been fully tested on Python >= 3.8 and might '
80-
'produce wrong results.'
79+
'Vines have not been fully tested on Python >= 3.8 and might produce wrong results.'
8180
)
8281

8382
self.random_state = validate_random_state(random_state)

pyproject.toml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ exclude = [
182182
".git",
183183
"__pycache__",
184184
".ipynb_checkpoints",
185-
"*.ipynb"
185+
"*.ipynb",
186+
"tasks.py",
186187
]
187188

188189
[tool.ruff.lint]
@@ -192,14 +193,23 @@ select = [
192193
# Pycodestyle
193194
"E",
194195
"W",
195-
"D200",
196+
# pydocstyle
197+
"D",
196198
# isort
197199
"I001",
200+
# print statements
201+
"T201",
202+
# pandas-vet
203+
"PD",
204+
# numpy 2.0
205+
"NPY201"
198206
]
199207
ignore = [
200-
"E501",
208+
# pydocstyle
201209
"D107", # Missing docstring in __init__
202210
"D417", # Missing argument descriptions in the docstring, this is a bug from pydocstyle: https://github.com/PyCQA/pydocstyle/issues/449
211+
"PD901",
212+
"PD101",
203213
]
204214

205215
[tool.ruff.format]
@@ -209,14 +219,18 @@ preview = true
209219
docstring-code-format = true
210220
docstring-code-line-length = "dynamic"
211221

212-
[tool.ruff.lint.pep8-naming]
213-
extend-ignore-names = ["X", "C", "X_padded", "Y", "Y_padded"]
214-
215222
[tool.ruff.lint.isort]
216223
known-first-party = ["copulas"]
224+
lines-between-types = 0
217225

218226
[tool.ruff.lint.per-file-ignores]
219227
"__init__.py" = ["F401", "E402", "F403", "F405", "E501", "I001"]
228+
"errors.py" = ["D105"]
229+
"tests/**.py" = ["D"]
220230

221231
[tool.ruff.lint.pydocstyle]
222232
convention = "google"
233+
234+
[tool.ruff.lint.pycodestyle]
235+
max-doc-length = 100
236+
max-line-length = 100

tests/large_scale_evaluation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def _get_parser():
236236
'-s',
237237
'--sample',
238238
type=int,
239-
help=('Limit the test to a number of datasets (sampled randomly)' ' specified by SAMPLE.'),
239+
help=('Limit the test to a number of datasets (sampled randomly) specified by SAMPLE.'),
240240
)
241241
parser.add_argument('-r', '--max-rows', type=int, help='Limit the number of rows per dataset.')
242242
parser.add_argument(
@@ -285,7 +285,7 @@ def main():
285285

286286
results = run_evaluation(model_names, dataset_names, args.max_rows, args.max_columns)
287287

288-
print(tabulate.tabulate(results, tablefmt='github', headers=results.columns, showindex=False))
288+
print(tabulate.tabulate(results, tablefmt='github', headers=results.columns, showindex=False)) # noqa
289289

290290
if args.output_path:
291291
LOGGER.info('Saving report to %s', args.output_path)

0 commit comments

Comments
 (0)