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 formatter spec #31

Closed
zimbatm opened this issue Feb 1, 2021 · 1 comment · Fixed by #32
Closed

Write formatter spec #31

zimbatm opened this issue Feb 1, 2021 · 1 comment · Fixed by #32
Labels
documentation Improvements or additions to documentation

Comments

@zimbatm
Copy link
Member

zimbatm commented Feb 1, 2021

Describe what interface a formatter should have.

We make a few assumptions about formatters, which allows us to keep a simple design. So we should communicate to users and formatters out there what they are.

  1. prjfmt is responsible for traversing the filesystem.
  2. The formatter is a command-line tool that takes a list of files to format at the end of the argument list. Eg: rustfmt --edition 2018 src/main.rs src/lib.rs src/other.rs. Where --edition 2018 is an option, and src/main.rs src/lib.rs and src/other.rs are the files to format.
  3. The formatter reads each of the files, formats them, and writes them back to the original location. The writing only happens if the file content has changed.
@zimbatm zimbatm added the documentation Improvements or additions to documentation label Feb 1, 2021
@zimbatm
Copy link
Member Author

zimbatm commented Feb 1, 2021

Eg: #30 doesn't respect that interface.

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

Successfully merging a pull request may close this issue.

1 participant