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

Write a formatter utility #4310

Open
7 tasks
FichteFoll opened this issue Apr 12, 2015 · 6 comments
Open
7 tasks

Write a formatter utility #4310

FichteFoll opened this issue Apr 12, 2015 · 6 comments

Comments

@FichteFoll
Copy link
Collaborator

The formatter should:

  • Unify labels and translate them to lower case (Clean up labels a bit and see if contributions here are welcome. #4277)
  • Unify repository urls and remove trailing slahes for example
  • Remove redundant keys that would be equivalent to what PC finds from details, notably readme, author, base
  • Remove redundant keys that specify the general default value, notably platforms (also "platforms": ["windows", "linux", "osx"])
  • Unify whitespace usage. I'm thinking of what example-repository.json uses, which is:
    • Block style by default, that means a new line for each value
    • Inline style (in same line) for labels, author and platforms keys
    • The same indentation/whitespace style (I don't think I need to explain this)
    • No trailing whitespaces
    • Newline at EOF
  • -(Optional) Add a name key for github repos if none present? We could make this a soft requirement in the process.
  • Transform all platforms values into a list?

More?

@joshgoebel
Copy link
Contributor

Seems reasonable... are contributors going to be the ones required to run this tool after making any changes or adding a plugin? Not sure we want to make that process any more difficult for newcomers.

@FichteFoll
Copy link
Collaborator Author

No, I don't think we can reasonably require package authors to run it, but it will be a part of the ChannelRepositoryTools package so that they can do it optionally. There doesn't seem to be a reasonable way to include this in the travis ci build either.
I mainly intend this to be a "run once in a while" thing for maintainers.

@twolfson
Copy link
Contributor

For Travis CI, we might be able to run the formatter then diff to see if there are changes/not. If there are changes (i.e. formatter wasn't run since last commit), then we could complain and exit with a non-zero code.

@robfrawley
Copy link

@twolfson +1

@FichteFoll
Copy link
Collaborator Author

Some of the formatter features have been added as tests in #7853, so the user can fix the issue by themselves.

@FichteFoll
Copy link
Collaborator Author

FichteFoll commented Apr 11, 2020

Better idea: We can have a github action run the formatter on pull requests and push to the branch when there are changes and run the tests afterwards, also via actions instead of travis.

@braver braver mentioned this issue Jan 4, 2023
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

No branches or pull requests

4 participants