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

Linting and consistent formatting #19

Open
3 tasks
thor opened this issue Nov 10, 2018 · 1 comment
Open
3 tasks

Linting and consistent formatting #19

thor opened this issue Nov 10, 2018 · 1 comment

Comments

@thor
Copy link
Member

thor commented Nov 10, 2018

There's a lot of room for code improvement, even with the high amounts of things that have been fixed.

Thus, we should look at things like:

  • pylint
  • mypy

Or maybe packages of them, like:

  • pylama

Code analysis and formatters too:

Tool Category Description
Mccabe Analytical Checks McCabe complexity
Radon Analytical Analyzes code for various metrics (lines of code, complexity, and so on)
Black Formatter Formats Python code without compromise
Isort Formatter Formats imports by sorting alphabetically and separating into sections
@susannmt
Copy link
Member

I think linting, for instance using pylint, sounds like a good idea. I am personally not a big fan of black, because it changes the code. I see the attraction, you then don't have to memorize all formatting rules, and the code will be formatted the same way a 100%. It will also make it quick and easy to format the existing code. However, I think you "lose ownership" a bit, and it is as you write "without compromise".

As for type annotation, I think that it is very useful for function/method input/output arguments, but my experience with enforcing mypy is that it makes the code a bit cluttered with types, since they must be added for every local variable also.

I'm not familiar with the other things you list here, but from a quick search pylama looks really cool and easy to use. I suggest trying it out for a bit. With things like these, one just have to agree on a norm and go with it.

@thor thor added this to the next milestone Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants