Skip to content

Fix lint-staged config for plugins#1264

Merged
westonruter merged 5 commits intotrunkfrom
fix/lint-staged
May 31, 2024
Merged

Fix lint-staged config for plugins#1264
westonruter merged 5 commits intotrunkfrom
fix/lint-staged

Conversation

@thelovekesh
Copy link
Copy Markdown
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.

@github-actions
Copy link
Copy Markdown

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 requested a review from westonruter May 31, 2024 19:02
@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
Copy Markdown
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
Copy Markdown
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
@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
Copy Markdown
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
Copy Markdown
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants