Bug 127689

Summary: check-webkit-style should complain if copyright dates should be updated
Product: WebKit Reporter: BJ Burg <bburg>
Component: Tools / TestsAssignee: Gergő Balogh <gbalogh.u-szeged>
Status: NEW ---    
Severity: Normal CC: commit-queue, darin, galpeter, glenn, llango.u-szeged, ossy, rniwa
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://www.webkit.org/coding/contributing.html
Attachments:
Description Flags
patch
none
patch, style fixed bfulgham: review-

Description BJ Burg 2014-01-27 10:53:44 PST
For example, after some threshold of say, 10 lines changed, check-webkit-style could check if any copyright lines include the current year, and complain if not. This should be an optional flag, since not everyone cares about updating copyright.
Comment 1 Gergő Balogh 2014-04-09 03:53:10 PDT
Created attachment 228954 [details]
patch
Comment 2 WebKit Commit Bot 2014-04-09 03:54:01 PDT
Attachment 228954 [details] did not pass style-queue:


ERROR: Tools/Scripts/webkitpy/style/checker_options.py:30:  expected 2 blank lines, found 1  [pep8/E302] [5]
ERROR: Tools/Scripts/webkitpy/style/checker_options.py:49:  no newline at end of file  [pep8/W292] [5]
Total errors found: 2 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Gergő Balogh 2014-04-09 03:57:02 PDT
Created attachment 228955 [details]
patch, style fixed
Comment 4 Darin Adler 2014-04-09 07:36:43 PDT
Comment on attachment 228955 [details]
patch, style fixed

View in context: https://bugs.webkit.org/attachment.cgi?id=228955&action=review

> Tools/Scripts/webkitpy/style/optparser.py:344
> +        check_copyright_help = ("If there is at least specified count of line chaned then specified,"
> +                                "will alert if is not any copyright note with the current year."
> +                                "(requires --diff_files option)")

I am not sure this should be in the style checker. There are many types of edits where claiming copyright is not appropriate. For example, if I rename something that appears in many source files I don’t want the style checker telling me I should update copyright dates in the many files where many lines were updating.
Comment 5 Gergő Balogh 2014-04-09 22:44:26 PDT
(In reply to comment #4)
> (From update of attachment 228955 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=228955&action=review
> 
> > Tools/Scripts/webkitpy/style/optparser.py:344
> > +        check_copyright_help = ("If there is at least specified count of line chaned then specified,"
> > +                                "will alert if is not any copyright note with the current year."
> > +                                "(requires --diff_files option)")
> 
> I am not sure this should be in the style checker. There are many types of edits where claiming copyright is not appropriate. For example, if I rename something that appears in many source files I don’t want the style checker telling me I should update copyright dates in the many files where many lines were updating.

Of course it is true, but that's why it is implemented as an optional switch. For example I tend to forget these things. It not meant to be a golden hammer, just a tool that reminds you and need manual checking too.
Comment 6 Brent Fulgham 2016-03-14 11:20:14 PDT
Comment on attachment 228955 [details]
patch, style fixed

View in context: https://bugs.webkit.org/attachment.cgi?id=228955&action=review

This patch seems like a good idea, but is very out of date. r- to update to current sources.

> Tools/ChangeLog:9
> +        Introducing a new checker_options paramter to pass infomration to the checkers.

Introducing a new checker_options PARAMETER to pass INFORMATION to the checkers.

> Tools/Scripts/webkitpy/style/checker.py:711
> +          copyright_limit: An integer, if more lines changed then

copyright_limit: An integer, if more lines changed than this limit, then

> Tools/Scripts/webkitpy/style/checker_options.py:2
> +# Copyright (C) 2014 Samsung Electronics. All rights reserved.

Should be updated to this year. :-(

> Tools/Scripts/webkitpy/style/checker_options.py:41
> +                           copyright will be checked.

copyright_limit: An integer, if more lines changed than this limit, then