-
Notifications
You must be signed in to change notification settings - Fork 96
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(core): created linter for #426 #452
Conversation
Let's me Ugliest variants Lets me |
Oh here's one in harper's source, so better than a contrived example: // Often the longest and the shortest words are the most helpful, so lets push
// them first. See #460 |
CurrencyPlacement => true, | ||
LetUsRedundancy => true | ||
); |
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.
Does Rust support the following notation as other languages do.
CurrencyPlacement => true, | |
LetUsRedundancy => true | |
); | |
CurrencyPlacement => true, | |
LetUsRedundancy => true, | |
); |
It could avoid updating unrelated line on each rule addition
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.
Rust does, but this is actually one of our macros. I don't think it would be worth the effort to add that in.
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.
turns out it's really easy
add $(,)?
to the end of the macro signature
($($linter:ident => $default:expr),* $(,)?) => {
I've revised it to cover more cases, like those discussed in #470. Let me know if there is anything else that should be added to this rule before I can merge it. |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [Automattic/harper/harper-ls](https://github.com/Automattic/harper) | minor | `v0.16.0` -> `v0.18.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>Automattic/harper (Automattic/harper/harper-ls)</summary> ### [`v0.18.0`](https://github.com/Automattic/harper/releases/tag/v0.18.0) [Compare Source](Automattic/harper@v0.17.0...v0.18.0) #### What's Changed - fix two grammatical errors by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#481 - Reword description of "that which" to avoid ironic redundancy by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#479 - feat([#​422](Automattic/harper#422)): add `same than` -> `same as` matcher trigger by [@​grantlemons](https://github.com/grantlemons) in Automattic/harper#453 - missing definite article, comma placement by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#480 - Improvements to `PluralConjugate` by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#474 - correct Valentine's Day by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#491 - typo in zed integration doc by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#490 - feat(core): created linter for [#​426](Automattic/harper#426) by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#452 - I missed a lets/let's mistake in a comment by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#492 - docs: rewrote instructions on how to author a rule by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#482 - missing indefinite article in comments by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#488 - Apply rule from issue [#​465](Automattic/harper#465) to core document.rs by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#510 - feat(core): allow trailing commas in the `lint_group` macro by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#483 - fix agreement error in docs by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#417 **Full Changelog**: Automattic/harper@v0.17.0...v0.18.0 ### [`v0.17.0`](https://github.com/Automattic/harper/releases/tag/v0.17.0) [Compare Source](Automattic/harper@v0.16.0...v0.17.0) #### What's Changed - feat([#​393](Automattic/harper#393)): add clap version & about attributes by [@​grantlemons](https://github.com/grantlemons) in Automattic/harper#394 - docs: added Homebrew as an installation method by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#395 - typos/spelling/grammar fixes in comments, docs, and strings by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#398 - fix(core): harden title case module by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#396 - fix(core): indexing problems by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#409 - fix typo: remove extraneous 'to' by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#418 - chore: update description of Oxford rule by [@​ccoVeille](https://github.com/ccoVeille) in Automattic/harper#419 - build(deps): bump itertools from 0.13.0 to 0.14.0 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#431 - build(deps): bump serde_json from 1.0.135 to 1.0.137 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#429 - Typst Test Fixes by [@​grantlemons](https://github.com/grantlemons) in Automattic/harper#391 - build(deps): bump clap from 4.5.23 to 4.5.27 by [@​dependabot](https://github.com/dependabot) in Automattic/harper#444 - feat: Update VSCode Config by [@​mcecode](https://github.com/mcecode) in Automattic/harper#400 - fix(core): infinite lint loops by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#390 - Clean Up `harper-ls` logs by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#447 - build(deps): bump undici from 6.19.8 to 6.21.1 in /packages by [@​dependabot](https://github.com/dependabot) in Automattic/harper#450 - typo by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#462 - fix(core): the Oxford comma applies to `nor` as well by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#445 - feat(harper.js): added ability to explicitly set config to the default by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#449 - build(deps-dev): bump vite from 6.0.5 to 6.0.9 in /packages by [@​dependabot](https://github.com/dependabot) in Automattic/harper#448 - feat(core): created a new rule that resolves [#​414](Automattic/harper#414) by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#455 - build(deps-dev): bump vite from 5.4.11 to 5.4.12 in /packages by [@​dependabot](https://github.com/dependabot) in Automattic/harper#475 - docs: added page to explain tooling for reviewers by [@​elijah-potter](https://github.com/elijah-potter) in Automattic/harper#471 - fix instance of [#​384](Automattic/harper#384) in docs by [@​hippietrail](https://github.com/hippietrail) in Automattic/harper#477 #### New Contributors - [@​hippietrail](https://github.com/hippietrail) made their first contribution in Automattic/harper#398 - [@​ccoVeille](https://github.com/ccoVeille) made their first contribution in Automattic/harper#419 **Full Changelog**: Automattic/harper@v0.16.0...v0.17.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMjYuMSIsInVwZGF0ZWRJblZlciI6IjM5LjEzNC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
This PR introduces a rule that searches for incorrect usage of the contraction
let's
.@ccoVeille or @hippietrail, before merging I'd like to add more test cases. If have some more, just shoot 'em below.
Closes #426.