Skip to content

Commit b564ded

Browse files
committed
Format code with gofmt
1 parent 2b0bc44 commit b564ded

20 files changed

+40
-80
lines changed

internal/analyzer/analyzer.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ func (a *Analyzer) Analyze(dockerfile *ast.Dockerfile) []ast.Finding {
7878
return allFindings
7979
}
8080

81-
8281
// isIgnoredByInlineComment checks if a finding should be ignored based on inline comments.
8382
// Inline ignore comments apply to the line immediately following the comment.
8483
func (a *Analyzer) isIgnoredByInlineComment(dockerfile *ast.Dockerfile, finding ast.Finding) bool {

internal/analyzer/analyzer_property_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,6 @@ func genNonEmptyIgnoreRules() gopter.Gen {
722722
}, reflect.TypeOf([]string{}))
723723
}
724724

725-
726725
// **Feature: docker-lint, Property 4: Inline Ignore Effectiveness**
727726
// **Validates: Requirements 8.3**
728727
//

internal/analyzer/analyzer_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ RUN apt-get update
6363
}
6464
}
6565

66-
6766
func TestAnalyzer_Analyze_InlineIgnore(t *testing.T) {
6867
// Dockerfile with inline ignore comment
6968
dockerfile := `# docker-lint ignore: DL3006

internal/ast/ast.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ func (s Severity) String() string {
4747
}
4848
}
4949

50-
5150
// Finding represents a lint finding from rule analysis.
5251
type Finding struct {
5352
RuleID string
@@ -81,9 +80,9 @@ type Stage struct {
8180

8281
// Dockerfile represents a parsed Dockerfile.
8382
type Dockerfile struct {
84-
Stages []Stage
85-
Instructions []Instruction
86-
Comments []Comment
83+
Stages []Stage
84+
Instructions []Instruction
85+
Comments []Comment
8786
InlineIgnores map[int][]string // line -> rule IDs to ignore
8887
}
8988

@@ -102,7 +101,6 @@ func (f *FromInstruction) Line() int { return f.LineNum }
102101
func (f *FromInstruction) Raw() string { return f.RawText }
103102
func (f *FromInstruction) Type() InstructionType { return InstrFROM }
104103

105-
106104
// RunInstruction represents a RUN instruction.
107105
type RunInstruction struct {
108106
LineNum int
@@ -166,7 +164,6 @@ func (a *ArgInstruction) Line() int { return a.LineNum }
166164
func (a *ArgInstruction) Raw() string { return a.RawText }
167165
func (a *ArgInstruction) Type() InstructionType { return InstrARG }
168166

169-
170167
// ExposeInstruction represents an EXPOSE instruction.
171168
type ExposeInstruction struct {
172169
LineNum int
@@ -223,7 +220,6 @@ func (v *VolumeInstruction) Line() int { return v.LineNum }
223220
func (v *VolumeInstruction) Raw() string { return v.RawText }
224221
func (v *VolumeInstruction) Type() InstructionType { return InstrVOLUME }
225222

226-
227223
// CmdInstruction represents a CMD instruction.
228224
type CmdInstruction struct {
229225
LineNum int

internal/ast/ast_test.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ func TestFindingCreation(t *testing.T) {
4444

4545
func TestFromInstructionMethods(t *testing.T) {
4646
instr := &FromInstruction{
47-
LineNum: 1,
48-
RawText: "FROM alpine:3.18 AS builder",
49-
Image: "alpine",
50-
Tag: "3.18",
51-
Alias: "builder",
47+
LineNum: 1,
48+
RawText: "FROM alpine:3.18 AS builder",
49+
Image: "alpine",
50+
Tag: "3.18",
51+
Alias: "builder",
5252
}
5353

5454
if instr.Line() != 1 {
@@ -62,7 +62,6 @@ func TestFromInstructionMethods(t *testing.T) {
6262
}
6363
}
6464

65-
6665
func TestRunInstructionMethods(t *testing.T) {
6766
instr := &RunInstruction{
6867
LineNum: 5,
@@ -147,7 +146,6 @@ func TestArgInstructionMethods(t *testing.T) {
147146
}
148147
}
149148

150-
151149
func TestExposeInstructionMethods(t *testing.T) {
152150
instr := &ExposeInstruction{
153151
LineNum: 8,
@@ -256,7 +254,6 @@ func TestEntrypointInstructionMethods(t *testing.T) {
256254
}
257255
}
258256

259-
260257
func TestHealthcheckInstructionMethods(t *testing.T) {
261258
instr := &HealthcheckInstruction{
262259
LineNum: 18,

internal/formatter/formatter_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ func TestTextFormatter_Format(t *testing.T) {
136136
}
137137
}
138138

139-
140139
func TestJSONFormatter_Format(t *testing.T) {
141140
tests := []struct {
142141
name string

internal/formatter/json.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ func NewJSONFormatter(filename string, quiet bool) *JSONFormatter {
4848
}
4949
}
5050

51-
5251
// Format writes the findings to the given writer as valid JSON.
5352
func (f *JSONFormatter) Format(findings []ast.Finding, w io.Writer) error {
5453
output := JSONOutput{

internal/parser/formatter.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ func formatInstruction(instr ast.Instruction) string {
7171
}
7272
}
7373

74-
7574
// formatFrom formats a FROM instruction.
7675
func formatFrom(f *ast.FromInstruction) string {
7776
var parts []string
@@ -185,7 +184,6 @@ func formatUser(u *ast.UserInstruction) string {
185184
return "USER " + u.User
186185
}
187186

188-
189187
// formatLabel formats a LABEL instruction.
190188
func formatLabel(l *ast.LabelInstruction) string {
191189
if len(l.Labels) == 0 {

internal/parser/formatter_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ func TestFormatFromInstruction(t *testing.T) {
6565
}
6666
}
6767

68-
6968
func TestFormatRunInstruction(t *testing.T) {
7069
tests := []struct {
7170
name string
@@ -211,7 +210,6 @@ func TestFormatHealthcheckInstruction(t *testing.T) {
211210
}
212211
}
213212

214-
215213
func TestFormatFullDockerfile(t *testing.T) {
216214
df := &ast.Dockerfile{
217215
Instructions: []ast.Instruction{

internal/parser/lexer.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ func (l *Lexer) scanToken() Token {
163163
return Token{Type: TokenArgument, Value: arg, Line: l.line, Column: startCol}
164164
}
165165

166-
167166
// readNextLine reads the next line from the input, handling line continuations.
168167
func (l *Lexer) readNextLine() bool {
169168
var fullLine strings.Builder
@@ -314,7 +313,6 @@ func (l *Lexer) scanArgument() string {
314313
return strings.TrimSpace(result.String())
315314
}
316315

317-
318316
// Reset resets the lexer to read from a new reader.
319317
func (l *Lexer) Reset(r io.Reader) {
320318
l.reader = bufio.NewReader(r)

0 commit comments

Comments
 (0)