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

Running both lint and tidy #38

Open
aktasfatih opened this issue Oct 25, 2022 · 6 comments
Open

Running both lint and tidy #38

aktasfatih opened this issue Oct 25, 2022 · 6 comments

Comments

@aktasfatih
Copy link

aktasfatih commented Oct 25, 2022

Hi, is there a subcommand to run both lint and tidy in one command ?

@autarch
Copy link
Member

autarch commented Oct 25, 2022

No, there's not. Are you imagining it would run tidy first, then lint? I think that's not too hard to add.

@aktasfatih
Copy link
Author

aktasfatih commented Oct 25, 2022

Yes, that is what I had in my mind. Anything that runs both when one of lint or tidy is not specified, or an extra command like clean that could do the job. I could create a PR if you like, depending on your preference.

@autarch
Copy link
Member

autarch commented Oct 25, 2022

I don't think I'd want this to be the default behavior, but a new subcommand called clean would work. I'm not sure about the name, but that's easy enough to change before this is released.

If you're up for a it, a PR would be great!

I'm in the middle of some big changes to this code, but I think you should only need to change the precious-core/src/precious.rs file for a PR to add this, as well as the README.md and adding some integration tests in precious-integration. I'm pretty sure that won't have any significant conflicts with what I'm working on. If there are conflicts I can figure them out.

But just take this as a heads up that it might take me a little longer to review and merge this PR than it otherwise might.

@aktasfatih
Copy link
Author

aktasfatih commented Oct 25, 2022

No worries. It is not urgent. Thanks for the quick reply and the heads up. 👍 I'll get on it.

@oschwald
Copy link

I agree that this would be a nice feature to have.

For most programs that have a tidy/fix option (e.g., golangci-lint, black, etc.), I think it would be sufficient to only run tidy when the command can do both. I assume there are cases where this is not true, but it would be nice to avoid the extra lint run where it is true.

@autarch
Copy link
Member

autarch commented Oct 26, 2022

That's a good point, @oschwald. Some sort of config key for this would be good, like no_lint_on_both or something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants