Skip to content

Remove Default <file> and <basepath> values#187

Merged
mikeselander merged 3 commits into
masterfrom
fix-file-loading-all
Apr 7, 2020
Merged

Remove Default <file> and <basepath> values#187
mikeselander merged 3 commits into
masterfrom
fix-file-loading-all

Conversation

@mikeselander
Copy link
Copy Markdown
Contributor

This PR fixes several issues related to the defaults set in the HM ruleset that define the basepath and main files. These provide easy defaults, but can cause issues in several cases which make our rules unusable.

I feel comfortable forcing projects to set these values as they need since PHPCS should really only be setup once on a project.

Paging @jrfnl and @ntwb - do you see any problem with removing these values I might have missed?

Copy link
Copy Markdown
Contributor

@tfrommen tfrommen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this makes sense.

I defined basepath primarily for shorter (relative) paths in reports, and I did not know it could/does cause any issues.

Now, to make this an actual ruleset, we might also want to remove the exclude patterns, as well as the specified php extension...?

@jrfnl
Copy link
Copy Markdown

jrfnl commented Apr 7, 2020

do you see any problem with removing these values I might have missed?

@mikeselander No, those are settings which should never have been included in a Standard anyway. They should only ever be used in the rulesets of individual projects.

Now, to make this an actual ruleset, we might also want to remove the exclude patterns, as well as the specified php extension...?

I agree with @tfrommen, especially about the extension setting.
The specific exclude-pattern-s used seem not that problematic, though they should probably be made more specific. Keep in mind those are treated as regex-es!

The <config name="testVersion" value="7.1-" /> should also be project based as it is near impossible to overrule otherwise.

Copy link
Copy Markdown
Member

@rmccue rmccue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I added <file> originally to try and improve the usability of phpcs on the command line, making it one command instead of having to always provide a "redundant" .. Happy to change that.

I am happy to keep both testVersion and extensions in here. We don't want PHP in any files that aren't .php generally, and having a standard PHP version set across all our projects I think is OK.

@mikeselander
Copy link
Copy Markdown
Contributor Author

The should also be project based as it is near impossible to overrule otherwise.

Good to know, I'll address that in another PR 👍

Thanks for the feedback, all - moving this forward :shipit:

@mikeselander mikeselander merged commit db63210 into master Apr 7, 2020
@mikeselander mikeselander deleted the fix-file-loading-all branch April 7, 2020 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standards not being detected by VS Code current ruleset prevents to exclude everything except certain folders

4 participants