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

Run additional linters as pre-commit hooks #1798

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

brianaydemir
Copy link
Contributor

@brianaydemir brianaydemir commented Dec 5, 2024

Despite the original motivation for #1183, it turns out that most of the changes in this PR are to Go files. Also, while I'm here, I decided to add ShellCheck as another linter.

My intent behind the new configuration in .pre-commit-config.yaml and _typos.yaml is to reduce the amount of code that needs "fixing" in this PR. Developers are always welcome to run typos and shellcheck on their own, but given that this is an existing codebase, I don't think it's useful to flag every potential issue.

Note that typos does not run a spell check but instead has a built-in database of common spelling corrections. As a result, there might still be spelling mistakes in the code base. Furthermore, while I've applied the changes suggested by typos, I didn't put much effort into reviewing every modified comment for clarity and grammar.

I did confirm that typos seems to be willing to run on the vast majority of relevant files in this repository.

For reviewers:

  • Be aware that some of the changes in this PR are to executable code, and not just comments. I'm relying on the GO compiler to make sure that executable code has been modified consistently. Shell scripts will require more careful review, e.g., there's some certificate mangling in images/entrypoint.sh that I'm guessing has never been used in the wild.

@brianaydemir brianaydemir added the internal Internal code improvements, not user-facing label Dec 5, 2024
@brianaydemir brianaydemir linked an issue Dec 5, 2024 that may be closed by this pull request
@brianaydemir brianaydemir marked this pull request as ready for review December 6, 2024 03:35
@brianaydemir brianaydemir added this to the v7.13.0 milestone Dec 12, 2024
@brianaydemir
Copy link
Contributor Author

@jhiemstrawisc Assigning to you to find a reviewer. (I'll rebase this once 7.12 is out the door.)

Copy link
Member

@jhiemstrawisc jhiemstrawisc left a comment

Choose a reason for hiding this comment

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

Things here look okay to me and I wouldn't mind merging at is, although I had a few comments/questions I'm hoping you can address before we do that.

Changes notwithstanding, once this is rebased it should be okay to merge. Thanks Brian!

Copy link
Member

Choose a reason for hiding this comment

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

Since this is a critical section of bash scripting that goes beyond testing, can you double check the changes to make sure we think they're okay?

lotman/lotman_test.go Show resolved Hide resolved
@@ -358,7 +358,7 @@ func TestHandlePacket(t *testing.T) {
expectedLinkConnectIncDup := strings.NewReader(mockPromLinkConnectInc)
expectedLinkByteXferIncDup := strings.NewReader(mockPromLinkByteXferInc)

// First time received a summmary packet
Copy link
Member

Choose a reason for hiding this comment

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

And here I had assumed this was just an extra tasty packet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Internal code improvements, not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a linter to check typos in non-Go files
2 participants