-
Notifications
You must be signed in to change notification settings - Fork 219
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
Style Guide and Style Checker #2241
Comments
Seconded. |
It should be possible to just copy the setup in DynamicPPL (which IIRC is slightly more recent and e.g. handles merge queues as well). |
We indeed should. It's been put off because it will be quite annoying for the open PRs |
So once we've closed the major ones that are currently opened, I'm very pro adding the same setup as in DPPL |
Sounds entirely reasonable. Which are the major open PRs? Would be helpful to have specifics on this I think. |
I support this and am happy to take on implementing this. We could also add this immediately with an ignore list covering all files currently under major work. Those files could then be brought into the formatting fold as PRs are merged. This way we don't need any one moment when all big PRs would be merged. |
JuliaFormatter is now running in #2255. I'm also exploring other tools. Some questions:
|
I really like using JET. I've incorporated it into my standard unit testing in Tapir.jl -- see here. It's definitely better than just using
Not used it, but planning to start soon -- it's really nice that it hunts down obvious method ambiguities.
I've not used them before, but I definitely like this idea. I can definitely see myself using one which checks for formatting! |
All of these are good improvements. I am not sure about |
Fixed by #2255 -- feel free to open new issues / PRs for JET and Aqua. |
Have only played around with it like a year ago with limited success, but given @willtebbutt 's experience it might be interesting to consider.
This def seems like something we want:) Seems to strictly be an improvement without any downside 👍
Against this because we have format checks on PRs. This lets you play around however you want when just working on a branch, but as soon as you want to make a PR, you'll need satisfy the formatting constraints. In particular for Julia, having to run formatting on every commit (which requires starting a separate script per commit, which has a delay that is much greater than in, say, python), unless you do something fancy with a server, can be annoying. Plus, in most cases, it's easy enough to set up "format on save" (e.g. in VS code or emacs). Aaaand we have automatic code suggestions from Julia formatter on PRs, so you don't even need to run the formatting locally 🤷 |
I use Aqua (basically in most packages nowadays) and JET (in a handful of packages but it has been very helpful and I like it), so I think adding Aqua tests and gradually adding JET tests in cases where it is helpful is a good idea. I also tend to think that a pre-commit hook for formatting might be inconvenient and the Github check should be sufficient (since everything goes through a PR). |
In various other repos we make use of JuliaFormatter.jl + an action to enforce a standardised style guide for each PR. See e.g. KernelFunctions.jl.
Currently this repo doesn't seem to have this, but maybe we should?
The text was updated successfully, but these errors were encountered: