-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement github actions #25
Conversation
@jnnr and @juliusmeier you can lint your code with Black (run You can install the extra requirements with dev option via @jnnr this PR should be merged soon to prevent merge conflicts due to the code linting. |
How do you do it? Do you have black added to your pre-commit hook? update: Did so and am happy with it. |
Shall we use flake8 as well? I am for it. To prevent conflicts with black, some rules should be ignored. I found information [here] (https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/) and in this recent oemof-solph PR oemof/oemof-solph#746. |
nice 👍 could you post here, how you did that? If you've followed instructions from your above posted link I understand that this can be added to the repo, so that it is a setting for all of us..?!
Ah yes, I can add this. |
I added a file named pre-commit (no extension) to my local git repo's .git/hooks. The file contains update: Added the --diff flag to prevent black from actually converting the files. Before commit, I just want a check. Otherwise, black changes the files, but these changes are not part of the commit. Maybe there is a more clever way to automatically add it and then commit?
Maybe the order matters? Then, I made the file executable by chmod +x Now, each time when I commit, the linters run first and stop the commit if there is mistake. |
Nice thank you! I guess you could even push that to the repo, so that we can use it, as well. Now you can use |
Fix #6
Changes proposed in this PR:
test_requirements.txt
and addextras_require
tosetup.py
The checks are done for python 3.7 and 3.8 currently, this can be adapted of course.