-
Notifications
You must be signed in to change notification settings - Fork 656
refactor(assert,cbor,collections,fs,toml,uuid): align error messages to the style guide, add error-message
Deno Style Guide linter plugin
#6553
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
refactor(assert,cbor,collections,fs,toml,uuid): align error messages to the style guide, add error-message
Deno Style Guide linter plugin
#6553
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6553 +/- ##
========================================
Coverage 94.54% 94.54%
========================================
Files 580 580
Lines 43730 43850 +120
Branches 6471 6495 +24
========================================
+ Hits 41345 41459 +114
- Misses 2342 2348 +6
Partials 43 43 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Can you exclude the test only error messages from the check target? |
Done. I added single line ignores because most of these tests only cases also should follow the style guide imo but can make the switch at a later point. |
I disagree with that. That sounds unnecessarily strict rule. Also the style guide says it's rule for |
I think it is preferable to have a code base that follows the all the rules whenever possible, also for tests. There are only some exceptions in this particular case of error messages that might be justified to ignore lint rules, like specifically testing lower case errors for example. If the test works the same with a lowercase or uppercase message, there is no reason to not follow the rule imo. Else it is just an abuse of the lint ignore flag, no? |
It makes a contribution barrier and makes it unpleasant to contribute to the project to enforce unnecessary rules. Things like We can have access to file name via |
I am not sure which rules are considered necessary and which not but we also enforce other lint rules in test files, so I don't know why we would suspend some and enforce others. I would not call enforcing lint rules a contribution barrier. A warning can easily be ignored with s comment or auto-fixed. Wouldn't it be rather confusing if a contributor has to handle different rule sets for an api and tests? |
I'd lean towards not being overly strict too. |
But why hardcode ignoring files when one can just add an ignore file comment? This doesn't make sense to me. |
error message
Deno Style Guide linter plugin
I don't think we need to hardcode ignore files, but we can detect user-facing errors by using deno_graph + exports fields of each deno.json file. |
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.
Just nits. Otherwise, LGTM!
crypto/crypto.ts
Outdated
@@ -244,7 +244,7 @@ const stdCrypto: StdCrypto = ((x) => x)({ | |||
return context.digestAndDrop(length).buffer as ArrayBuffer; | |||
} else { | |||
throw new TypeError( | |||
"data must be a BufferSource or [Async]Iterable<BufferSource>", | |||
"Data must be a BufferSource or [Async]Iterable<BufferSource>", |
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 don't think this should be capitalized as this matches the variable name.
error message
Deno Style Guide linter pluginerror-message
Deno Style Guide linter plugin
It looks like we consistently use |
error-message
Deno Style Guide linter pluginerror-message
Deno Style Guide linter plugin
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
Part of #6551
Note: This plugin does not check for 3, 4, 5, 7 and 8 in the Style Guide for error messages as they would need language analysis.