py3gpp
py3gpp copied to clipboard
pre-commit flow for CI and standalone run
More contributors are here and I bring pre-commit formatter to CI to keep code in the same style. I think this might be useful for such a project. But we need to format WHOLE THE CODE.
So, I decided to leave this responsibility to @catkira as an owner and main contributor :) From my point it's better to include formatting as early as possible, otherwise it will be more and more painful.
I see several steps:
- Format the whole code with
pre-commit run -a
1.1 There are severalexclude
folders, and they won't affected - Push this massive change to repos
- Check if
pre-commit
CI hooks works fine
I checked all of them, but we need to check hat everything is smooth in the main repo (here).
PS. The exact rules is point for discussion or modification. I've bring more or less default styles partially from cocotb
CI flow.
yes, that's a good idea.
@vborchsh where is the screen width and indent configured?
@vborchsh where is the screen width and indent configured?
I've added line length=120 for example.
About indents - I'm not sure, flack8/black formatters are uncompromising here... But for me it's completely fine. Less settings - less pain.
The problem with this PR is that the contributions will not be shown correctly anymore on Github. One would have to make a separate script that calculates contributions by not taking into account this commit. I would wait with this commit until this script is added, because I don't want to take away the visibility of contributions from other people.
But we can already add a commit hook that is active for new changes only - if that is possible.
The problem with this PR is that the contributions will not be shown correctly anymore on Github. ...
The commits statistic will be fine. The only issue is addition/deletions statistic right? And the later you do the worse it will :) Btw github has no option to exclude commits from contributors statistic, so I see no outs. Anyway, its up to you. Let's wait for possible workaround or fixes of this issue.
The problem with this PR is that the contributions will not be shown correctly anymore on Github. ...
The commits statistic will be fine. The only issue is addition/deletions statistic right? And the later you do the worse it will :) Btw github has no option to exclude commits from contributors statistic, so I see no outs. Anyway, its up to you. Let's wait for possible workaround or fixes of this issue.
Yes Github cannot do it, other projects therefore of a separate file that how much each user contributed, for example this https://github.com/analogdevicesinc/libiio/blob/main/Contributors.md
Also, you can expand this file: https://github.com/vborchsh/py3gpp/blob/master/pyproject.toml (authors) in automatic way