Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] add mypy to linting task #3868

Merged
merged 1 commit into from
Jan 27, 2021
Merged

Conversation

jameslamb
Copy link
Collaborator

Based on #3865 (comment), this PR proposes adding mypy to the lint task in CI.

Similar to the approach we took with cpplint (#1990), this PR will print logs from mypy but not actually enforce anything yet. I've opened #3867 to document why mypy is valuable and explain how contributors can help with it.

echo "Linting Python code"
pycodestyle --ignore=E501,W503 --exclude=./.nuget,./external_libs . || exit -1
pydocstyle --convention=numpy --add-ignore=D105 --match-dir="^(?!^external_libs|test|example).*" --match="(?!^test_|setup).*\.py" . || exit -1
mypy --ignore-missing-imports python-package/ || true
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose to do || true here instead of || exit 0 so it can stay here with other Python package logs

Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you!

@StrikerRUS StrikerRUS merged commit b4b1b75 into microsoft:master Jan 27, 2021
@jameslamb jameslamb deleted the ci/mypy branch January 27, 2021 15:12
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants