Page MenuHomeWildfire Games

Script to auto update year for all modified files
Needs ReviewPublic

Authored by vladislavbelov on Jan 18 2019, 9:45 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

Subj. Currently only for SVN. Requires https://pypi.python.org/pypi/svn. Installation:

pip install svn

Plans:

  • Add Git support (should be easy).
  • Add command line params for more flexible configuration.
Test Plan
  1. Make some modifications in repo.
  2. Run the script (python license_year.py or double-click on it in explorer).

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 6818
Build 11212: Vulcan BuildJenkins

Event Timeline

vladislavbelov created this revision.
vladislavbelov edited the summary of this revision. (Show Details)
vladislavbelov edited the test plan for this revision. (Show Details)
Angen awarded a token.Jan 18 2019, 9:47 PM
Vulcan added a subscriber: Vulcan.Jan 18 2019, 9:49 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/differential/983/

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/differential/984/

wraitii added inline comments.
source/tools/hooks/license_year.py
40

s/header/year/ I think?

vladislavbelov marked an inline comment as done.Jan 19 2019, 2:43 PM
vladislavbelov added inline comments.
source/tools/hooks/license_year.py
40

Yeah, you're right.

Stan added a subscriber: Stan.Jan 19 2019, 2:47 PM
Stan added inline comments.
source/tools/hooks/license_year.py
16

c file as well no ?

vladislavbelov marked an inline comment as done.Jan 19 2019, 2:57 PM
vladislavbelov added inline comments.
source/tools/hooks/license_year.py
16

We have only 3 *.c files in our source repo, but I suppose we can add it too :)

Stan added inline comments.Jan 19 2019, 3:00 PM
source/tools/hooks/license_year.py
16

Do we have hpp, tpp, ipp files ? :)

vladislavbelov marked an inline comment as done.Jan 19 2019, 3:03 PM
vladislavbelov added inline comments.
source/tools/hooks/license_year.py
16

I found only *.hpp. I can add most C++ extensions, since we just ignore files without the license (only warn about them).

vladislavbelov marked an inline comment as done.Jan 19 2019, 3:05 PM
vladislavbelov added inline comments.
source/tools/hooks/license_year.py
16

But actually we should one style, so other extensions aren't necessary.

  • s/header/year/
  • add basic C++ headers
  • a little bit of polishing

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/differential/985/

Stan added a subscriber: Itms.Feb 25 2019, 10:01 AM

@Itms any comments on this ? :)

Itms added a comment.Feb 25 2019, 10:14 AM

It's a nice script, but is it useful now that the linter detects those wrong license dates? What would be the use case?

vladislavbelov added a comment.EditedFeb 25 2019, 12:49 PM
In D1753#72433, @Itms wrote:

It's a nice script, but is it useful now that the linter detects those wrong license dates? What would be the use case?

The linter is only checks the year. But the script upgrades it. The case is simple (at least what I use it for): you have a big patch from previous years/you forgot to upgrade years in a big patch. With the script it's not a problem, you don't need a manual work.