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: call_input_spacing rule #102

Merged
merged 21 commits into from
Jul 1, 2024
Merged

feat: call_input_spacing rule #102

merged 21 commits into from
Jul 1, 2024

Conversation

adthrasher
Copy link
Member

@adthrasher adthrasher commented Jun 25, 2024

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

  • Rule Name: CallInputSpacing

Ensures that the input keyword follows the opening brace and exactly one space. Ensures that if more than one input exists, they are on separate lines. Ensures that the assignment operator ("=") is surrounded by whitespace.

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 requested a review from a-frantz June 25, 2024 19:21
@adthrasher adthrasher self-assigned this Jun 25, 2024
@adthrasher
Copy link
Member Author

@a-frantz - This one is likely to end up being controversial given the number of new entries in Arena.

@adthrasher adthrasher marked this pull request as ready for review June 25, 2024 19:35
wdl-lint/src/rules/call_input_spacing.rs Outdated Show resolved Hide resolved
wdl-lint/src/rules/call_input_spacing.rs Outdated Show resolved Hide resolved
wdl-lint/src/rules/call_input_spacing.rs Outdated Show resolved Hide resolved
wdl-lint/tests/lints/input-spacing/source.errors Outdated Show resolved Hide resolved
@adthrasher adthrasher requested a review from peterhuene June 28, 2024 13:37
@a-frantz
Copy link
Member

@a-frantz - This one is likely to end up being controversial given the number of new entries in Arena.

Yea, and I think anytime we're about to add a bunch of entries to Arena we should step back and think hard before hitting merge. That said I think these numbers are slightly inflated by your implementation "double-reporting" certain spans? Maybe we should cap it at one diagnostic per-call-statement?

@adthrasher adthrasher requested a review from a-frantz June 28, 2024 19:17
wdl-lint/src/rules/call_input_spacing.rs Outdated Show resolved Hide resolved
wdl-lint/src/rules/call_input_spacing.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@peterhuene peterhuene left a comment

Choose a reason for hiding this comment

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

This is looking pretty solid! Just a few feedback comments.

wdl-ast/src/v1/workflow.rs Outdated Show resolved Hide resolved
wdl-lint/src/rules/call_input_spacing.rs Outdated Show resolved Hide resolved
wdl-lint/src/rules/call_input_spacing.rs Outdated Show resolved Hide resolved
adthrasher and others added 2 commits June 29, 2024 12:35
Co-authored-by: Peter Huene <peter@huene.dev>
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.

(can you refresh base gauntlet to get the latest workflows hash?)
Other than that this LGTM.

@adthrasher adthrasher merged commit 3f502ad into main Jul 1, 2024
7 checks passed
@adthrasher adthrasher deleted the feat/call_input_spacing branch July 1, 2024 15:47
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