-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] enable ruff-format on some files, add pre-commit config (#6308)
- Loading branch information
Showing
10 changed files
with
207 additions
and
171 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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
exclude: | | ||
(?x)^( | ||
build| | ||
external_libs| | ||
lightgbm-python| | ||
lightgbm_r| | ||
)$ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.2.1 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
args: ["--config", "python-package/pyproject.toml"] | ||
# Run the formatter. | ||
- id: ruff-format | ||
args: ["--config", "python-package/pyproject.toml"] | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
args: ["--settings-path", "python-package/pyproject.toml"] |
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,8 +1,28 @@ | ||
LightGBM has been developed and used by many active community members. Your help is very valuable to make it better for everyone. | ||
# contributing | ||
|
||
LightGBM has been developed and used by many active community members. | ||
|
||
Your help is very valuable to make it better for everyone. | ||
|
||
## How to Contribute | ||
|
||
- Check for the [Roadmap](https://github.com/microsoft/LightGBM/projects/1) and the [Feature Requests Hub](https://github.com/microsoft/LightGBM/issues/2302), and submit pull requests to address chosen issue. If you need development guideline, you can check the [Development Guide](https://github.com/microsoft/LightGBM/blob/master/docs/Development-Guide.rst) or directly ask us in Issues/Pull Requests. | ||
- Contribute to the [tests](https://github.com/microsoft/LightGBM/tree/master/tests) to make it more reliable. | ||
- Contribute to the [documentation](https://github.com/microsoft/LightGBM/tree/master/docs) to make it clearer for everyone. | ||
- Contribute to the [examples](https://github.com/microsoft/LightGBM/tree/master/examples) to share your experience with other users. | ||
- Add your stories and experience to [Awesome LightGBM](https://github.com/microsoft/LightGBM/blob/master/examples/README.md). If LightGBM helped you in a machine learning competition or some research application, we want to hear about it! | ||
- [Open an issue](https://github.com/microsoft/LightGBM/issues) to report problems or recommend new features. | ||
|
||
## Development Guide | ||
|
||
### Linting | ||
|
||
Every commit in the repository is tested with multiple static analyzers. | ||
|
||
When developing locally, run some of them using `pre-commit` ([pre-commit docs](https://pre-commit.com/)). | ||
|
||
```shell | ||
pre-commit run --all-files | ||
``` | ||
|
||
That command will check for some issues and automatically reformat the code. |
Oops, something went wrong.