-
Notifications
You must be signed in to change notification settings - Fork 378
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
Prettier formatter #2018
Prettier formatter #2018
Conversation
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.
Vast majority of these changes look good to me. I left comments on the remaining ones that concern me. We'll also need to mention prettier in docs/user/contributing.rst
and add CI in .github/workflows/style.yaml
, but I can do those if you don't feel comfortable. I wish prettier supported rst and ipynb, but it already supports a lot more formats than I expected, so I'm happy to see that.
tests/data/agb_live_woody_density/Aboveground_Live_Woody_Biomass_Density.geojson
Outdated
Show resolved
Hide resolved
In |
And also how to use prettier yourself. Basically, add it to the "Linters" section and follow a similar structure as ruff/mypy. |
We should also add a pre-commit hook: https://prettier.io/docs/en/precommit#option-2-pre-commithttpsgithubcompre-commitpre-commit |
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
… into prettier-formater
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.
All formatted files look good now, just need to fix a few problems in CI.
That's strange, when I was testing this on my fork I got Run npx prettier . --check
Checking formatting...
All matched files use Prettier code style! and here again it can't find it and need to install it. |
What if you run it as |
Unfortunately it have to be run through We might try to use |
I guess in order of priorities, I have:
We could change the working-directory for every step of the pipeline so that installation and running happen in requirements and we pass it |
I have used and tested - name: Installing prettier
run: |
npm install requirements/
npm cache clean --force
- name: List npm dependencies
run: npm ls --all
- name: Run prettier formatting
run: npx prettier . --check Wanted to ask also are you sure you don't want to put |
|
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.
Everything looks good to me now!
Thanks for all of your hard work on this. I have exactly 0 years of experience with node/npm, so I'm glad I have the chance to learn a new tool.
I'll merge this and make it a required test in CI. We may play around with the settings in the future, but for now they all seem like good defaults.
My pleasure, I'm happy that I could contribute to this project and too me it was also a very good experience, I have learn new tools that for sure might come in handy in the future. |
Closes #2004