-
Notifications
You must be signed in to change notification settings - Fork 147
feat: add prefer-query-matchers
rule
#750
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
feat: add prefer-query-matchers
rule
#750
Conversation
9c512a4
to
44850ff
Compare
@Belco90 Ready for review! As we worked on this, we thought of another options schema idea. With the current API, there is some repetition if you have a lot of configured entries: {
"validEntries": [
{"matcher": "toBeA", "query": "get"},
{"matcher": "toBeB", "query": "query"},
{"matcher": "toBeC", "query": "get"},
{"matcher": "toBeD", "query": "query"},
{"matcher": "toBeE", "query": "get"},
{"matcher": "toBeF", "query": "query"},
]
} It might reduce repetition in the options if we group the {
"getMatchers": ["toBeA", "toBeC", "toBeE"],
"queryMatchers": ["toBeB", "toBeD", "toBeF"]
} Please let us know if you'd like us to make that change; it would be quick. |
@CodingItWrong makes sense! I'll try to review it by the end of the month. |
Thanks @Belco90! @MichaelDeBoey was changing this PR to draft intentional? If so, could you provide some rationale? In my understanding it's complete and ready to review and merge. EDIT: I just noticed that the PR description was out of date, and still referred to a draft and work remaining to be done. I've now edited the description to correctly indicate that that work is done. |
Hello! I worked on this rule with @CodingItWrong. We were wondering if it made sense for this rule to come with a default configuration. This default would ensure that the matcher |
@MichaelDeBoey I've moved this PR back out of draft as my intention is that it's ready for review, and you haven't given a reason it should be in draft instead. If you do think it needs to be a draft, please provide a reason—thank you. |
prefer-query-matchers
rule
@CodingItWrong thanks for your patience! I'm slowly catching up, so I hope I can review it soon. |
@Belco90 No worries! I just fixed the style issue that CI was reporting. I'll keep an eye on any other failures to address them. |
@Belco90 BTW we see that the branch is out-of-date with Is there an easy way to pre-approve CI to rerun after any fix I push up? If so that would allow us to resolve issues in advance |
I'm afraid there isn't! Any way of automating it would lead to the same issue that restriction prevents. |
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.
It was really easy to follow the implementation of the rule, great job! I've seen you used a couple of existing helpers, I hope that made working with the codebase easier.
I just asked for a change to improve the code scenarios of the tests, everything else LGTM. It would be nice to also catch asserts with elements queried before the assertion, but it's fine for this first implementation.
Co-authored-by: Dale Karp <[email protected]>
Co-authored-by: Dale Karp <[email protected]>
Co-authored-by: Dale Karp <[email protected]>
b5739eb
to
8073bf9
Compare
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.
LGTM! Thank you both for your contribution!
I think I forgot to answer to this, I just realized now… I think for the first implementation of the rule is fine like the current one (although it can cause tons of entries in the options). Still, we can implement this alternative way of configuring it living together with the current implementation. |
🎉 This PR is included in version 5.11.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@all-contributors |
@all-contributors please add @obsoke for code, test, and docs |
I've put up a pull request to add @CodingItWrong! 🎉 I've put up a pull request to add @obsoke! 🎉 |
I've updated the pull request to add @obsoke! 🎉 |
@all-contributors please add @obsoke for code, test, and docs |
I've put up a pull request to add @obsoke! 🎉 |
🎉 This PR is included in version 6.0.0-alpha.15 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Checks
Changes
prefer-query-matchers
rule, with tests and docsContext
Fixes #728