-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
Add lint job to CI #477
Add lint job to CI #477
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #477 +/- ##
==========================================
+ Coverage 78.78% 78.94% +0.16%
==========================================
Files 13 13
Lines 4007 3995 -12
==========================================
- Hits 3157 3154 -3
+ Misses 591 582 -9
Partials 259 259 |
@@ -476,15 +476,6 @@ func (d *Decoder) getArrayNode(node ast.Node) (ast.ArrayNode, error) { | |||
return arrayNode, nil | |||
} | |||
|
|||
func (d *Decoder) fileToNode(f *ast.File) ast.Node { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused
@@ -1623,13 +1614,13 @@ func (d *Decoder) readersUnderDir(dir string) ([]io.Reader, error) { | |||
|
|||
func (d *Decoder) readersUnderDirRecursive(dir string) ([]io.Reader, error) { | |||
readers := []io.Reader{} | |||
if err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check the err here? 🤔
if !d.isYAMLFile(path) { | ||
return nil | ||
} | ||
reader, err := d.fileToReader(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shadows the outer err variable.
@@ -2152,16 +2152,16 @@ func Example_DisallowUnknownField() { | |||
|
|||
const src = `--- | |||
simple: string | |||
complecated: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
misspell
keeps trying to fix it so I renamed it
@@ -110,13 +110,6 @@ func (c *context) nextToken() *token.Token { | |||
return c.tokens[c.idx+1] | |||
} | |||
|
|||
func (c *context) afterNextToken() *token.Token { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused
@@ -470,7 +470,6 @@ func (s *Scanner) scanComment(ctx *Context) (tk *token.Token, pos int) { | |||
ctx.addOriginBuf('#') | |||
ctx.progress(1) // skip '#' character | |||
for idx, c := range ctx.src[ctx.idx:] { | |||
pos = idx + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original assignment to the pos is unnecessary since it should be overwritten eventually below
@@ -588,7 +587,6 @@ func (s *Scanner) scanLiteralHeader(ctx *Context) (pos int, err error) { | |||
ctx.literalOpt = opt | |||
return | |||
} | |||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This "break" is unnecessary because it's at the end of the switch statement. I wonder if it was actually meant to be placed below to break out of the for loop 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
SSIA. I believe it would be great if we have basic linters running in the CI.
Before submitting your PR, please confirm the following.