-
Notifications
You must be signed in to change notification settings - Fork 3
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
Support for blank line after block comment when fixing a file #3
Comments
I think that the best solution for this bug is not to fix anything and let the developer fix it manually. In case there is an old version of the comment, let's say it was APACHE-2 and the developer decide to change it to MIT. The |
Hey moshest, |
Nope.
|
Hey moshest, |
Hey @moshest, |
Yes. My configuration was that the original file is not a valid header. I added a space line after the comment. This is a valid header: /**
* Copyright 2017 Moshe Simantov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
console.error("Don't run `mocha` directly. Use `make test`.");
process.exit(0); This is not: /**
* Copyright 2017 Moshe Simantov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
console.error("Don't run `mocha` directly. Use `make test`.");
process.exit(0); |
Ah now I see. Thank you for explaining that. |
Hey @moshest, onNonMatchingHeader
|
Feel free to tell me how it goes, quite interested! |
Hi, Sorry to tell you by I got the same behaviour when I'm applying Version: Config: 'notice/notice': ['error',
{
mustMatch: copyrightMatch,
template: copyrightTemplate,
onNonMatchingHeader: 'report',
},
], |
Hey @moshest, |
Regarding the Looks like that if |
Yea I suppose that does make sense 😂. Why are my unit tests passing then? Either way, I'll fix that. |
Alright, made that change. I'm still curious to see why my unit tests passed |
Closing issue. Please reopen if you run into any problems. |
The problem is that files without extra line space fix incorrectly and duplicate the licence comment:
The original file:
The fix:
Please see issue #2 for my configuration.
My template file is as follow (notice the blank line on the end):
The text was updated successfully, but these errors were encountered: