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

golangci-lint check results against v0.5.0 #76

Closed
atc0005 opened this issue Oct 24, 2019 · 2 comments
Closed

golangci-lint check results against v0.5.0 #76

atc0005 opened this issue Oct 24, 2019 · 2 comments
Assignees
Labels
bug Something isn't working config
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Oct 24, 2019

$ golangci-lint run
matches.go:173:23: func `FileMatches.sortByModTimeDesc` is unused (unused)
func (fm FileMatches) sortByModTimeDesc() {
                      ^
config.go:42:26: SA5008: duplicate struct tag "arg" (staticcheck)
        NumFilesToKeep int      `arg:"--keep,env:ELBOW_KEEP" arg:"required" help:"Keep specified number of matching files per provided path."`
                                ^
config.go:51:27: SA5008: duplicate struct tag "arg" (staticcheck)
        Paths           []string `arg:"--paths,env:ELBOW_PATHS" arg:"required" help:"List of comma or space-separated paths to process."`
                                 ^

Need to take a closer look at the struct tags to make sure I've defined them properly.

@atc0005 atc0005 added bug Something isn't working config labels Oct 24, 2019
@atc0005 atc0005 added this to the v0.5.1 milestone Oct 24, 2019
@atc0005 atc0005 self-assigned this Oct 24, 2019
atc0005 added a commit that referenced this issue Oct 24, 2019
I unintentionally duplicated the `arg` tag in an effort to
mark specific fields/options as required. This commit
combines the `required` constraint with the existing
`arg` struct tag.

Credit: golangci-lint

refs #76
@atc0005
Copy link
Owner Author

atc0005 commented Oct 24, 2019

$ golangci-lint run
matches.go:173:23: func `FileMatches.sortByModTimeDesc` is unused (unused)
func (fm FileMatches) sortByModTimeDesc() {

After #83, this is the remaining item. Since this is intended as a potential future library function, I assume that breaking out the go files into separate packages (where it makes sense) is how to resolve this?

For example, matches.go should probably go into a matches package, paths.go into a paths package and so on.

atc0005 added a commit that referenced this issue Oct 24, 2019
This is inspired by #76, but also because I've known for
a while that this might eventually be needed. I'm hoping
to better isolate code from the main package in the
hope/belief that this will make setting up future tests
easier and more reliable.

As part of this work, the majority of the existing utility
functions had to be renamed to export them for use elsewhere
and a few functions had to be updated to accept a Config
object in order to receive application-wide settings. This
Config object also (now) bundles a `*logrus.Logger` for
shared use across the application.

I don't know Golang well enough at this point to know
whether this is a terrible idea. If you're reading this
and *you* know the answer, please reach out and share.

refs #87, #76
atc0005 added a commit that referenced this issue Oct 24, 2019
This is inspired by #76, but also because I've known for
a while that this might eventually be needed. I'm hoping
to better isolate code from the main package in the
hope/belief that this will make setting up future tests
easier and more reliable.

As part of this work, the majority of the existing utility
functions had to be renamed to export them for use elsewhere
and a few functions had to be updated to accept a Config
object in order to receive application-wide settings. This
Config object also (now) bundles a `*logrus.Logger` for
shared use across the application.

I don't know Golang well enough at this point to know
whether this is a terrible idea. If you're reading this
and *you* know the answer, please reach out and share.

refs #87, #76
atc0005 added a commit that referenced this issue Oct 24, 2019
This is inspired by #76, but also because I've known for
a while that this might eventually be needed. I'm hoping
to better isolate code from the main package in the
hope/belief that this will make setting up future tests
easier and more reliable.

As part of this work, the majority of the existing utility
functions had to be renamed to export them for use elsewhere
and a few functions had to be updated to accept a Config
object in order to receive application-wide settings. This
Config object also (now) bundles a `*logrus.Logger` for
shared use across the application.

I don't know Golang well enough at this point to know
whether this is a terrible idea. If you're reading this
and *you* know the answer, please reach out and share.

refs #87, #76
@atc0005
Copy link
Owner Author

atc0005 commented Oct 24, 2019

After #83, this is the remaining item. Since this is intended as a potential future library function, I assume that breaking out the go files into separate packages (where it makes sense) is how to resolve this?

For example, matches.go should probably go into a matches package, paths.go into a paths package and so on.

This is fixed per #88.

@atc0005 atc0005 closed this as completed Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working config
Projects
None yet
Development

No branches or pull requests

1 participant