chore: fix string formatting and ST1005 linter warning in file permission errors
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 92/100
Research direction
Start with pkg/config/file_permission_unix.go:30 and pkg/config/file_permission_windows.go:30, where getFilePermission() constructs the error. Run staticcheck ./... to confirm the ST1005 warnings. Done means the invalid-permission message has the expected spacing, no trailing punctuation, and staticcheck passes.
Written by the indexing model from the issue text.
Description
Describe the bug
In pkg/config/file_permission_unix.go and pkg/config/file_permission_windows.go, the error returned by getFilePermission() is split across two concatenated string literals:
return fmt.Errorf("config file has incorrect permission flags:%s."+
"change the file permission either to 0400 or 0600.", fi.Mode().Perm().S
Two small issues with this:
- Missing spaces in the string: there is no space after the colon (flags:%s), and no space between the period and "change" (.change), causing words to run together in terminal output.
- Trailing punctuation: ending the error message with a period triggers a staticcheck warning (ST1005: error strings should not end with punctuation or newlines).
Expected behavior
The error message should have clean spacing and omit trailing punctuation to follow Go conventions:
config file has incorrect permission flags: %s, change the file permission either to 0400 or 0600
Actual behavior
When an invalid file mode is encountered, the output text runs together:
config file has incorrect permission flags:-rw-r--r--.change the file permission either to 0400 or 0600.
And staticcheck reports:
pkg/config/file_permission_unix.go:30:9: error strings should not end with punctuation or newlines (ST1005)
How to Reproduce?
- Inspect pkg/config/file_permission_unix.go:30 or pkg/config/file_permission_windows.go:30.
- Run staticcheck ./... locally.
- Observe the ST1005 warning.
Microcks version or git rev
main (Latest)
Install method (docker-compose, helm chart, operator, docker-desktop extension,...)
CLI
Additional information
Minor cleanup to fix terminal output formatting and ensure clean staticcheck runs.
cc @Harsh4902
- Dominant language
- Go
- Stars
- 52
- Forks
- 67
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 13
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microcks/microcks-cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
microcks/microcks-cli#536 · 1 comment ·
-
component/cli keep-open kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
microcks/microcks-cli#534 · 2 comments · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microcks/microcks-cli#511 ·
-
component/cli kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
microcks/microcks-cli#503 · 4 comments ·
-
stale
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microcks/microcks-cli#483 · 3 comments ·
All issues in microcks/microcks-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
kind/bug needs-triage
Difficulty 1/5 Under an hour Newbie friendliness 72/100
matrixorigin/matrixone#29223 ·
-
needs-acceptance wg/data-plane-networking
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/semantic-router#4024 · 1 comment ·