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

[bug] AffectedPassInputs does not work when inputs are missing #1732

Open
dudicoco opened this issue Nov 24, 2024 · 3 comments
Open

[bug] AffectedPassInputs does not work when inputs are missing #1732

dudicoco opened this issue Nov 24, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@dudicoco
Copy link

Describe the bug

When configuring a task with affectedPassInputs: true, if the inputs are missing the dir will be passed as an arg to the command.

Steps to reproduce

Define the following task:

  format:
    command: echo
    inputs:
    - '*.sh'
    options:
      affectedFiles: true
      affectedPassInputs: true

If no sh files exist the task will echo ..

Expected behavior

If we pass an empty string the formatter/linter might fail.
Perhaps the task command should be skipped in this case?

@dudicoco dudicoco added the bug Something isn't working label Nov 24, 2024
@milesj
Copy link
Collaborator

milesj commented Nov 24, 2024

@dudicoco The task can't be skipped this late into the process.

If we have no files, we just default to . since the command typically expects something.

@dudicoco
Copy link
Author

The problem is that . doesn't take into account exclusions.
For example if I have the following inputs:

inputs:
- '*.sh'
- '!foo.sh'

@milesj
Copy link
Collaborator

milesj commented Nov 29, 2024

I'm not sure what the solution is here because some commands error if no argument is provided (eslint, etc), so we pass the . for those use cases. But it doesn't work for other commands...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants