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

Change inline configuration format #21

Merged
merged 6 commits into from
Feb 1, 2021
Merged

Change inline configuration format #21

merged 6 commits into from
Feb 1, 2021

Conversation

fregante
Copy link
Owner

@fregante fregante commented Feb 1, 2021

Prepare for #9

- # DO NOT EDIT BLOW, USE: npx ghat fregante/ghatemplates/node --exclude jobs.Test
+ # FILE GENERATED WITH: npx ghat
+ # SOURCE: https://github.com/fregante/ghatemplates
+ # OPTIONS: {"source":"fregante/ghatemplates/node","exclude":["jobs.Test"]}

Advantages:

  • The command to run is now just npx ghat
  • There's a full repo URL (clickable for RGH users)
  • No cross-platform issues when creating/parsing argv from a string

Disadvantages:

  • A bit longer
  • Can no longer be copy-pasted as a whole across repositories 😕

URL isn't safely (re-)constructable, so it's best to preserve the `source` as is.
Now the third line appears only if options were passed
@fregante
Copy link
Owner Author

fregante commented Feb 1, 2021

Change:

- # FILE GENERATED WITH: npx ghat
+ # FILE GENERATED WITH: npx ghat fregante/ghatemplates/node
  # SOURCE: https://github.com/fregante/ghatemplates
- # OPTIONS: {"source":"fregante/ghatemplates/node","exclude":["jobs.Test"]}
+ # OPTIONS: {"exclude":["jobs.Test"]}

Advantages over the previous version:

  • It can still be partially copy-pasted across repositories
  • The OPTIONS line only appears if there were options passed

@fregante fregante merged commit fef4ede into main Feb 1, 2021
@fregante fregante deleted the format branch February 1, 2021 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant