You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/12/13 00:11:00 UTC

[GitHub] [incubator-superset] willbarrett commented on issue #8828: Do we really need four different Python linters?

willbarrett commented on issue #8828: Do we really need four different Python linters?
URL: https://github.com/apache/incubator-superset/issues/8828#issuecomment-565244146
 
 
   As it stands now, we have:
   
   `black` - automatic code formatting
   `pylint` - enforces a wide variety of rules
   `mypy` - type checking
   `isort` - automatic package sorting
   
   `black`'s maintainers explicitly recommend using `black` with `isort`, and are working on ensuring interoperability. Neither of those tools do anything with type checking, hence the inclusion of `mypy`. `pylint` is the most annoying to deal with, IMHO, when it comes to code formatting issues. The bits of it I like are ensuring that classes inheriting from a parent don't alter method signatures, ensuring that classes implement all of the methods required by their abstract classes, and identifying classes and functions that are too big and should be broken up.
   
   I'd love to get this down to a single linter as well, but I'm wondering which checks we'd be willing to walk away from? There doesn't seem to be a single linter that covers everything in the Python ecosystem right now, but I'd love to be proven wrong on that!
   
   The main pain points I have:
   1. I have to run a bunch of different commands to see if my code will pass all the linters, and I usually miss one or more for N files in any PR where I'm making changes, even with auto-linting set up in PyCharm. I wonder if there is a way we could implement a `superset lint X` command that would do all the things at once and act as a controller for whatever linters we have in the project?
   2. `isort` and `black` disagreeing on whitespace when I'm trying to comment on an `import` statement
   3. `pylint: disable=` comments triggering `black` reformatting

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org