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

Add Lint Controls #4962

Merged
merged 1 commit into from
May 31, 2024
Merged

Add Lint Controls #4962

merged 1 commit into from
May 31, 2024

Conversation

daghack
Copy link
Collaborator

@daghack daghack commented May 28, 2024

Implements most of #4919 (the check-skip directive for skipping a specific is omitted as follow up work in a forthcoming PR)

@daghack daghack marked this pull request as draft May 28, 2024 20:54
@daghack daghack self-assigned this May 28, 2024
@thompson-shaun thompson-shaun added this to the v0.14.0 milestone May 28, 2024
@daghack daghack force-pushed the lint-skip branch 4 times, most recently from 7df288f to 75d1f1f Compare May 29, 2024 21:37
frontend/dockerfile/builder/build.go Outdated Show resolved Hide resolved
frontend/dockerfile/builder/build.go Outdated Show resolved Hide resolved
frontend/dockerfile/builder/build.go Outdated Show resolved Hide resolved
frontend/dockerfile/dockerfile_lint_test.go Outdated Show resolved Hide resolved
frontend/dockerfile/linter/linter.go Outdated Show resolved Hide resolved
@@ -13,12 +13,14 @@ import (

const (
keySyntax = "syntax"
keyCheck = "check"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colinhemmings I'm not sure if "check" works in here.

#syntax=docker/dockerfile
#check=skip=StageNameCasing

FROM alpine

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a comment on the proposal related that rule would be a better term to use here

frontend/dockerfile/parser/directives.go Outdated Show resolved Hide resolved
frontend/dockerfile/linter/linter.go Outdated Show resolved Hide resolved
frontend/dockerfile/linter/linter.go Outdated Show resolved Hide resolved
@daghack daghack force-pushed the lint-skip branch 15 times, most recently from 3ddfca2 to 4216f7c Compare May 30, 2024 16:34
@thompson-shaun thompson-shaun linked an issue May 30, 2024 that may be closed by this pull request
@daghack daghack force-pushed the lint-skip branch 2 times, most recently from 7f1f006 to 86eb9be Compare May 30, 2024 18:39
@daghack daghack force-pushed the lint-skip branch 7 times, most recently from 3e4e01b to 6f2e67d Compare May 31, 2024 00:04
frontend/dockerfile/dockerfile2llb/convert.go Outdated Show resolved Hide resolved
frontend/dockerfile/dockerfile2llb/convert.go Outdated Show resolved Hide resolved
frontend/dockerfile/parser/directives.go Outdated Show resolved Hide resolved
frontend/dockerfile/dockerfile2llb/convert.go Outdated Show resolved Hide resolved
@daghack daghack force-pushed the lint-skip branch 2 times, most recently from 30807ff to 0a29cdf Compare May 31, 2024 04:46
frontend/dockerui/config.go Outdated Show resolved Hide resolved
@@ -162,6 +162,67 @@ func ListTargets(ctx context.Context, dt []byte) (*targets.List, error) {
return l, nil
}

func parseLintOptions(checkStr string) (*linter.Config, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In future I think this can be moved to public function in linter pkg (and called both from here in dockerui) but that can be changed in some follow-up PR.

@daghack daghack force-pushed the lint-skip branch 3 times, most recently from be11de7 to 593dc8e Compare May 31, 2024 16:21
Signed-off-by: Talon Bowler <talon.bowler@docker.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: lint disable controls
5 participants