-
Notifications
You must be signed in to change notification settings - Fork 6
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
add .pre-commit-config.yaml #2026
Conversation
Why did you remove it from the global .toml, wouldn't it be better to have it there? If black and isort from pre-commit don't recognize it (they should) you can explictly say That way one can use black on isort with your ide and make sure that it is using the same options. (I guess we want to also check -but not autocommit the fixes- as part of the checks) |
Because pre-commit cannot use the pyproject.toml file pre-commit/pre-commit#1165
I thought there was no such option for isort and didn't really see the benefit. But I guess if you want to run it from the ide that's indeed not possible this way. I was wrong though, and isort does have an option
I'm not so sure, there may be cases in which we don't want to do exactly what black or isort wants. Or maybe not. Either way, let's see, if people adopt pre-commit problems about forgetting to run black should become rare. |
I don't know about pre-commit, but the tools you run inside certainly can (this is used in pineko or pinefarm) |
Not for black and isort |
Not sure what the problem is, but at least black doesn't seem to recognise the settings from pyproject.toml. I also still need to update the mentions of black and isort in the docs, but for now I've wrestled enough with this. |
aec9ddf
to
8fde036
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Since you are at it, it might be a good idea to remove the link to the old vp guide from https://github.com/NNPDF/nnpdf/tree/master/doc#currently-documented
(I think we already moved part of the stuff to the standard docs)
c5fe6a7
to
feeeabd
Compare
I did not keep
known_first_party
. I tested it onmodel_trainer.py
and it put thenumpy
import inside then3fit
imports while separatingfrom n3fit import model_gen
(not sure what's going on there). I also realised that we missed e.g.ekobox
.isort
seems to recognise thatnnpdf_data
,validphys
andn3fit
are part of this repo so I think that's good enough (let's keep an eye on it though).I'm not if favour of a CI test