Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
32781bae
Unverified
Commit
32781bae
authored
Oct 16, 2025
by
Nikita Titov
Committed by
GitHub
Oct 15, 2025
Browse files
[ci] move mypy to pre-commit (#7062)
parent
531aeace
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
20 deletions
+13
-20
.ci/lint-all.sh
.ci/lint-all.sh
+2
-5
.ci/run-pre-commit-mypy.sh
.ci/run-pre-commit-mypy.sh
+0
-14
.pre-commit-config.yaml
.pre-commit-config.yaml
+10
-0
python-package/README.rst
python-package/README.rst
+1
-1
No files found.
.ci/lint-all.sh
View file @
32781bae
...
@@ -9,17 +9,14 @@ pwsh -file ./.ci/lint-powershell.ps1 || exit 1
...
@@ -9,17 +9,14 @@ pwsh -file ./.ci/lint-powershell.ps1 || exit 1
conda create
-q
-y
-n
test-env
\
conda create
-q
-y
-n
test-env
\
"python=3.13[build=*_cp*]"
\
"python=3.13[build=*_cp*]"
\
'biome>=1.9.3'
\
'biome>=1.9.3'
\
'matplotlib-base>=3.9.1'
\
'mypy>=1.11.1'
\
'pre-commit>=3.8.0'
\
'pre-commit>=3.8.0'
\
'pyarrow-core>=17.0'
\
'scikit-learn>=1.5.2'
\
'r-lintr>=3.1.2'
'r-lintr>=3.1.2'
# shellcheck disable=SC1091
# shellcheck disable=SC1091
source
activate test-env
source
activate test-env
bash ./.ci/run-pre-commit-mypy.sh
||
exit
1
echo
"Running pre-commit checks"
pre-commit run
--all-files
||
exit
1
echo
"Linting R code"
echo
"Linting R code"
Rscript ./.ci/lint-r-code.R
"
$(
pwd
)
"
||
exit
1
Rscript ./.ci/lint-r-code.R
"
$(
pwd
)
"
||
exit
1
...
...
.ci/run-pre-commit-mypy.sh
deleted
100755 → 0
View file @
531aeace
#!/bin/bash
set
-e
-E
-u
-o
pipefail
echo
"running pre-commit checks"
pre-commit run
--all-files
||
exit
1
echo
"done running pre-commit checks"
echo
"running mypy"
mypy
\
--config-file
=
./python-package/pyproject.toml
\
./python-package
\
||
true
echo
"done running mypy"
.pre-commit-config.yaml
View file @
32781bae
...
@@ -88,3 +88,13 @@ repos:
...
@@ -88,3 +88,13 @@ repos:
hooks
:
hooks
:
-
id
:
validate-pyproject
-
id
:
validate-pyproject
files
:
python-package/pyproject.toml$
files
:
python-package/pyproject.toml$
-
repo
:
https://github.com/pre-commit/mirrors-mypy
rev
:
v1.18.2
hooks
:
-
id
:
mypy
verbose
:
true
entry
:
bash -c 'mypy --config-file=./python-package/pyproject.toml ./python-package ||
true
'
additional_dependencies
:
-
matplotlib>=3.9.1
-
pyarrow>=17.0
-
scikit-learn>=1.5.2
python-package/README.rst
View file @
32781bae
...
@@ -346,7 +346,7 @@ To check that a contribution to the package matches its style expectations, run
...
@@ -346,7 +346,7 @@ To check that a contribution to the package matches its style expectations, run
.. code:: sh
.. code:: sh
bash .ci/run-pre-commit-mypy.sh
pre-commit run --all-files
To run the tests locally and compute test coverage, install the Python package using one of the options mentioned above.
To run the tests locally and compute test coverage, install the Python package using one of the options mentioned above.
Then run the following from the root of the repo.
Then run the following from the root of the repo.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment