-
Notifications
You must be signed in to change notification settings - Fork 15
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
Check namespaces and class imports for leading backslash #61
Conversation
Codecov Report
@@ Coverage Diff @@
## main #61 +/- ##
============================================
+ Coverage 95.53% 95.62% +0.08%
- Complexity 440 445 +5
============================================
Files 19 20 +1
Lines 1165 1188 +23
============================================
+ Hits 1113 1136 +23
Misses 52 52
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Q: Shouldn't we also add And little detail, it looks "strange" that our class is named "NoLeadingSlash", shouldn't it be better named "LeadingSlash". Similar sentiment with the problem name, we are naming it "NamespaceStartsWithSlash", that is redundant ("namespace") and uses different wording. Why not, also for the problem, just use "LeadingSlash". FYC, ciao :-) PS, I've seen that there are a few tests failing right now... |
3dc1903
to
7c26cd9
Compare
If I make this LeadingSlash and name the problem Rather than that, I've tried to take inspiration from the PSR-12 one and now have: I think the duplication of Thoughts?
phplint was actually picking this up already so I think I've got that now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like making it NamespaceStatement
so we can add later more checks there.
Note: I'm completing the API checks for PHPUnit classes (that already have Namespace checks). Once working I plan to move them from being "phpunit only" to be "whole codebase" ones. Surely then we'll be adding more checks to the NamespaceStatement
sniff added here.
7c26cd9
to
e3dae34
Compare
Perfect - that was about what I had in mind too! |
Fixes #20