Skip to content

Add update_copyright script.#261

Merged
PetarKirov merged 1 commit intodlang:masterfrom
ibuclaw:updatecopyright
Dec 17, 2018
Merged

Add update_copyright script.#261
PetarKirov merged 1 commit intodlang:masterfrom
ibuclaw:updatecopyright

Conversation

@ibuclaw
Copy link
Copy Markdown
Member

@ibuclaw ibuclaw commented Oct 7, 2017

I've been a bit under the weather today, so I hacked together something that updates all copyright notices in all dmd sources in a consistent manner, with an --update-year/-y to automate updating the copyright year of sources also.

I would have thought that something like this exists, but couldn't see anything at a glance.

@dlang-bot
Copy link
Copy Markdown
Contributor

dlang-bot commented Oct 7, 2017

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + tools#261"

@wilzbach
Copy link
Copy Markdown
Contributor

wilzbach commented Jan 1, 2018

It would probably be good to add this file to the Makefile, s.t. we at least check that the file compiles. Just adding it to the TOOLS list should be enough (there's a default rule to compile single files).

@ibuclaw ibuclaw force-pushed the updatecopyright branch 3 times, most recently from 87ff9bb to acc09f0 Compare January 1, 2018 17:09
@ibuclaw ibuclaw requested a review from CyberShadow as a code owner February 11, 2018 09:13
@ibuclaw ibuclaw force-pushed the updatecopyright branch 2 times, most recently from a41968a to f93f673 Compare February 11, 2018 09:33
@CyberShadow
Copy link
Copy Markdown
Member

Woah, that's a lot of code! I guess this would not be simpler as a shell script using sed & co?

@CyberShadow
Copy link
Copy Markdown
Member

Please update the table in README.md to include this tool.

@ibuclaw
Copy link
Copy Markdown
Member Author

ibuclaw commented Feb 11, 2018

Woah, that's a lot of code! I guess this would not be simpler as a shell script using sed & co?

When I ran this on the copyright 2018 PR in dmd (see referenced PR 7573), this caught and highlighted/fixed-up:

  1. All unknown copyright holders (misspellings or variantions of).
  2. Malformed copyright notices.
  3. Copyrights that were wrapped across multiple lines.

Here's a good example: https://github.com/dlang/dmd/pull/7573/files#diff-7a515f2ecfbe92cc486dc15fc82edf0aL2

Now that dmd has had all "bad" copyright notices removed, it should be a simple sed I guess, unless any sneak in over the course of this year.

@ibuclaw
Copy link
Copy Markdown
Member Author

ibuclaw commented Feb 11, 2018

It would probably be good to add this file to the Makefile,

Done.

Please update the table in README.md to include this tool.

Done.

@wilzbach
Copy link
Copy Markdown
Contributor

Yeah from my own experience trying to use sed for the version bump in 2017 - I only got ~85% because in the DMD repo there are all kinds of funny variants of a header comment, so this is definitely useful!

Copy link
Copy Markdown
Contributor

@marler8997 marler8997 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get this included so everyone has access to it. If there's problems with it they're easy to fix.

Copy link
Copy Markdown
Contributor

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready whenever you are.
(unfortunately I'm pretty sure that this script will still require minor update for 2019 :/)

@ibuclaw ibuclaw force-pushed the updatecopyright branch 2 times, most recently from 872b11f to a489aba Compare May 1, 2018 18:27
@ibuclaw ibuclaw force-pushed the updatecopyright branch from a489aba to 0436505 Compare May 1, 2018 18:29
@ibuclaw
Copy link
Copy Markdown
Member Author

ibuclaw commented May 1, 2018

Rebased with 32bit fix. I'll check back in on the CI results later.

@ibuclaw
Copy link
Copy Markdown
Member Author

ibuclaw commented Dec 17, 2018

(unfortunately I'm pretty sure that this script will still require minor update for 2019 :/)

It's almost 2019 and I've realised that this still isn't merged.

Just ran this on current dmd sources with -y option. Here's the diff:

diff --git a/src/dmd/backend/aarray.d b/src/dmd/backend/aarray.d
index 6a052d23f..74080838e 100644
--- a/src/dmd/backend/aarray.d
+++ b/src/dmd/backend/aarray.d
@@ -2,7 +2,7 @@
  * Compiler implementation of the
  * $(LINK2 http://www.dlang.org, D programming language).
  *
- * Copyright:   Copyright (c) 2000-2018 by Digital Mars, All Rights Reserved
+ * Copyright:   Copyright (C) 2000-2018 by The D Language Foundation, All Rights Reserved
  * Authors:     $(LINK2 http://www.digitalmars.com, Walter Bright), Dave Fladebo
  * License:     Distributed under the Boost Software License, Version 1.0.
  *              http://www.boost.org/LICENSE_1_0.txt
diff --git a/src/dmd/backend/debugprint.d b/src/dmd/backend/debugprint.d
index d29fe2d34..999de19e1 100644
--- a/src/dmd/backend/debugprint.d
+++ b/src/dmd/backend/debugprint.d
@@ -3,7 +3,7 @@
  * $(LINK2 http://www.dlang.org, D programming language).
  *
  * Copyright:   Copyright (C) 1985-1998 by Symantec
- *              Copyright (c) 2000-2017 by Digital Mars, All Rights Reserved
+ *              Copyright (C) 2000-2018 by The D Language Foundation, All Rights Reserved
  * Authors:     $(LINK2 http://www.digitalmars.com, Walter Bright)
  * License:     $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
  * Source:      $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/backend/debug.c, backend/debugprint.d)
diff --git a/src/dmd/backend/divcoeff.d b/src/dmd/backend/divcoeff.d
index 61c21434b..2840f7f71 100644
--- a/src/dmd/backend/divcoeff.d
+++ b/src/dmd/backend/divcoeff.d
@@ -2,7 +2,7 @@
  * Compiler implementation of the
  * $(LINK2 http://www.dlang.org, D programming language).
  *
- * Copyright:   Copyright (c) 2013-2018 by The D Language Foundation, All Rights Reserved
+ * Copyright:   Copyright (C) 2013-2018 by The D Language Foundation, All Rights Reserved
  * Authors:     $(LINK2 http://www.digitalmars.com, Walter Bright)
  * License:     $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
  * Source:      $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/backend/divcoeff.d, backend/divcoeff.d)
diff --git a/src/dmd/backend/dlist.d b/src/dmd/backend/dlist.d
index adf17e0ea..0a810adf5 100644
--- a/src/dmd/backend/dlist.d
+++ b/src/dmd/backend/dlist.d
@@ -10,7 +10,7 @@
  *         different lists to 'share' a common tail.
  *
  * Copyright:   Copyright (C) 1986-1990 by Northwest Software
- *              Copyright (c) 1999-2016 by Digital Mars, All Rights Reserved
+ *              Copyright (C) 1999-2018 by The D Language Foundation, All Rights Reserved
  * Authors:     $(LINK2 http://www.digitalmars.com, Walter Bright)
  * License:     $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
  * Source:      $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/backend/dlist.d, backend/dlist.d)
diff --git a/src/dmd/backend/dvec.d b/src/dmd/backend/dvec.d
index 03614a7d0..eda65de5d 100644
--- a/src/dmd/backend/dvec.d
+++ b/src/dmd/backend/dvec.d
@@ -4,7 +4,7 @@
  *
  * Simple bit vector implementation.
  *
- * Copyright:   Copyright (c) 2013-2018 by The D Language Foundation, All Rights Reserved
+ * Copyright:   Copyright (C) 2013-2018 by The D Language Foundation, All Rights Reserved
  * Authors:     $(LINK2 http://www.digitalmars.com, Walter Bright)
  * License:     $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
  * Source:      $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/backend/dvec.d, backend/dvec.d)
diff --git a/src/dmd/backend/go.d b/src/dmd/backend/go.d
index 9332a609d..9b68a10d2 100644
--- a/src/dmd/backend/go.d
+++ b/src/dmd/backend/go.d
@@ -3,7 +3,7 @@
  * $(LINK2 http://www.dlang.org, D programming language).
  *
  * Copyright:   Copyright (C) 1986-1998 by Symantec
- *              Copyright (c) 2000-2017 by Digital Mars, All Rights Reserved
+ *              Copyright (C) 2000-2018 by The D Language Foundation, All Rights Reserved
  * Authors:     $(LINK2 http://www.digitalmars.com, Walter Bright)
  * License:     Distributed under the Boost Software License, Version 1.0.
  *              http://www.boost.org/LICENSE_1_0.txt
diff --git a/src/dmd/backend/goh.d b/src/dmd/backend/goh.d
index cdec07b9f..ae80711d6 100644
--- a/src/dmd/backend/goh.d
+++ b/src/dmd/backend/goh.d
@@ -3,7 +3,7 @@
  * $(LINK2 http://www.dlang.org, D programming language).
  *
  * Copyright:   Copyright (C) 1986-1998 by Symantec
- *              Copyright (c) 2000-2017 by Digital Mars, All Rights Reserved
+ *              Copyright (C) 2000-2018 by The D Language Foundation, All Rights Reserved
  * Authors:     $(LINK2 http://www.digitalmars.com, Walter Bright)
  * License:     Distributed under the Boost Software License, Version 1.0.
  *              http://www.boost.org/LICENSE_1_0.txt
diff --git a/src/dmd/backend/varstats.di b/src/dmd/backend/varstats.di
index 383a743e8..02d905f40 100644
--- a/src/dmd/backend/varstats.di
+++ b/src/dmd/backend/varstats.di
@@ -2,7 +2,7 @@
  * Compiler implementation of the
  * $(LINK2 http://www.dlang.org, D programming language).
  *
- * Copyright:   Copyright (c) 2015-2017 by Digital Mars, All Rights Reserved
+ * Copyright:   Copyright (C) 2015-2018 by The D Language Foundation, All Rights Reserved
  * Authors:     Rainer Schuetze
  * License:     Distributed under the Boost Software License, Version 1.0.
  *              http://www.boost.org/LICENSE_1_0.txt
diff --git a/src/dmd/root/longdouble.d b/src/dmd/root/longdouble.d
index c9e75db89..5cc6e943f 100644
--- a/src/dmd/root/longdouble.d
+++ b/src/dmd/root/longdouble.d
@@ -1,4 +1,4 @@
-/* Copyright (c) 1999-2017 by Digital Mars
+/* Copyright (C) 1999-2018 by The D Language Foundation, All Rights Reserved
  * All Rights Reserved, written by Rainer Schuetze
  * http://www.digitalmars.com
  * Distributed under the Boost Software License, Version 1.0.

@PetarKirov PetarKirov merged commit 483a6d3 into dlang:master Dec 17, 2018
@ibuclaw ibuclaw deleted the updatecopyright branch December 17, 2018 14:07
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

Successfully merging this pull request may close these issues.

8 participants