Enable more linters#307
Draft
obbardc wants to merge 13 commits into
Draft
Conversation
obbardc
commented
May 2, 2026
obbardc
commented
May 3, 2026
This comment was marked as resolved.
This comment was marked as resolved.
Enable ineffassign, unused, unconvert, bodyclose, copyloopvar, nilerr, nilnil, wastedassign, maintidx, nakedret and predeclared linters. No code changes are required as the codebase already satisfies these linters. Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
d75dec7 to
52763ea
Compare
Remove the comments exclusion preset so revive enforces package-level and exported-identifier documentation. Fixes: #304 Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Extract applyMachineOptions from main, flatten GetDeterminedVersion with early returns and simplify checkStreamsMatch to use io.ReadAll. Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Extract writeCLibraries, writeCoreDirectories, writeMergedUsrPaths, writeSystemdServices, writeExtraContent and fillInitrd helpers to reduce cyclomatic complexity below the configured maximum of 10. Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
52763ea to
af0e5e3
Compare
This comment was marked as resolved.
This comment was marked as resolved.
obbardc
commented
May 15, 2026
|
|
||
| // Puts in a format that is compatible with output of os.Environ() | ||
| EnvironString := []string{} | ||
| EnvironString := make([]string, 0, len(EnvironVars)) |
Member
Author
There was a problem hiding this comment.
is prealloc really a useful linter ?
obbardc
commented
May 15, 2026
| @@ -1,3 +1,4 @@ | |||
| // Package main is the entry point for the fakemachine command-line tool. | |||
Member
Author
There was a problem hiding this comment.
Rework these comments to better describe the functions.
Member
Author
|
@sjoerdsimons ready for a first review on this to check shape etc. See my existing comments. I don't think there's gonna be a huge deal left for me to work out here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.