I want to request/propose an optional feature that will be handy for some projects. Often, projects would like to state their license in the top-level part of every source file. This includes private and public licenses.
It would be handy a formatting option that, if enabled and configured,:
Checks the presence of a given text as a top-level comment (with // <my comment).
Introduces the given text as a top-level comment if missing.
Example:
use something;
fn main() {
something::do_sth();
}
to
// Licensed under the MIT License.
use something;
fn main() {
something::do_sth();
}
This could be a single-line, or multi-line comment, acknowledging that some projects may have 2 or more licenses.
There was a time when rustfmt did something like this, but we dropped support for it because we felt that rustfmt wasn't the right tool. You can read more at https://github.com/rust-lang/rustfmt/issues/5103
I want to request/propose an optional feature that will be handy for some projects. Often, projects would like to state their license in the top-level part of every source file. This includes private and public licenses.
It would be handy a formatting option that, if enabled and configured,:
// <my comment
).Example:
to
This could be a single-line, or multi-line comment, acknowledging that some projects may have 2 or more licenses.