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

chore: cleanup linting errors and introduce strict linting checks #27288

Merged
merged 11 commits into from
Sep 1, 2021

Conversation

ankush
Copy link
Member

@ankush ankush commented Sep 1, 2021

Problem: preventable errors passing through the review process. We use sider for these issues but sider is limited to "diff" while trying to be "diff-aware" it ignores the problem caused by the change in the same file.

Example:

 def (a, b):
+    return a
     return a + b

Something like this would be totally acceptable to sider, but flake8 will warn you about dead code.

Solution:

  • Create a subset of the flake8 rules that MUST be cleared for all PR. This subset is critical things like "undefined variable".
  • Run these in CI and provide them as pre-commit hooks too.

Additional checks:

  • block committing merge conflicts
  • block committing python code that's not parsable.
  • Strip whitespace and EOF.
  • Block committing to develop directly. (common mistake by new contributors that leads to conflicts in future)

To start using this install pre-commit using pip install pre-commit and then do pre-commit install.

Screenshot 2021-09-01 at 4 05 08 PM

TODO:

  • update contribution guideline (post merge)

@ankush ankush force-pushed the strict_linting branch 4 times, most recently from a0cebdb to 5c1cc24 Compare September 1, 2021 11:16
@ankush ankush added the dont squash Don't squash and merge label Sep 1, 2021
@ankush ankush merged commit 81eb6fd into frappe:develop Sep 1, 2021
@ankush ankush deleted the strict_linting branch September 1, 2021 14:02
asoral pushed a commit to asoral/erpnext that referenced this pull request Nov 12, 2021
chore: cleanup linting errors and introduce strict linting checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant