-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Updates php cs fixer 2.0 #263
Conversation
@@ -1,6 +1,6 @@ | |||
<?php | |||
/** | |||
* Copyright 2015 Google Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The year should be the year when you add the file, so you should not update it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, that's true. Unfortunately, all the headers have to be the same for the linter to work. What if we changed them all to Copyright 2015, 2016 Google Inc.
?
Also, the vast majority of these files were added in 2016, but the copyright header wasn't updated when copied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you have exception for the linter? I also feel like it's a linter's bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just not check the header, if that's what you mean, but no there is no option to skip the copyright part of the header. I submitted PHP-CS-Fixer/PHP-CS-Fixer#2363 for this. But in the interim, we should decide to remove header checking from the linter, change it to 2015, 2016
, or set all of them to 2016
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe skip checking the header?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely true, although should new files have a previous year's copyright?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If new files have old year in the copyright, it looks very weird to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
treat the copyright per project, not per file.
then, all files should have same copyright.
you put copyrights in one, common place, for easy use, like LICENSE file. and then, copy-paste it to all files if one would only see one file, then for sure you don't want him to get under impression the file is copyleft.
you probably don't want to keep different files in one repo under different copyright. year, as trivial, but still, is one of that case, when you make different copyright for different files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
treat the copyright per project, not per file.
I don't think that's feasible. Files should be able to have different year in their copyright headers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I took a look at this project more and I would say that i would treat different folders separately, like you have different composer files. for that, when you don't do submodule or other solution, just keep everything in one place, it may be a valid case to have different headers.
at the same time, I would not treat it as regular case nor bug of fixer. it could be extended to support that case for sure, feel free to contribute if you want to change current behaviour ;)
@@ -27,5 +27,6 @@ return PhpCsFixer\Config::create() | |||
PhpCsFixer\Finder::create() | |||
->notPath('appengine/wordpress/src/files/flexible/wp-config.php') | |||
->notPath('appengine/wordpress/src/files/standard/wp-config.php') | |||
->in(__DIR__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: without this you would have to specify the path at every single fix
run, like php-cs-fixer fix .
instead of php-cs-fixer fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! That is helpful.
FYI, I am keeping the copyright changes, because all of these files are actually # determine the creation date for every file and print those added in 2015 or before
$ git ls-tree -r --name-only HEAD | \
while read filename; do
echo "$(git log --format="%aD" -- $filename | tail -1) $filename";
done | grep -v 2016 | awk '{print $4, $7}'
2015 .gitignore
2015 .travis.yml
2015 CONTRIBUTING.md
2013 LICENSE
2012 README.md
2015 TRAVIS.md
2015 bigquery/api/README.md
2015 bigquery/api/composer.json
2015 bigquery/api/composer.lock
2015 favicon.ico
2015 storage/api/README.md
2015 storage/api/composer.json
2015 storage/api/composer.lock |
f5f043e
to
6d999fe
Compare
LGTM |
also fixes mailgun tests