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

Not respecting standards file #40

Open
lode opened this issue Jun 25, 2020 · 7 comments · May be fixed by #44
Open

Not respecting standards file #40

lode opened this issue Jun 25, 2020 · 7 comments · May be fixed by #44
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@lode
Copy link

lode commented Jun 25, 2020

I have an action setup exactly as in the readme (https://github.com/tinovyatkin/action-php-codesniffer#usage), and have a phpcs.xml in the root of the repository which looks alike this:

<?xml version="1.0"?>
<ruleset>
	<arg name="colors"/>
	<file>.</file>
	<exclude-pattern>./vendor/*</exclude-pattern>
	<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
	<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar"/>
	<rule ref="PSR2.Files.EndFileNewline"/>
</ruleset>

I'm including a few specific rules and no generic standard. However, I get annotations referring to Generic.Files.LineLength.TooLong and PEAR.WhiteSpace.ScopeIndent.Incorrect and others which I didn't include.

It seems thus as if my standards file is not respected/recognized and a default standard is used. Does anyone know what's going on?

@tinovyatkin
Copy link
Owner

Did you point to the file directly viat standard parameter?

Can you copy your workflow file here?

@lode
Copy link
Author

lode commented Jun 25, 2020

Yes, I have:

      - uses: tinovyatkin/action-php-codesniffer@v1
        with:
          files: "**.php" # you may customize glob as needed
          phpcs_path: php phpcs.phar
          standard: phpcs.xml

It is an exact copy of the readme.

@lode
Copy link
Author

lode commented Jun 25, 2020

I set up an example repo. See lode/phpcs-action-test#1. It makes remarks about things outside my standards, and the things inside the standards, like Generic.Arrays.DisallowLongArraySyntax, are not annotated.

@tinovyatkin tinovyatkin added the bug Something isn't working label Jun 25, 2020
@tinovyatkin
Copy link
Owner

Confirmed that it indeed ignores the standard option when running on blame

@tinovyatkin tinovyatkin added the good first issue Good for newcomers label Jun 25, 2020
@lode lode linked a pull request Jun 29, 2020 that will close this issue
@thenabeel
Copy link

Since author hasn't merged the code yet, I have fixed and published my own fork of it.
Anyone facing this issue can use this in your yml file:
uses: thenabeel/action-phpcs@v8

@elenakondrateva
Copy link

@thenabeel thanks for the fork! Looking forward to merging the code as I am experiencing same issue.

@thenabeel
Copy link

@thenabeel thanks for the fork! Looking forward to merging the code as I am experiencing same issue.

@elenakondrateva I just saw your comment, haha pretty late. I hope it was helpful for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants