Skip to content
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 prerequisite pre-commit #1426

Closed
wants to merge 1 commit into from

Conversation

acsr
Copy link

@acsr acsr commented Feb 12, 2025

make install without already installed command pre-commit results in an error:

...
# Install pre commit hook
npx yarn husky install
Usage Error: Couldn't find a script named "husky".

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...
make: *** [install] Error 1

Most developers may already have pre-commit in their path. This PR add s a prequistes section an enhances the existing simple pointer to node.js.

Boilerplate taken from (as suggested by @stevepiercy):
https://6.docs.plone.org/_sources/plone.api/contribute.md

@mister-roboto
Copy link

Armin Stross-Radschinski the email address in your commit does not match an email in your GitHub account. Thus it is impossible to determine whether you have signed the Plone Contributor Agreement, which is required to merge this pull request.

Learn about the Plone Contributor Agreement: https://plone.org/foundation/contributors-agreement

If you have sent in your Plone Contributor Agreement, and received and accepted an invitation to join the Plone GitHub organization, then you might need to either add the email address on your Agreement to your GitHub account or change the email address in your commits. If you need to do the latter, then you should squash the commits with your matching email and push them.

Add more emails to your GitHub account:
https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/adding-an-email-address-to-your-github-account

Change the email address in your commits:
https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address

Prepare your system by installing prerequisites.

### pre-commit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a big fan of not copy-pasting docs, and instead referring to an authoritative source that is actively maintained. This reduces maintenance burden, but you would have to trust that the authoritative source will be around. In this case, I don't see plone.api going away anytime soon. See subsequent comment for an example of what I mean.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per discussion in Discord, pre-commit is not necessary after all, but I still like a Prerequisites section for the rest of the stuff.

Sorry for the noise. At least you have it installed on your system for when other Plone projects require it, which is quite a few due to plone/meta.

```shell
pre-commit install
```
### Node.js

- Have a current version of Node.js installed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Have a current version of Node.js installed.
Have a current version of Node.js installed.
See [Plone 6 Documentation](https://6.docs.plone.org/install/create-project-cookieplone.html#nvm) for installing nvm to manage versions of Node.js.

```shell
pre-commit install
```
### Node.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some breathing room to see it's a new section.

Suggested change
### Node.js
### Node.js


- Have a current version of Node.js installed.

## Install

- To install, run: `make install`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that this is a section instead of a wall of text, I don't think bullet points are necessary. Your call.

Suggested change
- To install, run: `make install`.
To install, run: `make install`.

...and repeat down the file.

@acsr
Copy link
Author

acsr commented Feb 12, 2025

Armin Stross-Radschinski the email address in your commit does not match an email in your GitHub account. Thus it is impossible to determine whether you have signed the Plone Contributor Agreement, which is required to merge this pull request.
...
Add more emails to your GitHub account: https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/adding-an-email-address-to-your-github-account

I checked it an the address in the git log:

Author: Armin Stross-Radschinski <[email protected]>
Date:   Wed Feb 12 11:24:21 2025 +0100

    add prerequisite pre-commit

and it is my primary github mail address.
Maybe in the Plone Organisation this not properly matching with the entry for the contributor agreement. But i access Plone.org with my github account and running Pull requests dirctly from github works fine.

Prepare your system by installing prerequisites.

### pre-commit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per discussion in Discord, pre-commit is not necessary after all, but I still like a Prerequisites section for the rest of the stuff.

Sorry for the noise. At least you have it installed on your system for when other Plone projects require it, which is quite a few due to plone/meta.

@stevepiercy
Copy link
Contributor

and it is my primary github mail address. Maybe in the Plone Organisation this not properly matching with the entry for the contributor agreement. But i access Plone.org with my github account and running Pull requests dirctly from github works fine.

AFAIK, mr-roboto only checks GitHub usernames for being a member of a Plone Team on GitHub. You're a member of the Plone Developers Team. See relevant code:

https://github.com/plone/mr.roboto/blob/ae201dc3092258a73039ff94ab96b00296eb060a/src/mr.roboto/src/mr/roboto/subscriber.py#L192-L197

Maybe this was a false report? You can try to push another commit and see if it was a temporary glitch.

Do you have another commit in another Plone repo against which we can compare? Documentation does not use mr-roboto, but almost every other Plone repo should be a good sample.

@acsr
Copy link
Author

acsr commented Feb 12, 2025

Do you have another commit in another Plone repo against which we can compare? Documentation does not use mr-roboto, but almost every other Plone repo should be a good sample.

I mostly contribute to docs. No idea when I lastly committed a PR to a Plone Core Repo if ever (if ever, it was maybe before the great namespace changes) and of course the collective (when Plone Help Center was alive)

@acsr
Copy link
Author

acsr commented Feb 12, 2025

see #1427 for the ongoing error followup trying to work around the install issue.

@stevepiercy
Copy link
Contributor

stevepiercy commented Feb 12, 2025

The collective organization does not require the Plone Contributor Agreement for contributions, and therefore does not use mr-roboto.

Author: Armin Stross-Radschinski <[email protected]>
Date:   Wed Feb 12 11:24:21 2025 +0100

    add prerequisite pre-commit

and it is my primary github mail address.

On your GitHub profile, you have a different email address of [email protected]. Looks like you transposed the parts in your username around the ..

@petschki
Copy link
Member

husky got removed from @patternslib/dev ... closing this in favor of #1428

@petschki petschki closed this Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants