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

Add max-len rule #1613

Merged
merged 7 commits into from
Aug 6, 2024
Merged

Add max-len rule #1613

merged 7 commits into from
Aug 6, 2024

Conversation

bgrgicak
Copy link
Collaborator

@bgrgicak bgrgicak commented Jul 15, 2024

Motivation for the change, related issues

Long doc comments are hard to read and it's easy to write long comments.

We need an automated way of checking for the comment length.

Implementation details

This PR adds eslint-plugin-comment-length to implement comment max-len eslint rules.

The errors aren't fixed to avoid creating issues with this PR, but they will show up as warnings, so we can fix them in the future.

Testing Instructions (or ideally a Blueprint)

  • CI

@bgrgicak bgrgicak self-assigned this Jul 15, 2024
.eslintrc.json Outdated Show resolved Hide resolved
@bgrgicak bgrgicak marked this pull request as ready for review August 5, 2024 09:35
@bgrgicak bgrgicak requested a review from a team as a code owner August 5, 2024 09:35
@bgrgicak
Copy link
Collaborator Author

bgrgicak commented Aug 6, 2024

@brandonpayton I ran the --fix command, so that we don't get any warnings.

@bgrgicak bgrgicak requested a review from brandonpayton August 6, 2024 11:04
.eslintrc.json Outdated Show resolved Hide resolved
// @TODO: Don't process the command. Lean on the shell to do it, e.g. through
// a PATH or an alias.
// @TODO: Don't process the command. Lean on the shell to do it, e.g.
// through a PATH or an alias.
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to see "e.g." next to the subsequent text, but this is OK and to be expected for auto-fix output.

Copy link
Member

@brandonpayton brandonpayton left a comment

Choose a reason for hiding this comment

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

It's kind of funny when the auto-fix wraps a single word to the next line, but overall this looks fine to me.

I'm planning to remove the ignorePattern which seems unused, rerun the fix to make sure that change didn't break anything, and merge.

Thank you, @bgrgicak!

@brandonpayton brandonpayton merged commit 27dc040 into trunk Aug 6, 2024
4 checks passed
@brandonpayton brandonpayton deleted the add/eslint-max-code-length branch August 6, 2024 16:02
bgrgicak added a commit that referenced this pull request Aug 8, 2024
Long doc comments are hard to read and it's easy to write long comments.

We need an automated way of checking for the comment length.

This PR adds
[eslint-plugin-comment-length](https://www.npmjs.com/package/eslint-plugin-comment-length?activeTab=readme)
to implement comment max-len `eslint` rules.

The errors aren't fixed to avoid creating issues with this PR, but they
will show up as warnings, so we can fix them in the future.

- CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants