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 an issue causing wp-scripts commands to fail if the file path contained a space character #61748

Merged
merged 4 commits into from
May 22, 2024

Conversation

kellenmace
Copy link
Contributor

What?

Bump the lint-staged npm package to the next patch version to fix an issue where wp-scripts commands would fail if the file path contained a space.

Fixes #42588

Why?

Before this fix, some wp-scripts commands would fail if the file path to the Gutenberg plugin contained one or more space characters. This issue was fixed in lint-staged v10.0.2. By bumping Gutenberg to that version, that issue is resolved.

How?

The lint-staged npm package has been bumped from version 10.0.1 to 10.0.2.

Testing Instructions

Steps to reproduce the issue

  1. Clone the gutenberg plugin into a directory with a space character in its name.
  2. Ensure that the trunk branch is checked out.
  3. Note that lint-staged version 10.0.1 is installed.
  4. Run npm install.
  5. Run touch test-file.js && git add test-file.js to create and stage a new file via git.
  6. Run git commit -m “Add test file” to try to commit the change.
  7. Confirm that the Husky pre-commit hooks fail with errors similar to those shown below.
✖ wp-scripts format found some errors. Please fix them and try committing again.

[error] No files matching the pattern were found: "/Users/kellen.mace/Local".
[error] No files matching the pattern were found: "Sites/wp-contributions/app/public/wp-content/plugins/gutenberg/test-file.js".

✖ wp-scripts lint-js found some errors. Please fix them and try committing again.

Oops! Something went wrong! :(

Steps to test the bug fix

  1. Check out the branch associated with my PR on your local machine inside of a directory with a space in its name.
  2. Run npm install.
  3. Note that lint-staged version 10.0.2 is installed.
  4. Run touch test-file.js && git add test-file.js to create and stage a new file via git.
  5. Run git commit -m “Add test file” to try to commit the change.
  6. Confirm that the Husky pre-commit hooks pass and that you are able to commit the new file.

Testing Instructions for Keyboard

n/a

Copy link

github-actions bot commented May 16, 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: kellenmace <kellenmace@git.wordpress.org>
Co-authored-by: colorful-tones <colorful-tones@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: ndiego <ndiego@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>

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

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label May 16, 2024
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @kellenmace! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@colorful-tones
Copy link
Member

I'm quite certain that this issue surfaced on our internal contributor day yesterday. When a few contributors attempted to generate and lint doc contributions for #60358, we kept getting odd ESLint reports that did not align with what we were seeing, or ESLint would just return nothing, which is assumed 'success', but there were still issues.

@Mamaduka Mamaduka added the [Type] Build Tooling Issues or PRs related to build tooling label May 18, 2024
Copy link
Member

@gziolo gziolo 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 for the fix. It would be perfectly fine to update to the more recent 10.x version or even 11.x, but it can be done separately.

@gziolo gziolo merged commit f937edd into WordPress:trunk May 22, 2024
63 of 66 checks passed
@github-actions github-actions bot added this to the Gutenberg 18.5 milestone May 22, 2024
@carolinan
Copy link
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ESLint does not accept spaces in the path?
5 participants