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

run specific tasks on staged files only #31

Open
waleedf112 opened this issue Apr 27, 2024 · 2 comments
Open

run specific tasks on staged files only #31

waleedf112 opened this issue Apr 27, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@waleedf112
Copy link

waleedf112 commented Apr 27, 2024

I would like to run the analyze and custom-lint tasks only on staged files, is there a way I could achieve that?
I have some changes on some files that I'm not trying to commit yet, therefore, I'm not able to commit one file that would actually pass the dart analyzer.

the tool should not prevent me from committing a file because other unstaged files have some issues with the analyze task.

thank you.

@Skycoder42
Copy link
Owner

In theory, this could be archived by running the analyzer on every single file instead of the whole repository. I have not done this so far, as this would slow down the tool quite a bit. It would also mean that you will not see analysis results for the unstaged files.

Another option would be to scan all files and output all results, but only fail if a staged file is in the output. This a more complex solution, as the analyzer das not support machine readable output, but it is theoretically possible.

Would the first solution be enough for you, or would you prefer the second?

@Skycoder42 Skycoder42 self-assigned this May 8, 2024
@Skycoder42 Skycoder42 added the enhancement New feature or request label May 8, 2024
@waleedf112
Copy link
Author

In theory, this could be archived by running the analyzer on every single file instead of the whole repository. I have not done this so far, as this would slow down the tool quite a bit. It would also mean that you will not see analysis results for the unstaged files.

Another option would be to scan all files and output all results, but only fail if a staged file is in the output. This a more complex solution, as the analyzer das not support machine readable output, but it is theoretically possible.

Would the first solution be enough for you, or would you prefer the second?

both works, the second is more "optimal", I will try to find a way to do it and open a pull request.

@Skycoder42 Skycoder42 assigned waleedf112 and unassigned Skycoder42 May 13, 2024
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