Skip to content

[MAINT]: Introduce stricter linter rules for new code#3430

Open
deiga wants to merge 9 commits into
integrations:mainfrom
F-Secure-web:introduce-strict-linter-for-new-code
Open

[MAINT]: Introduce stricter linter rules for new code#3430
deiga wants to merge 9 commits into
integrations:mainfrom
F-Secure-web:introduce-strict-linter-for-new-code

Conversation

@deiga
Copy link
Copy Markdown
Collaborator

@deiga deiga commented May 14, 2026

Before the change?

  • New code and existing code forced to use same linter rules

After the change?

  • Enables holding new code to a stricter standard
  • Adds make lintcheck-new to run stricter linters on only code since HEAD of main
  • Adds make lintcheck-strict to run stricter linters on whole codebase
    • Useful to see if some strict linters can be moved to default config
  • Refactor ci.yaml workflow, to run linters in parallel using golangci-lint-action
    • This enables inline linter complaints in PRs

Pull request checklist

  • Schema migrations have been created if needed (example)
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

@github-actions
Copy link
Copy Markdown

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@deiga deiga marked this pull request as ready for review May 14, 2026 19:17
@deiga deiga changed the title introduce strict linter for new code [MAINT]: Introduce stricter linter rules for new code May 14, 2026
@deiga deiga requested a review from stevehipwell May 14, 2026 19:18
@deiga deiga added the Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR label May 14, 2026
@deiga deiga requested a review from Copilot May 14, 2026 19:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR separates baseline linting from stricter linting so new code can be held to higher standards without first fixing the entire existing codebase.

Changes:

  • Adds a strict golangci-lint overlay enabling forcetypeassert.
  • Adds Makefile targets for merged strict config generation and strict/new lint checks.
  • Splits CI linting into dedicated parallel jobs using golangci-lint-action.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 6 comments.

File Description
GNUmakefile Adds generated merged lint config target plus strict/new lint targets.
.golangci.strict.yml Defines stricter lint rules for new code.
.gitignore Ignores the generated merged golangci-lint config.
.github/workflows/ci.yaml Moves linting into separate CI jobs and updates aggregate checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yaml
Comment thread .github/workflows/ci.yaml Outdated
Comment thread GNUmakefile
Comment thread GNUmakefile
Comment thread .github/workflows/ci.yaml Outdated
Comment thread .github/workflows/ci.yaml Outdated
Comment thread .github/workflows/ci.yaml Outdated
deiga and others added 6 commits May 15, 2026 22:08
…ion` to add inline annotations to PRs

Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
@deiga deiga force-pushed the introduce-strict-linter-for-new-code branch from 675d173 to fad1dc5 Compare May 15, 2026 19:09
@deiga deiga requested a review from stevehipwell May 15, 2026 19:09
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
stevehipwell
stevehipwell previously approved these changes May 15, 2026
Copy link
Copy Markdown
Collaborator

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.

Comment thread .github/workflows/ci.yaml
Comment thread GNUmakefile
Comment thread GNUmakefile Outdated
Comment thread GNUmakefile
Comment thread .github/workflows/ci.yaml
deiga added 2 commits May 16, 2026 11:20
There is no need to run `lint-new` on main

Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
@deiga
Copy link
Copy Markdown
Collaborator Author

deiga commented May 16, 2026

@stevehipwell addressed Copilot comments

@robert-crandall could you please review this PR? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants