Skip to content

Shouldn't mess with license headers. #518

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

Closed
Ms2ger opened this issue Oct 22, 2015 · 6 comments
Closed

Shouldn't mess with license headers. #518

Ms2ger opened this issue Oct 22, 2015 · 6 comments
Labels
a-comments only-with-option requires a non-default option value to reproduce

Comments

@Ms2ger
Copy link
Contributor

Ms2ger commented Oct 22, 2015

Not happy with this:

-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
@nrc nrc added the a-comments label Oct 22, 2015
@nrc
Copy link
Member

nrc commented Oct 22, 2015

Hmm, not sure how to deal with this - how to identify block comments which are a license vs other block comments. Maybe we can just change all licenses to line comments?

@Ms2ger
Copy link
Contributor Author

Ms2ger commented Oct 23, 2015

I'd be fine with just being able to turn the //-preference off.

@nrc
Copy link
Member

nrc commented Dec 8, 2015

I think the best solution here is to have an option for skipping the first comment in a file - should be easy to implement and do what we want here.

@nrc nrc added this to the 1.0 milestone Apr 6, 2016
@nrc nrc added the only-with-option requires a non-default option value to reproduce label Jan 16, 2017
@nrc nrc removed this from the 1.0 milestone Jun 15, 2017
@davidalber
Copy link
Contributor

This no longer repros, with default configuration, due to #681, I guess. That is, if I do rustfmt --write-mode=diff FILENAME on what's below there's no difference.

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

fn main() {}

I think the best solution here is to have an option for skipping the first comment in a file

Is this still what you want to do, @nrc? I guess the situation that's not currently supported is leaving the license above alone when normalize_comments=true, but it seems like that's all right.

@nrc
Copy link
Member

nrc commented Dec 27, 2017

I guess normalize_comments could take a Yes/No/SkipFirst enum, rather than a bool. OTOH, it doesn't feel like a very good solution to just skip the first comment. I don't think I have a better idea right now though.

@scampi
Copy link
Contributor

scampi commented Apr 8, 2019

In addition to verifying headers, the option license_template_path could identify the comment style and keep the original, while still allowing the header to be formatted if deemed necessary by that option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-comments only-with-option requires a non-default option value to reproduce
Projects
None yet
Development

No branches or pull requests

4 participants