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

Linting changed files #246

Open
skr-survesy opened this issue Oct 10, 2024 · 2 comments
Open

Linting changed files #246

skr-survesy opened this issue Oct 10, 2024 · 2 comments

Comments

@skr-survesy
Copy link

When working with Atlas' linting in CI, the linter seems to run against all of the migrations inside of the directory, regardless of which migrations were created inside of the pull request. It seems like --git-base in the CLI command atlas migrate lint would do the trick, but it isn't being exposed through the action.

I'm finding the main problem from the lint action is that it is creating too much noise on PRs from old migration check issues, and if you have one bad migration from an old code change, then it will result in a failed check on the PR which can break some workflows.

@skr-survesy
Copy link
Author

Have found a temporary workaround by using the -- atlas:nolint directive on existing migration files. Is there any downsides to this?

@winterrobert
Copy link

I'm also wondering about this; I've tried fixing this in my atlas.hcl:

lint {
  latest = 1
}

But when I set this, ariga/atlas-action/migrate/lint throws the following in my workflow:

Error: Error: --latest, --git-base, and --base are mutually exclusive

Is there a way to just lint the files that are part of the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants