-
Notifications
You must be signed in to change notification settings - Fork 6
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
Glob style pathspecs are not handled correctly, and no warning is given #7
Comments
j13k
added a commit
that referenced
this issue
Mar 27, 2018
j13k
added a commit
that referenced
this issue
Mar 27, 2018
* Added usage text to clarify issue raised in #7. * Adjustments to address: - https://github.com/DavidAnson/markdownlint/blob/v0.8.1/doc/Rules.md#md013 - https://github.com/DavidAnson/markdownlint/blob/v0.8.1/doc/Rules.md#md014
j13k
added a commit
that referenced
this issue
Mar 27, 2018
j13k
added a commit
that referenced
this issue
Mar 27, 2018
* Added usage text to clarify issue raised in #7. * Adjustments to address: - https://github.com/DavidAnson/markdownlint/blob/v0.8.1/doc/Rules.md#md013 - https://github.com/DavidAnson/markdownlint/blob/v0.8.1/doc/Rules.md#md014
j13k
added a commit
that referenced
this issue
Mar 27, 2018
j13k
added a commit
that referenced
this issue
Mar 27, 2018
* Added usage text to clarify issue raised in #7. * Adjustments to address: - https://github.com/DavidAnson/markdownlint/blob/v0.8.1/doc/Rules.md#md013 - https://github.com/DavidAnson/markdownlint/blob/v0.8.1/doc/Rules.md#md014
Fixed in f677709. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
As reported in feature request #3 and lmc-eu/php-coding-standard#8, there is an issue with glob style path specs (e.g.
*.yml
) not being handled correctly—only the last file in the set of filenames is parsed, but this is not clear in the output. This is confusing for users and could result in false reports.Proposed Fix
Until the tool is upgraded to handle multiple files, it should be patched to reject glob style path specs and warn the user. The documentation should also clarify this.
Analysis
It seems
$_SERVER['argv']
expands globs automatically, behaviour which was unexpected on my part. The script loops over the values ofargv
, assigning path values to a scalarargPath
variable, which is then parsed. When multiple paths are specified (as in case of the expanded glob file set), the value ofargPath
ultimately rests on the last filename in the list.This scratch script illustrates the issue using the Symfony Yaml component test fixture files as an example:
The script output demonstrates the implicit glob expansion:
In the case of this path spec, only the last file,
vendor/symfony/yaml/Tests/Fixtures/unindentedCollections.yml
, is processed.The text was updated successfully, but these errors were encountered: