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

Actionlint: correctly parse error line when using shellcheck sublinter #4689

Merged
merged 1 commit into from
Jan 14, 2024

Conversation

pixelastic
Copy link
Contributor

@pixelastic pixelastic commented Dec 19, 2023

actionlint is a linter for GitHub Actions workflows. It includes the shellcheck linter, for linting run: commands inside of GA workflows.

The current Ale implementation was getting confused when parsing the line such an error occurred; it used the line returned by shellcheck (most commonly line 1 as run: entries are usually one-liners), instead of the line of the parent .yml file.

This PR addresses that, by adding a branching path when parsing the linting results. If it is identified as a shellcheck linting issue, it will further parse the output to extract the correct shellcheck error message and error code, but keep the parent .yml line.

This now correctly attributes the error to the line it appears. It sets the column to the beginning of the run: key, not to the exact column where the error appears in the value. This could probably be added with a bit of math, but I wanted to keep the PR simple for now.

Copy link
Contributor

@hsanson hsanson left a comment

Choose a reason for hiding this comment

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

Thanks.

@hsanson hsanson merged commit 17cca24 into dense-analysis:master Jan 14, 2024
7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants