-
Notifications
You must be signed in to change notification settings - Fork 38
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 #40
Add pre-commit #40
Conversation
run: npm install -g prettier | ||
|
||
- name: Run Prettier --check | ||
run: prettier --check ${GITHUB_WORKSPACE} |
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.
If possible it would be nice to keep Prettier in place, for linting the markdown + YAML files.. (maybe you're already on the case for this..)
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.
Ahhh yeah I was wondering why this was here.
My mistake, adding it back :)
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.
I'll see if I can embed it into pre-commit ;)
Added it back as a pre-commit hook. This will help developers detect these mistakes earlier :)
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.
No worries! Should be possible I think: https://prettier.io/docs/en/precommit.html#option-3-pre-commithttpsgithubcompre-commitpre-commit
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.
Done ✌️ Let me know what you think :)
b56f9ca
to
f4a14e4
Compare
d63247f
to
c182e74
Compare
@ewels I have done all the required refactoring.
Sorry that I didn't have more time this week to complete this earlier but I'll be off from today onwards for a week (⛷️). |
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.
Quickly read over the code and I think it looks great! Love how simple the GA workflow is now.
Couple of comments and would like to test the code locally before merging, but I don't see any issues so should be able to merge today 👍🏻
Kind of curious to see how well this will play with my VSCode plugins.. 😅
examples/01_simple.py
Outdated
r""" | ||
Pretend to download some files from somewhere. | ||
|
||
Multi-line help strings are unwrapped until you use a double newline. |
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.
Intention of this example is to not have a double newline.
r""" | |
Pretend to download some files from somewhere. | |
Multi-line help strings are unwrapped until you use a double newline. | |
""" | |
Pretend to download some files from somewhere. | |
Multi-line help strings are unwrapped until you use a double newline. |
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.
Changed this back with noqas
examples/04_rich_markup.py
Outdated
@@ -8,7 +8,7 @@ | |||
@click.option( | |||
"--input", | |||
type=click.Path(), | |||
help="Input [magenta bold]file[/]. [dim]\[default: a custom default][/]", | |||
help=r"Input [magenta bold]file[/]. [dim]\[default: a custom default][/]", |
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.
Do we really need these r
prefixes?
help=r"Input [magenta bold]file[/]. [dim]\[default: a custom default][/]", | |
help="Input [magenta bold]file[/]. [dim]\[default: a custom default][/]", |
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.
Yess flake8 was complaining about the \
.. Let me just add a noqa.
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.
ah ok, I wondered if there was a reason. The r
prefix is also fine, I guess it doesn't make any difference here..
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.
According to flake8, \[
is an invalid escape.
@@ -0,0 +1,58 @@ | |||
minimum_pre_commit_version: "2.9.2" |
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.
Maybe a few comment lines at the top explaining what this file is and what it's used for, for n00bs like me?
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.
Good idea.
3c5f729
to
89f944b
Compare
Thanks for all the good comments @ewels ✌️. |
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.
Nice changes! Couple of minor docs suggestions..
Added links Co-authored-by: Phil Ewels <phil.ewels@scilifelab.se>
Add extra information Co-authored-by: Phil Ewels <phil.ewels@scilifelab.se>
Co-authored-by: Phil Ewels <phil.ewels@scilifelab.se>
Oops, sorry about the ❌ It's amazingly difficult to write valid markdown in the GitHub PR plain text editor 😆 Note that for next time you can batch suggestions together if you want instead of doing one commit per comment. This option is only available on the Files changed PR tab though, not Overview. |
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.
Great stuff, thank you! 👏🏻
Hmm, getting this error in the actions CI:
Any ideas? The tests seem fairly inconsistent for me too..
|
Hey @ewels, Sorry to hear that! Regarding the errors that are showing up, running |
Ah thanks for the tips! I'll take a look after the weekend. Thanks for the quick reply, enjoy your holiday! Phil |
Thanks! Have a good weekend 🤟 |
Underscores typo now fixed 👍🏻 |
Added the following tools to pre-commit:
Furthermore, modified the README.md to contain new instructions.
Two more things are left to do: