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

Add linter rule disallowing test_ method prefix in tests #294

Closed
wants to merge 3 commits into from

Conversation

sbine
Copy link
Contributor

@sbine sbine commented Aug 19, 2022

Per @mattstauffer, this PR adds a rule disallowing the use of the test prefix on test methods, instead suggesting the /** @test */ annotation. It will catch any public test method beginning with test.

I've updated the Tighten preset to include this linter, so this PR is a breaking change.

@sbine sbine requested a review from driftingly August 19, 2022 21:11
@mattstauffer
Copy link
Member

Looks good to me! I don't know how we handle breaking changes in the Tighten preset that aren't breaking changes in the tool itself. LMK if y'all need any input from me on that.

@driftingly
Copy link
Member

@sbine this looks good!
I'm inclined to add this to Tighten Coding Standard
using php_unit_test_annotation. This will give us both linting and fixing without us having to maintain this functionality.
After Tighten Coding Standard is updated, I have a PR to remove duplicate functionality in TLint, allowing us to focus TLint development on features not covered by other tools. Does that make sense?

If you have time, I'd love feedback on the above Tighten Coding Standard PR.

@driftingly driftingly deleted the feature/add-test-annotation-linter branch October 18, 2022 23:32
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.

3 participants