Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
run:
skip-dirs:
- .*/mocks

issues:
# https://github.com/golangci/golangci-lint/issues/2439
exclude-use-default: false

linters:
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
- revive

linters-settings:
revive:
severity: error
rules:
- name: exported
arguments:
- checkPrivateReceivers
Comment on lines +1 to +26
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these repo specific settings needed because the global one was producing issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lpusok had the idea to keep enforcing comments for exported types and functions. This is disabled by default, this is the part that enables it explicitly. I think this lint rule only makes sense in library repos, I wouldn't enforce it in step repos.

Copy link
Contributor

Choose a reason for hiding this comment

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

And we need the run, issues, linters section too just to be able to use linters-settings?

By the way I have a beef with this rule because at the moment I do not think it is useful. Most of our stuff simply receive this to please the linting gods (you are the exception because I remember in previous cache PRs you left some actual description for the exported functions):

// [type-name] ...

I am happy to have it as it is too but if it were to me then I would simply remove this rule. 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And we need the run, issues, linters section too just to be able to use linters-settings?

The run and issues sections are needed to make it work in our repo, the linters section is not strictly needed, but I thought it's a good idea to explicitly define the enabled linters that are enabled by default anyway. But I'm happy to remove it if you don't find it useful!

By the way I have a beef with this rule because at the moment I do not think it is useful. Most of our stuff simply receive this to please the linting gods

I too find it sometimes annoying, but it also made me add meaningful comments on a few occasions when I forgot to do it on my own 😁 Let's go with it for now and I'll raise this on the next eng sync to discuss.

12 changes: 7 additions & 5 deletions bitrise.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
format_version: "11"
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git


workflows:
test:
steps:
- go-list:
- golint:
- errcheck:
- go-test:
- git::https://github.com/bitrise-steplib/steps-check.git:
title: Lint
inputs:
- workflow: lint
- skip_step_yml_validation: "yes"
- go-list: { }
- go-test: { }