GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docs: fix documentation concerning glob expansion on UNIX by binki · Pull Request #4869 · mochajs/mocha

Conversation

@binki

@binki binki commented Apr 11, 2022

Copy link
Copy Markdown
Contributor

Fixes #4868.

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions.

Description of the Change

Fix documentation about how shell expansion works on UNIX.

Alternate Designs

I removed incorrect information and added the equivalent correct information. I may have been more verbose than necessary, but it seemed like the documentation was trying to be informative here, so I continued providing the supplemental information.

Why should this be in core?

This is a documentation fix. It removes erroneous information in core which should not be there.

Benefits

The documentation will be less wrong.

Possible Drawbacks

This may result in people being less confused.

Applicable issues

#4868

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@binki
Fix documentation concerning glob expansion on UNIX.
ead1635
Fixes mochajs#4868.
juergba
juergba reviewed Apr 15, 2022
View reviewed changes

@juergba juergba left a comment

Copy link
Copy Markdown
Contributor

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 agree the docs is incorrect, but I'm not happy with your text either. I'm unsure about your Windows statement since we have countless shells in Windows as eg. git bash, powershell, wsl, cmd, etc. Especially powershell is a pain being so different compared to posix-like shells.
So what the docs should tell (in your own words):

  • use quotes to prevent glob expansion by the shell, single/double quotes depending on shell
  • it has to be Mocha (via its dependency node-glob) which does the glob expansion
  • we recommend double quotes for portability.

Every additional info may be confusing or incorrect, I prefer to not document on shell detail level.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@juergba juergba added the area: documentation anything involving docs or mochajs.org label Apr 15, 2022
@binki

binki commented Apr 15, 2022

Copy link
Copy Markdown
Contributor Author

we have countless shells in Windows as eg. git bash, powershell, wsl, cmd, etc.

If you shellout in Windows, which is what npm run does, you get CMD. I do not think that will change in the foreseeable future. People who use different shells on Windows are either power users and know what they are doing or are being told to do so by other people who they can ask for help.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

akashchouhan16
akashchouhan16 approved these changes May 17, 2023
View reviewed changes
JoshuaKGoldberg
JoshuaKGoldberg approved these changes Mar 4, 2024
View reviewed changes

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Copy link
Copy Markdown
Member

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.

LGTM, thanks! 🙌

Just one suggestion around a friendlier docs link. What do you think?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread docs/index.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread docs/index.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author waiting on response from OP or other posters - more information needed label Mar 4, 2024
@JoshuaKGoldberg JoshuaKGoldberg changed the title Fix documentation concerning glob expansion on UNIX. docs: fix documentation concerning glob expansion on UNIX. Mar 4, 2024
@JoshuaKGoldberg JoshuaKGoldberg changed the title docs: fix documentation concerning glob expansion on UNIX. docs: fix documentation concerning glob expansion on UNIX Mar 4, 2024
@binki @JoshuaKGoldberg
Increase concision.
d5c86e2
Co-authored-by: Josh Goldberg ✨ <[email protected]>
@linux-foundation-easycla

linux-foundation-easycla Bot commented Mar 5, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: binki / name: Nathan Phillip Brink (ead1635, 7129fbf, ab6bed3, d5c86e2)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

voxpelli
voxpelli suggested changes Mar 12, 2024
View reviewed changes

@voxpelli voxpelli left a comment

Copy link
Copy Markdown
Contributor

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 would simplify it to:

[You should _always_ quote your globs in npm scripts][article-globbing], the [`node-glob`][npm-glob] module will handle its expansion.

Lets keep additional specifics of shells and os:es out of it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JoshuaKGoldberg reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@binki
Remove reference to misleading article and any platforms
ab6bed3
mochajs#4869 (review) requested that platforms and shells not be mentioned. This means that rationale for the directions cannot be provided.

The article which was originally linked suggests to use single quotes which do not work on Windows. For example, using single quotes for a glob expression referring to a folder or file with `&` in its name would break the expression into two commands on Windows.

Since the rationale was removed and the linked article was misleading, instructions on how to correctly quote globs were added. The rationale is recorded here since it isn’t allowed in the instructions:

* Since a Unix-like OS user would be accustomed to referencing a path containing `"` in it by writing `\"` within a double-quoted string, I mentioned that the double quote and backslash characters are forbidden.
* Since a Windows user would be accustomed to including `$` in file names but double quoted strings have parameter expansion performed on them on on Unix-like OSes, I had to mention that `$` is a forbidden character.
* Since Windows doesn’t support single quotes, I had to mention that double quotes are required.
@binki

binki commented Mar 12, 2024

Copy link
Copy Markdown
Contributor Author

I would simplify it to:

[You should _always_ quote your globs in npm scripts][article-globbing], the [`node-glob`][npm-glob] module will handle its expansion.

Lets keep additional specifics of shells and os:es out of it.

I addressed your changes in the latest commit.

I checked out the article you are referring to and found that it is misleading. It suggests to use single quotes which are unsupported on Windows. If a folder name contains an ampersand (legal on Windows and Unix-like OSes), then the script author might create an expression which succeeds on a Unix-like OS and fails on Windows. So I removed that reference too.

Since the rationale cannot be included, I needed to add instructions to:

  • use double quotes
  • avoid obvious problem-causing characters within the double quotes

Please consider the latest changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

voxpelli
voxpelli reviewed Mar 12, 2024
View reviewed changes

@voxpelli voxpelli left a comment

Copy link
Copy Markdown
Contributor

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.

Better! Thanks 🙏 And thanks for removing the erroneous article.

How would you feel about this minor wording tweak?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread docs/index.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@binki @voxpelli
Accept wording change
7129fbf
Co-authored-by: Pelle Wessman <[email protected]>
voxpelli
voxpelli approved these changes Mar 12, 2024
View reviewed changes
@voxpelli
voxpelli merged commit a5b5652 into mochajs:master Mar 12, 2024
@voxpelli

voxpelli commented Mar 12, 2024

Copy link
Copy Markdown
Contributor

Thanks @binki 🙏

binki reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@M0ng00se7169 M0ng00se7169 mentioned this pull request May 21, 2024
[Snyk] Upgrade mocha from 10.3.0 to 10.4.0 M0ng00se7169/Kickstart#83
Merged
@matrix-compute matrix-compute mentioned this pull request Jun 24, 2024
[Snyk] Upgrade mocha from 10.2.0 to 10.4.0 matrix-compute/tracker-blocklists#2
Open
@Grizzelbee Grizzelbee mentioned this pull request Jul 16, 2024
[Snyk] Upgrade mocha from 10.4.0 to 10.5.0 Grizzelbee/ioBroker.dysonairpurifier#310
Closed
@hoang3402 hoang3402 mentioned this pull request Jul 16, 2024
[Snyk] Upgrade mocha from 10.4.0 to 10.5.1 hoang3402/CodeWars#35
Closed
@tylerezimmerman tylerezimmerman mentioned this pull request Jul 16, 2024
[Snyk] Upgrade mocha from 10.4.0 to 10.5.1 DelineaXPM/SS-ADO-BuildTask#71
Merged
@tdbaine tdbaine mentioned this pull request Jul 16, 2024
[Snyk] Upgrade mocha from 10.4.0 to 10.5.1 adamw1221/CS495-Lab-Inventory-Group-F#13
Open
@M0ng00se7169 M0ng00se7169 mentioned this pull request Jul 16, 2024
[Snyk] Upgrade mocha from 10.4.0 to 10.5.1 M0ng00se7169/Kickstart#88
Open
@MaxMood96 MaxMood96 mentioned this pull request Jul 17, 2024
[Snyk] Upgrade mocha from 10.2.0 to 10.5.1 MaxMood96/node-oracledb#99
Closed
@Grizzelbee Grizzelbee mentioned this pull request Jul 18, 2024
[Snyk] Upgrade mocha from 10.1.0 to 10.5.2 Grizzelbee/ioBroker.resol#152
Closed
@SpinningRecords SpinningRecords mentioned this pull request Jul 20, 2024
[Snyk] Upgrade mocha from 10.2.0 to 10.5.2 SpinningRecords/uBlock#5
Open
@saileshvyas saileshvyas mentioned this pull request Jul 27, 2024
[Snyk] Upgrade mocha from 10.2.0 to 10.6.0 saileshvyas/Microsoft-Defender-for-Cloud#5
Open
This was referenced Jul 28, 2024
[Snyk] Upgrade mocha from 10.2.0 to 10.6.0 hashim21223445/chai#3
Closed
[Snyk] Upgrade mocha from 10.4.0 to 10.6.0 hashim21223445/chai-as-promised#1
Merged
[Snyk] Upgrade mocha from 10.3.0 to 10.6.0 hashim21223445/axios#2
Merged
This was referenced Aug 7, 2024
[Snyk] Upgrade mocha from 10.2.0 to 10.6.0 hashim21223445/broadcast-channel#7
Merged
[Snyk] Upgrade mocha from 10.3.0 to 10.7.0 hashim21223445/axios#10
Merged
[Snyk] Upgrade mocha from 10.4.0 to 10.7.0 hashim21223445/chai-as-promised#5
Merged
@MaxMood96 MaxMood96 mentioned this pull request Aug 25, 2024
[Snyk] Upgrade mocha from 10.2.0 to 10.7.0 MaxMood96/node-oracledb#102
Closed
@SapiannykSerhii SapiannykSerhii mentioned this pull request Sep 25, 2024
[Snyk] Upgrade mocha from 10.0.0 to 10.7.3 SapiannykSerhii/-NeWFestivaleWave-express_API_app#128
Open
@MaxMood96 MaxMood96 mentioned this pull request Oct 6, 2024
[Snyk] Upgrade mocha from 10.2.0 to 10.7.3 MaxMood96/node-oracledb#103
Closed
This was referenced Oct 23, 2024
[Snyk] Upgrade mocha from 9.2.2 to 10.7.3 nerdy-tech-com-gitub/preact#11
Open
[Snyk] Upgrade mocha from 9.2.2 to 10.7.3 nerdy-tech-com-gitub/node#8
Open
@HaLaGu1L HaLaGu1L mentioned this pull request Nov 1, 2024
[Snyk] Upgrade mocha from 10.1.0 to 10.7.3 HaLaGu1L/wallet-core#7
Open
@SkyeFull90 SkyeFull90 mentioned this pull request Nov 9, 2024
[Snyk] Upgrade mocha from 10.3.0 to 10.7.3 SkyeFull90/100devs-projects-skye#8
Merged
lennonnikolas pushed a commit to lennonnikolas/mocha that referenced this pull request Jan 24, 2026
@binki
docs: fix documentation concerning glob expansion on UNIX (mochajs#4869)
2b3bca3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JoshuaKGoldberg JoshuaKGoldberg JoshuaKGoldberg approved these changes
+3 more reviewers
@juergba juergba juergba left review comments
@voxpelli voxpelli voxpelli approved these changes
@akashchouhan16 akashchouhan16 akashchouhan16 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

area: documentation anything involving docs or mochajs.org status: waiting for author waiting on response from OP or other posters - more information needed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

📝 Docs: Incorrectly states the shell does glob expansion for double-quoted path specifications

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@binki @voxpelli @JoshuaKGoldberg @juergba @akashchouhan16
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.