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

config-repos: Error when running generate command with local path as source #4

Closed
jrfnl opened this issue Mar 17, 2021 · 1 comment · Fixed by #5
Closed

config-repos: Error when running generate command with local path as source #4

jrfnl opened this issue Mar 17, 2021 · 1 comment · Fixed by #5

Comments

@jrfnl
Copy link
Member

jrfnl commented Mar 17, 2021

After #3, I edited the generator.xml.dist file to contain the following:

<?xml version="1.0" encoding="UTF-8"?>
<generator format="markdown">
    <source path="D:\000_GitHub\PHPCS\PHPCompatibility\PHPCompatibility">
        <standard path="PHPCompatibility" />
    </source>
</generator>

Using the config-repos branch, I then tried to run the following command again from the root of this repository:

$ php ./bin/phpcsdocs generate

And got the following error response:

Searching for sniffs in D:\000_GitHub\PHPCS\PHPCompatibility\PHPCompatibility/PHPCompatibility/...

In NotASniffPath.php line 18:

  The file path provided does not follow the convention for a sniff class.
  Must contain {Standard}/Sniffs/{Category}/{SniffName}Sniff.php
  Received: D:\000_GitHub\PHPCS\PHPCompatibility\PHPCompatibility/PHPCompatibility/Sniffs/Classes\ForbiddenExtendingFinalClassSniff.php


generate [<sniff>]

I suspect this may be due to the multiple PHPCompatibility directories in the path ?

@jrfnl
Copy link
Member Author

jrfnl commented Mar 17, 2021

On second look, it doesn't appear to have anything to do with the multiple PHPCompatibility directories, rather with the mixed Windows/Unix slashes in the path.

Looks like some slash normalization is needed for cross-OS compatibility.

jrfnl added a commit that referenced this issue Mar 17, 2021
Fixes #4

Includes tests.
jrfnl added a commit that referenced this issue Mar 17, 2021
@afilina afilina self-assigned this Mar 17, 2021
@afilina afilina removed their assignment Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants