Skip to content

Conversation

@jbardin
Copy link
Member

@jbardin jbardin commented Aug 31, 2021

Add staticcheck -checks 'all,-ST*' to the CI config.

This tool was used extensively during refactoring, and has proven to be quite useful for catching common mistakes.
While we skip the stylistic checks here for now, we can work towards those too (or at least a subset of those, since we intentionally break some conventions like error string format).

@jbardin jbardin requested a review from a team August 31, 2021 22:02
@jbardin jbardin force-pushed the jbardin/staticcheck branch from d37208e to 1ae87f5 Compare August 31, 2021 22:08
echo "==> Checking that code complies with static analysis requirements..."
# The legacy code is frozen, and should not be updated. It will be removed once
# we can refactor the remote backends to no longer require it.
skip="internal/legacy|backend/remote-state/|internal/planproto|internal/tfplugin"
Copy link
Contributor

Choose a reason for hiding this comment

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

The above comment reads as if internal/planproto and internal/tfplugin fit in the category of "legacy code that will be removed", but I assume that isn't what you intended. To minimize confusion for future contributors, can we say something about excluding generated code in that comment too?

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, that was updated from the old commit, but the comment is out of date. I'll re-word

Copy link
Contributor

Choose a reason for hiding this comment

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

It might also be clearer to write out tfplugin5 and tfplugin6 separately here so that we can see exactly which packages are being excluded. 🤔

@jbardin jbardin force-pushed the jbardin/staticcheck branch from 1ae87f5 to 8e6860c Compare August 31, 2021 22:43
@jbardin jbardin force-pushed the jbardin/staticcheck branch from 8e6860c to 863963e Compare September 1, 2021 15:36
@jbardin jbardin merged commit 05f21cd into main Sep 1, 2021
@jbardin jbardin deleted the jbardin/staticcheck branch September 1, 2021 15:44
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2021

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants