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

add flake8 linting to Makefile and github actions #1399

Closed
wants to merge 1 commit into from

Conversation

clavedeluna
Copy link
Contributor

Related to #1195

I saw #1195 and since I have experience with flake8 I decided to contribute.

@clavedeluna
Copy link
Contributor Author

The new flake8 step fails the pipeline because we need to agree on how to tune it:

  1. turn off the currently failing flake8 codes
  2. go ahead and fix each failing code

I'm happy to do either, but @defnull could you opine what you'd like flake8 to do?

@defnull
Copy link
Member

defnull commented Sep 7, 2024

I'm not a big fan of automates code formatting or, in this case, style checkers to be honest. Bottle is written by hand and most of the lines that trigger flake8 warnings (even after ignoring the 10 most common error-types) were written that way on purpose. I often 'break the rules' to transport information via formatting. For example: Code that should be uninteresting for the average reader (e.g. trivial implementation details) is written more compact so it does not distract from the actually important parts. Instead of having two screens of import statements, I put all of the obvious ones in one line. If a number of trivial methods of a class all fit in one line each, I write one-line def statements without lines in-between, using only one third of the space. And so on.

Adding a flake8 check for PRs would be dishonest, because I myself would ignore those warnings most of the time. I'd rather have PRs that fit the style of the surrounding code.

@defnull defnull closed this Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants