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 from stdin does not cover everything #283

Closed
sblask opened this issue Mar 14, 2023 · 1 comment
Closed

Linting from stdin does not cover everything #283

sblask opened this issue Mar 14, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@sblask
Copy link

sblask commented Mar 14, 2023

I run actionlint through null-ls in vim and was wondering why I can't see all the findings I get on the command line. After going through the code I figured it seems to be a problem with actionlint and not the integration in vim. When I run

actionlint -format "{{ json .}}" .github/workflows/push-to-main.yml

I get a bunch of findings:

[
    {
        "column": 7,
        "end_column": 16,
        "filepath": ".github/workflows/push-to-main.yml",
        "kind": "workflow-call",
        "line": 67,
        "message": "input \"image_tag\" is not defined in \"./.github/workflows/integration-tests.yml\" reusable workflow. defined inputs are \"folder_name\", \"slack_channel\"",
        "snippet": "      image_tag: ${{ needs.docker-build.outputs.image_tag }}\n      ^~~~~~~~~~"
    },
,
...

But when I run:

actionlint -format "{{ json .}}" -stdin-filename .github/workflows/push-to-main.yml - < .github/workflows/push-to-main.yml

I get: []. Presumably linting from stdin does the linting for the file in isolation. It would be better though if the linting would happen in the context of all the workflows in the directory. Especially when provided with a filename: -stdin-filename .github/workflows/push-to-main.yml Not sure what else -stdin-filename would be for if not that.

Version information:

$ actionlint -version
1.6.23
installed by downloading from release page
built with go1.19.4 compiler for darwin/arm64
@rhysd rhysd added the bug Something isn't working label Jun 7, 2023
@rhysd
Copy link
Owner

rhysd commented Jun 7, 2023

Since -stdin-filename assumes file name, not file path, currently actionlint does not use the argument to find the Git project directory. But it would be useful to find a Git project from the argument for some integrations like editor plugins.

@rhysd rhysd added enhancement New feature or request and removed bug Something isn't working labels Jun 7, 2023
@rhysd rhysd closed this as completed in dc20f07 Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants