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

Fix lint-staged config for plugins #1264

Merged
merged 5 commits into from
May 31, 2024
Merged

Fix lint-staged config for plugins #1264

merged 5 commits into from
May 31, 2024

Conversation

thelovekesh
Copy link
Member

Summary

See #1089

Relevant technical choices

  • Move lint-staged config from package.json to lint-staged.config.js.
  • Add dynamic config based on staged files.
Copy link

github-actions bot commented May 31, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: thelovekesh <thelovekesh@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@thelovekesh thelovekesh added [Type] Enhancement A suggestion for improvement of an existing feature no milestone PRs that do not have a defined milestone for release skip changelog PRs that should not be mentioned in changelogs labels May 31, 2024
Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

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

Thank you!

@westonruter westonruter removed the no milestone PRs that do not have a defined milestone for release label May 31, 2024
@westonruter
Copy link
Member

The milestone check seems to be stuck, as I did add a milestone. I'll merge anyway.

I don't think we should use the no-milestone label anymore. We should always assign a milestone so issues/PRs get tracked for releases, but we can just add the skip-changelog label to avoid it being added to the changelog.

@westonruter westonruter merged commit f8a6f51 into trunk May 31, 2024
22 of 26 checks passed
@westonruter westonruter deleted the fix/lint-staged branch May 31, 2024 19:37
Comment on lines +33 to +43
const pluginFiles = micromatch(
files,
`**/${ PLUGIN_BASE_NAME }/plugins/${ plugin }/**`,
{ dot: true }
);

if ( pluginFiles.length ) {
commands.push(
`composer lint:${ plugin } ${ joinFiles( pluginFiles ) }`
);
}
Copy link
Member

Choose a reason for hiding this comment

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

I just realized that this should technically also include **/${ PLUGIN_BASE_NAME }/tests/plugins/${ plugin }/* at least until #1262 is merged (although hopefully that will be done momentarily and this won't be needed).


const otherFiles = micromatch(
files,
`!**/${ PLUGIN_BASE_NAME }/plugins/**`,
Copy link
Member

Choose a reason for hiding this comment

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

Ditto, if the above is done, then this would also omit !**/${ PLUGIN_BASE_NAME }/tests/plugins/**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changelog PRs that should not be mentioned in changelogs [Type] Enhancement A suggestion for improvement of an existing feature
2 participants