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

feat: description missing lint rule #113

Merged
merged 12 commits into from
Jul 9, 2024
Merged

Conversation

adthrasher
Copy link
Member

@adthrasher adthrasher commented Jul 9, 2024

This pull request adds a new rule to wdl-lint.

  • Rule Name: DescriptionMissing

This rule ensures that each meta section includes a description keyword.

Before submitting this PR, please make sure:

  • You have added a few sentences describing the PR here.
  • You have added yourself or the appropriate individual as the assignee.
  • You have added at least one relevant code reviewer to the PR.
  • Your code builds clean without any errors or warnings.
  • You have added an entry to the relevant CHANGELOG.md (see
    ["keep a changelog"] for more information).
  • Your commit messages follow the [conventional commit] style.

Rule specific checks:

  • You have added the rule as an entry within RULES.md.
  • You have added the rule to the rules() function in wdl-lint/src/lib.rs.
  • You have added a test cases in wdl-lint/tests/lints that covers every
    possible diagnostic emitted for the rule within the file where the rule
    is implemented.
  • You have run wdl-gauntlet --refresh to ensure that there are no
    unintended changes to the baseline configuration file (Gauntlet.toml).
  • You have run wdl-gauntlet --refresh --arena to ensure that all of the
    rules added/removed are now reflected in the baseline configuration file
    (Arena.toml).

@adthrasher adthrasher self-assigned this Jul 9, 2024
@adthrasher adthrasher marked this pull request as ready for review July 9, 2024 14:04
Copy link
Member

@a-frantz a-frantz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this lint doesn't fire if there is no meta section, right? Are we sure that's the right behavior? Presumably sometime soon we're going to implement a lint for "must have a meta section". Should that be handled all at once?

wdl-lint/src/rules/description_missing.rs Outdated Show resolved Hide resolved
@adthrasher
Copy link
Member Author

adthrasher commented Jul 9, 2024

So this lint doesn't fire if there is no meta section, right? Are we sure that's the right behavior? Presumably sometime soon we're going to implement a lint for "must have a meta section". Should that be handled all at once?

@a-frantz - I think you're already handling that case here: https://github.com/stjude-rust-labs/wdl/blob/main/wdl-lint/src/rules/missing_metas.rs

@a-frantz
Copy link
Member

a-frantz commented Jul 9, 2024

So this lint doesn't fire if there is no meta section, right? Are we sure that's the right behavior? Presumably sometime soon we're going to implement a lint for "must have a meta section". Should that be handled all at once?

@a-frantz - I think you're already handling that case here: https://github.com/stjude-rust-labs/wdl/blob/main/wdl-lint/src/rules/missing_metas.rs

Right, I forgot about that 🤦 . But should we consolidate these rules somehow? Maybe I'm over complicating things, but I'm concerned with the case that a user gets the MissingMetas lint, thinks they've "fixed" their code by adding metas, and then they receive your new lint because they did it "wrong". Is that two step process annoying?

@adthrasher
Copy link
Member Author

So this lint doesn't fire if there is no meta section, right? Are we sure that's the right behavior? Presumably sometime soon we're going to implement a lint for "must have a meta section". Should that be handled all at once?

@a-frantz - I think you're already handling that case here: https://github.com/stjude-rust-labs/wdl/blob/main/wdl-lint/src/rules/missing_metas.rs

Right, I forgot about that 🤦 . But should we consolidate these rules somehow? Maybe I'm over complicating things, but I'm concerned with the case that a user gets the MissingMetas lint, thinks they've "fixed" their code by adding metas, and then they receive your new lint because they did it "wrong". Is that two step process annoying?

I'm not sure it matters. If we fold it into the MissingMetas rule, presumably you wouldn't flag the missing description as well. We've been avoiding giving repetitive warnings. Then once meta exists, you'd get the missing description warning.

@adthrasher
Copy link
Member Author

So this lint doesn't fire if there is no meta section, right? Are we sure that's the right behavior? Presumably sometime soon we're going to implement a lint for "must have a meta section". Should that be handled all at once?

@a-frantz - I think you're already handling that case here: https://github.com/stjude-rust-labs/wdl/blob/main/wdl-lint/src/rules/missing_metas.rs

Right, I forgot about that 🤦 . But should we consolidate these rules somehow? Maybe I'm over complicating things, but I'm concerned with the case that a user gets the MissingMetas lint, thinks they've "fixed" their code by adding metas, and then they receive your new lint because they did it "wrong". Is that two step process annoying?

I'm not sure it matters. If we fold it into the MissingMetas rule, presumably you wouldn't flag the missing description as well. We've been avoiding giving repetitive warnings. Then once meta exists, you'd get the missing description warning.

Maybe MissingMetas could have .fix() updated to clarify to add a meta with a description field.

@a-frantz
Copy link
Member

a-frantz commented Jul 9, 2024

Yea good points. OOS for this PR, but another idea: can we link rules somehow? Like in the output of sprocket explain MissingMetas can we say "Also see DescriptionMissing"?

@adthrasher
Copy link
Member Author

Yea good points. OOS for this PR, but another idea: can we link rules somehow? Like in the output of sprocket explain MissingMetas can we say "Also see DescriptionMissing"?

Just added #116 to track that issue.

Copy link
Member

@a-frantz a-frantz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright this should be good to merge then 🚀

@adthrasher adthrasher merged commit 1e289b9 into main Jul 9, 2024
7 checks passed
@adthrasher adthrasher deleted the feat/description_missing branch July 9, 2024 21:04
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.

4 participants