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

Modify the behavior of affected:lint script #3890

Closed
gagle opened this issue Oct 8, 2020 · 4 comments
Closed

Modify the behavior of affected:lint script #3890

gagle opened this issue Oct 8, 2020 · 4 comments

Comments

@gagle
Copy link

gagle commented Oct 8, 2020

Could someone clarify the use case for the affected:lint script? What we tipically want to achieve in the CI pipeline is to lint only files that have been changed or added, but with this script all the affected apps/libs will be relinted. By using the cache we avoid relinting but I don't understand the motivation to create the affected:lint script the way it is now.

If I change code inside a lib, why do I need to lint also the app that depends on it? I should only relint the lib. The "affected graph" for this specific linting case shouldn't propagate to other libs/apps. If I want to still narrow the linting scope and only relint files that have been added/modified then this is out of the scope of Nx, but the first part is something that Nx could improve.

@statyan
Copy link

statyan commented Oct 20, 2020

I agree, current implementation of affected:lint makes small sense. I understand why it was done so - they created a generic way to detect affected projects and then simply run any passed command against the list. But for lint valid behavior would be to get the list of affected files, not projects. And run lint only for the changed files. Assuming code was linted from the project start we need to run lint only in PR build.
In our project we created a simple script to get the changed files from git and run tslint against each of them.

@github-actions
Copy link

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

@GrumpyMeow
Copy link

I also see the same behaviour. Unfortunately i'm unable to change this behaviour using targetDefaults.

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants