-
Notifications
You must be signed in to change notification settings - Fork 112
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
black, isort, and doc8 - should we use them in our CI? #930
Comments
On top of CI, nowadays its pretty popular to run them with pre-commit
|
I believe we should use all of these as part of our CI build/test process. We should also use mypy as part of that process, but we might want to wait until after we deprecate support for Python 3.5 for that one. |
I was somewhat bored on a weekend, and I did some stuff with pre-commit along with your recommended linters into a branch. Let me know what you think. Most changes were automated by pre-commit, so the more important files to look at would be .travis.yml, setup.cfg, tasks.py, and .pre-commit-config.yaml |
@xNinjaKittyx I really like the basic approach. I'm sorry you were bored, but I'm glad you spent the time doing this ;-) I think we want to tweak the default configurations a little though. For starters, for skip-string-normalization = true If at a later time we decide we want to follow a stricter adherence to the Also, we need to make sure our settings for (cmd2) ➜ cmd2 git:(ci_improvements) inv flake8
0
./setup.py:52:63: E231 missing whitespace after ','
"test": ["codecov", "coverage", "pytest", "pytest-cov",],
^
1 E231 missing whitespace after ','
1 I think that is for a nested |
Yeah for E231, it's an unfortunate bug that's in black's 2nd to last release. There's several reports, but here's one for example Regarding why I avoided the latest release is due to this bug I thought I added this to setup.cfg to ignore E231
running black twice I think is worse than just temporarily disabling E231 until black has a better release in my opinion. Let me know what you think. As for the string normalization, I'll do that. |
Yeah I'm fine temporarily disabling E231 until black is fixed. If we do that, we need to make sure we do it universally so it is the same for pre-commit, running manually via invoke and running in the unit tests |
@kmvanbrunt @anselor Can one or both of you please take a look at the changes on this branch. There are lots of little whitespace changes with the adoption of |
I had another question... For Since |
2 things come to mind. One is when I'm working on a component I like being able to run things scoped to that component. So like run validation and testing on just the plug-in without running it on everything. The second is that the plugin was in it's own repo before so it could be a holdover. I'll try to take a look at the changes tomorrow when I'm in a computer. |
@xNinjaKittyx I think we are going to have to refactor some of your work on the I envision adding something like a I also think that at least to start it would be best to run it on either on |
@xNinjaKittyx Since we went ahead and made the various CI improvements using GitHub actions, albeit not use pre-commit hooks, I"m thinking of deleting your |
I don't have much knowledge into github actions, maybe i'll check it out sometime in the future. Feel free to delete the branch, thanks for letting me know! |
black is an extremely popular tool for automatically formatting Python code to match the very opinionated black coding standard.
isort is a tool for automatically sorting Python imports to match a given style.
doc8 is a Sphinx style checker.
mypy is an optional static type checker
Should we incorporate one or more of these tools into our CI process similar to how we have incorporated
flake8
? Of course, we can tweak the default configuration for each of these tools to make them match our stylistic preferences if we desire.The text was updated successfully, but these errors were encountered: