WordPress / WordPress/WordPress-Coding-Standards
DirectoryName sniff ?
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 2.8k
- Forks
- 521
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 1
Description
The WP CS handbook has clear guidelines on filenames and these are covered by the WPCS FileName sniff.
However, what about directory names ?
Looking at the conventions used in WP Core, as well as in leading plugins, "lowercase, underscore dash-separated words" is the unofficial convention in the WP sphere.
Open Questions
- Should this unofficial convention about directory names be formalized into a rule ?
- If so, should we have a sniff checking this rule ?
That is: checking for this for the directory path parts after the path to a project root: i.e. in the pathpath/to/project/src/admin/class-files/event/file.php, only thesrc,admin,class-files, andeventparts would be checked.
Opinions welcome!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the WordPress CS handbook naming-conventions guidance and the existing WPCS FileName sniff. Use the issue's open questions to determine whether directory naming should be formalized and whether a sniff should check path parts after a project root. Done means an agreed convention and a defined implementation scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100