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

Meta: make tidy parity #20

Closed
nrc opened this issue Apr 22, 2015 · 2 comments
Closed

Meta: make tidy parity #20

nrc opened this issue Apr 22, 2015 · 2 comments

Comments

@nrc
Copy link
Member

nrc commented Apr 22, 2015

The first big goal for rustfmt should be parity with make tidy, i.e., we do all the checks that make tidy does and is usable as part of the rust distro build process. This needs three things - feature parity, non-bugginess and configurability.

Feature parity

Need to find out exactly what make tidy does, but things that come to mind are: warnings on cfg(stage0), checking for TODO, checking licenses.

Non-bugginess

In order to be part of the build process, we need to be able to run rustfmt on the whole repo without breaking anything. This will need lots of testing and some big PRs to the Rust repo for the initial reformatting.

To make this tractable, we'll want to turn rustfmt on one crate at a time and keep the make tidy step until the end (it might make sense to keep make tidy forever for the test suite, although it would be nice to kill it.

Configurability

There will be bugs, we need to be able to turn rustfmt off for some sections of a file until rustfmt can be fixed. We'll also want to evolve rustfmt (make tidy parity does not (and should not) require all formatting rules are enforced, and we'll want to add more rules as time goes by), we'll want to be able to feature gate some features of rustfmt so that they can be tested without applying to the rust repo or forking rustfmt.

We'll also need configurability for some of the make tidy features, for example license checking, since different projects will have different licences.

@nrc
Copy link
Member Author

nrc commented Apr 22, 2015

Performance might also be an issue. In the case where we don't modify anything, we should be pretty fast - i.e., ballpark with make tidy. That will probably mean we need to at the least not write out if nothing has changed (assuming writing to a file is slower than comparing two long strings, which might not be the case if writing is in part async, but I don't think it is).

Alternatively, we could skip checking files which have not changed at all since the last check. But that would require keeping metadata around, and could break easily because multi-user time is hard.

We might just need to optimise a lot too.

@nrc
Copy link
Member Author

nrc commented Sep 27, 2015

TODO list

  • check for trailing whitespace
  • check for overlong lines
  • Check for license #209 check for license
  • set an exit code for warnings
  • warn on TODOs
  • unmatched SNAP (whatever that means)
  • match target for formatting all crates (issue for Rust, rather than rustfmt, requires rustfmt in tree some how, probably a submodule, and probably lots of details to sort out)
  • check performance is acceptable (see Tracking issue: performance #338)
  • respect the skip tidy comments for long lines, etc.
  • other features? I know there are some more I some times see

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

1 participant