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

Consider adding leading dot to config files for visibility #1566

Closed
skyrpex opened this issue Jul 20, 2017 · 11 comments
Closed

Consider adding leading dot to config files for visibility #1566

skyrpex opened this issue Jul 20, 2017 · 11 comments

Comments

@skyrpex
Copy link

skyrpex commented Jul 20, 2017

Pretty much what the title says. It's pretty common to use hidden files (aka leading dot filenames) for configuration files (see eslint and editorconfig).

Edit: I mean phpcs.xml and its siblings.

  • The config file will be hidden in UNIX systems.
  • The config file will be naturally grouped with other config files whose name starts with dots (.editorconfig, .env, .gitattributes, .gitignore, etc...).

I'm wondering if you're open to MR for this change. I can contribute.

@gsherwood
Copy link
Member

Which config file are you you talking about here?

There is the CodeSniffer.conf file that is used to store vars set using --config-set and there is the phpcs.xml file used to define a default coding standard for a project.

The .conf file is normally hidden away and user-specific while the phpcs.xml file is normally committed to a repo and used by multiple developers.

The .conf file probably doesn't need a name change given it is hidden, and the phpcs.xml file follows the same standard as other QA tools like PHPUnit. So I'm not sure why a name change of these files would make sense. Are there other config files I'm forgetting?

@skyrpex
Copy link
Author

skyrpex commented Jul 21, 2017

Sorry, I meant phpcs.xml and its variants.

the phpcs.xml file follows the same standard as other QA tools like PHPUnit.

That's true. I'll ask the same thing to PHPUnit depending on how this discussion goes 👍

So I'm not sure why a name change of these files would make sense. Are there other config files I'm forgetting?

Basically, to follow the unspoken standard of files that don't "logically belong" to a project source code to start with a dot. Examples are .eslintrc, .editorconfig, .npmignore, even the git files (.gitattributes, ...). These files just tell how a project behaves, but are not source code.

@gsherwood
Copy link
Member

I can allow the phpcs.xml file to be prefixed with a dot, but I can't ban the current format. This would extend to list of files PHPCS looks for to:

  • phpcs.xml
  • phpcs.xml.dist
  • .phpcs.xml
  • .phpcs.xml.dist

Is that what you're after?

@skyrpex
Copy link
Author

skyrpex commented Jul 24, 2017

Yes, it was my purpose. My guess is that people will slowly use the ones with initial dots, and eventually the other ones will be almost unused.

@gsherwood
Copy link
Member

That's a pretty small change, so I've committed support for the dot prefix and people can make up their own mind as to how they want the files to be named. Thanks for the suggestion.

@jrfnl
Copy link
Contributor

jrfnl commented Oct 8, 2017

I was just having a play around with this and am wondering whether the order in which the files are searched for is intuitive enough.

@gsherwood As the non-dist file(s) are supposed to overrule the dist file(s), I would consider the below order more logical. I'd be happy to send in a PR to change this if you'd be open to the change.

  1. .phpcs.xml
  2. phpcs.xml
  3. .phpcs.xml.dist
  4. phpcs.xml.dist

@gsherwood
Copy link
Member

I'd be happy to send in a PR to change this if you'd be open to the change.

Seems like a fair enough change. I'd be happy to merge a PR for it.

@jrfnl
Copy link
Contributor

jrfnl commented Oct 8, 2017

@gsherwood Thanks for your response. PR #1693 should take care of it ;-)

@jrfnl
Copy link
Contributor

jrfnl commented Mar 1, 2018

@skyrpex Just wondering - did you ever open the issue for PHPUnit ? And if so, link please ? (I searched but couldn't find it)

@skyrpex
Copy link
Author

skyrpex commented Mar 1, 2018

I'm sorry, I totally forgot it. There it is 😆

@jrfnl
Copy link
Contributor

jrfnl commented Mar 1, 2018

@skyrpex Excellent! Thanks ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants