-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
129 additions
and
71 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
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,49 @@ | ||
--- | ||
exclude: | | ||
(?x)^( | ||
LightGBM | ||
)$ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-toml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
args: ["--settings-path", "pyproject.toml"] | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.10.0 | ||
hooks: | ||
- id: mypy | ||
args: ["--config-file", "pyproject.toml"] | ||
exclude: "tests" | ||
additional_dependencies: | ||
- types-requests | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.4.10 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
args: ["--config", "pyproject.toml"] | ||
types_or: [jupyter, python] | ||
# Run the formatter. | ||
- id: ruff-format | ||
args: ["--config", "pyproject.toml"] | ||
types_or: [python, jupyter] | ||
- repo: https://github.com/maxwinterstein/shfmt-py | ||
rev: v3.7.0.1 | ||
hooks: | ||
- id: shfmt | ||
args: ["--indent=4", "--space-redirects", "--write"] | ||
- repo: https://github.com/shellcheck-py/shellcheck-py | ||
rev: v0.10.0.1 | ||
hooks: | ||
- id: shellcheck | ||
args: ["--exclude=SC2002"] |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,12 +1,33 @@ | ||
[tool.black] | ||
line-length = 100 | ||
exclude = ''' | ||
/( | ||
| LightGBM | ||
)/ | ||
''' | ||
[tool.ruff.lint] | ||
select = [ | ||
# flake8-bugbear | ||
"B", | ||
# flake8-comprehensions | ||
"C4", | ||
# pycodestyle | ||
"E", | ||
# pyflakes | ||
"F", | ||
# NumPy-specific rules | ||
"NPY", | ||
# pylint | ||
"PL", | ||
# flake8-return: unnecessary assignment before return | ||
"RET504", | ||
# flake8-simplify: use dict.get() instead of an if-else block | ||
"SIM401", | ||
] | ||
|
||
[tool.nbqa.exclude] | ||
black = "LightGBM/" | ||
flake8 = "LightGBM/" | ||
isort = "LightGBM/" | ||
[tool.ruff.lint.per-file-ignores] | ||
"*.ipynb" = [ | ||
# (pylint) Unnecessary list() call | ||
"C408", | ||
# (pylint) too many arguments in function definition | ||
"PLR0913", | ||
# (pylint) Magic value used in comparison | ||
"PLR2004", | ||
] | ||
"jupyter_notebook_config.py" = [ | ||
# (flake8) undefined name | ||
"F821", | ||
] |