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

tinygo source displeases linters #4225

Open
dkegel-fastly opened this issue Apr 12, 2024 · 1 comment
Open

tinygo source displeases linters #4225

dkegel-fastly opened this issue Apr 12, 2024 · 1 comment
Labels
enhancement New feature or request next-release Will be part of next release

Comments

@dkegel-fastly
Copy link
Contributor

Eagle-eyed new contributors have noticed that the tinygo source tree does not pass some lint checks.

The project probably shouldn't rely on volunteers to run lint.

To address this, we might run lint in ci and/or add a "make lint" target in GNUMakefile.

To avoid adding too many new dependencies, we might want to keep the number of linters small, e.g. just go vet and revive, for starters, and avoid metalinters.

dkegel-fastly added a commit that referenced this issue Apr 13, 2024
See #4225

Runs in both circleci and github, circleci is run on branch push, github is run on PR

Revive builds so fast, don't bother installing it; saves us wondering which one we get

Uses tools.go idiom to give control over linter versions to go.mod.

Also pacifies linter re AppendToGlobal as a token first fix.

TODO: gradually expand the number of directories that are linted,
uncomment more entries in revive.toml, and fix or suppress the
warnings lint finds.

TODO: add linters "go vet" and staticcheck

NOT TODO: don't add metalinters like golangci-lint that pull in
lots of new of dependencies; we'd rather not clutter go.mod that
much, let alone open ourselves up to the additional attack surface.
deadprogram pushed a commit that referenced this issue Apr 13, 2024
See #4225

Runs in both circleci and github, circleci is run on branch push, github is run on PR

Revive builds so fast, don't bother installing it; saves us wondering which one we get

Uses tools.go idiom to give control over linter versions to go.mod.

Also pacifies linter re AppendToGlobal as a token first fix.

TODO: gradually expand the number of directories that are linted,
uncomment more entries in revive.toml, and fix or suppress the
warnings lint finds.

TODO: add linters "go vet" and staticcheck

NOT TODO: don't add metalinters like golangci-lint that pull in
lots of new of dependencies; we'd rather not clutter go.mod that
much, let alone open ourselves up to the additional attack surface.
@deadprogram deadprogram added enhancement New feature or request next-release Will be part of next release labels Apr 22, 2024
@dkegel-fastly
Copy link
Contributor Author

Plain old lint target exists, runs one linter now, and several problems have been fixed.

I think we can close this now; further lint enhancements can continue without this bug report being open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request next-release Will be part of next release
Projects
None yet
Development

No branches or pull requests

2 participants