fix(pylint): ignore datasets module to resolve E0611 no-name-in-module errors - #4750
fix(pylint): ignore datasets module to resolve E0611 no-name-in-module errors#4750NuojCheng wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the pre-commit configuration to ignore the datasets module during pylint checks. The feedback suggests moving this configuration to the central pylintrc file to ensure consistent linting behavior across all environments, including local IDEs and manual CLI runs.
| - '--disable=R0401,R0917,W0201,W0613' | ||
| - '--ignored-modules=datasets' |
There was a problem hiding this comment.
Instead of passing --ignored-modules=datasets as a command-line argument in the pre-commit configuration, it is highly recommended to add this configuration directly to the pylintrc file.
Centralizing pylint configuration in pylintrc ensures that the same rules and ignores are applied consistently across all environments, including local IDE integrations and manual CLI runs, rather than only during pre-commit hooks.
You can configure this in pylintrc under the [TYPECHECK] section:
[TYPECHECK]
ignored-modules=datasets - '--disable=R0401,R0917,W0201,W0613'
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
PyLint fails with E0611 (no-name-in-module) for module datasets across multiple files because PyLint cannot statically resolve dynamic/lazy attributes in Hugging Face datasets without --ignored-modules=datasets.
Adding --ignored-modules=datasets to PyLint args in .pre-commit-config.yaml resolves all pylint pre-commit checks.