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

Destroying source file on syntax error #7

Open
ghost opened this issue Apr 5, 2018 · 0 comments
Open

Destroying source file on syntax error #7

ghost opened this issue Apr 5, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 5, 2018

Dear Jérémie,

Today I found a rather dangerous issue with your copyright generator. In the plugin settings header tab I wrote my own copyright header. But I thought I had to write this header in the form of a comment:

/*
 * Copyright etc...
 */

After running the generator it turned out that it generates comments by itself. So the copyright headers became:

/*********
 * /*
 *  * Copyright etc...
 *  */            <- multiline comments ends here
 **********/      <- syntax error

This gives a syntax error. Then I fixed the copyright header in the plugin settings and ran the generator again to replace the (erroneous) headers.

Because of the syntax error however, the generator replaced not only the erroneous headers, but the complete source. And that for of every single file in the project. That means the whole project was wiped with no option to recover.

Luckily I tried the generator with an old project first, so that this wasn't too much of a disaster. But it may be good to have a look at how the generator copes with syntax errors in general... Perhaps forbid the plugin to run as long as there are syntax errors?

Kind regards,
Wouter

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

0 participants