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 lane with static checks #288

Merged
merged 9 commits into from
Nov 19, 2021
Merged

Conversation

ffromani
Copy link
Collaborator

@ffromani ffromani commented Nov 19, 2021

Add gh actions lane to run static code checks:

  • linting provided by golangci-lint
  • basic code format check using go fmt

Fixes: #51

Makes gofmt happy.

Signed-off-by: Francesco Romani <fromani@redhat.com>
Signed-off-by: Francesco Romani <fromani@redhat.com>
according to golint-ci, and confirmed by `git grep`, this code
was lingering around unused. Let's get rid of it.

Signed-off-by: Francesco Romani <fromani@redhat.com>
Mechanical simplifications as suggested by the tool.

Signed-off-by: Francesco Romani <fromani@redhat.com>
Let's not swallow errors, even if they are unlikely.
This makes the troubleshooting experience a bit easier
with very tiny extra maintenance cost.

Signed-off-by: Francesco Romani <fromani@redhat.com>
It's test code, we can afford a little extra ugliness
to make the lint happy.

Signed-off-by: Francesco Romani <fromani@redhat.com>
Let's not lose teardown errors completely.
We cannot really recover from teardown errors in `context.Do()`,
but we can at least trace them to enable some troubleshooting.

Signed-off-by: Francesco Romani <fromani@redhat.com>
The documentation of the callback (WalkFunc) of
`filepath.Walk` reads like:

  The err argument reports an error related to path, signaling that Walk
  will not walk into that directory. The function can decide how to
  handle that error; as described earlier, returning the error will cause
  Walk to stop walking the entire tree.

Here we want to always keep walking, and this is why we ignored
the argument. We still want to do this, so let's rename the
argument to signal the intent of the code, and to avoid unwanted
shadowing with the local variable.

Signed-off-by: Francesco Romani <fromani@redhat.com>
let's add tier-0 (static check) lanes, starting with the lint lane
featuring golang-ci lint

Signed-off-by: Francesco Romani <fromani@redhat.com>
@ffromani ffromani changed the title WIP: add lane with static checks add lane with static checks Nov 19, 2021
Copy link
Owner

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

Sweet :) thanks Francesco!

@jaypipes jaypipes merged commit 004673d into jaypipes:main Nov 19, 2021
@ffromani ffromani deleted the static-check-lanes branch November 23, 2021 07:12
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.

Correct lint errors
2 participants