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

Create stub config files #53

Closed
oalders opened this issue Sep 22, 2023 · 4 comments
Closed

Create stub config files #53

oalders opened this issue Sep 22, 2023 · 4 comments

Comments

@oalders
Copy link
Contributor

oalders commented Sep 22, 2023

As a wishlist item, it would be cool to have precious config --create to create a stub config file, maybe including some defaults for various languages.

precious config --create --lang go --lang bash precious.toml

I added something like this to perlimports and I use it all the time:

perlimports --create-config-file perlimports.toml

This is somewhat related to #3

@autarch
Copy link
Member

autarch commented Oct 15, 2023

I have a first pass at this in the config-init branch that handles the following components:

  • Go
  • Rust
  • Perl
  • .gitignore files
  • Markdown
  • YAML

If you have any suggestions for config for other languages I can include those too, but I haven't really used precious with anything else yet.

@oalders
Copy link
Contributor Author

oalders commented Oct 21, 2023

The branch looks great! I tried it out and I love that it creates dev/bin/check-go-mod.sh for you. I would be able to use that right away.

For Perl, I would suggest adding:

[commands.perlimports]
type = "both"
include = [ "**/*.{pl,pm,t,psgi}" ]
cmd = [ "perlimports" ]
lint_flags = ["--lint" ]
tidy_flags = ["-i" ]
ok_exit_codes = 0
expect_stderr = true

It might also be helpful if you could specify a different config file path rather than the default, so that you could create one in your home directory or with a .precious.toml. I'm testing this out in the top level of the repo and I had to blow away the original config file to test this. Not a big deal, though. I'd file that under "nice to have".

@autarch
Copy link
Member

autarch commented Oct 29, 2023

This is done in v0.6.0.

@autarch autarch closed this as completed Oct 29, 2023
@oalders
Copy link
Contributor Author

oalders commented Oct 30, 2023

Thank you!

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

2 participants