Commit Graph

18 Commits

Author SHA1 Message Date
Dalas121
6282ef5499
update_copyrights - list any removed files 2025-01-11 19:38:18 -06:00
doofus-01
f684c20dac
remove CI check of copyrights.csv for images (#9246)
* remove CI check of images against copyrights.csv

* remove image file entries from copyrights.csv
2024-08-25 06:36:27 -07:00
Toom
788cedc99a Update copyrights: use consistent output format 2024-08-03 10:24:20 -05:00
Wedge009
11506811ff Update copyrights: Write CSV as UTF-8 2024-07-15 15:05:27 +02:00
Wedge009
e49addc585 Update copyrights: Always use slashes for the file path
Avoid discarding the entire copyrights.csv when running the update on Windows, and force slashes in file path strings if adding new files.

* Also rename hash object to avoid collision with built-in hash function.
* Clarified file object is representing a file path string as opposed to an actual open file object.
2024-07-13 16:29:38 +02:00
pentarctagon
2bc0ff1b1c sort the full list of files by name 2024-05-22 09:53:21 -05:00
pentarctagon
b30e6b2658 print files/rows that have issues 2024-05-22 09:53:21 -05:00
pentarctagon
f9f67eb6e1 write updates back to same file 2024-05-22 09:53:21 -05:00
pentarctagon
ef25eb2553 sorting is fine, but failing because it's not all sorted is silly 2024-02-24 11:54:17 -06:00
pentarctagon
bbd7f6aabc Update copyrights file
also explicitly specify encoding
2024-02-24 11:43:14 -06:00
P. J. McDermott
1f1a68e94e Check for and fix copyrights.csv rows with wrong numbers of fields
This should prevent accidental uses of commas in fields without quotes.
It would have caught the previous issue of str.join() not quoting fields
that contain commas.  For now though, it found a different issue: three
rows added in commit c631345314 had duplicated MD5 fields.
2024-02-07 11:12:55 +01:00
P. J. McDermott
5a048ad303 Fix how update_copyrights writes fields with commas
str.join() isn't smart enough to quote CSV fields when necessary, so
a field containing field separators (commas) would get parsed by the
second update_copyrights run as multiple fields.  Upon finding some rows
containing an extra field, the csv.reader() object then added an extra
blank field to each of all the other rows.

Use csv.writer() instead of str.join() to write proper CSV output.

This commit also undoes the removal of commas from fields that was
necessary in commit 676c1fa2b9.
2024-02-07 11:12:55 +01:00
P. J. McDermott
4c87a4be74 Fix license on LordBob's portraits, and check licenses
Commit 97c8feb8ca (pull #7903) specified for 58 of LordBob's portraits
a license of "GNU GPL v2+;CC BY-SA 4.0".  I don't know if the semicolon
is supposed to mean "and" or "or".

"And" (e.g. a GNU GPL v2+ file with CC BY-SA 4.0 modifications) isn't
legally possible.  "Or" appears incorrect, because LordBob [licensed][1]
his portraits under "the GNU GPL" and I can't find any evidence of him
also licensing them under CC BY-SA 4.0.

Also make update_copyrights check for possibly invalid licenses like
"GNU GPL v2+;CC BY-SA 4.0".

[1]: https://forums.wesnoth.org/viewtopic.php?p=329342#p329342
2024-01-30 21:20:10 -06:00
P. J. McDermott
efad8a0f74 Fix and check copyrights.csv "Needs Update" field
Commit 97c8feb8ca (pull #7903) included a comma in the "Notes" field
of four files, which instead of being enclosed in quotes, overflowed
into the "Needs Update" field.  So if those files are updated,
update_copyrights would clobber part of the notes.

Commit 1ecd4f4d59 (pull #8195) updated the "Date" field but didn't
clear "Needs Update" after update_copyrights set "Needs Update" and
"MD5" for data/core/images/units/monsters/raven/harbinger.png.

Make update_copyrights check for and warn about "Needs Update" instead
of clobbering it.  This should trigger CI failures if someone forgets
to update a row or accidentally puts into the "Needs Update" field
important information that shouldn't be clobbered on future updates.
2024-01-30 21:20:10 -06:00
Steve Cotton
441a2cf5e4 Check that every file in copyrights.csv has a license and author
Improve the error messages about the input file needing sorting,
to avoid confusion when successfully creating a sorted output
from an unsorted input.
2024-01-07 15:22:37 +01:00
Steve Cotton
e07acf71dc Check that copyrights.csv is sorted by filename
When the tool finds new or changed files, it puts them at the top of
the output .csv file for easy editing. However, this means that those
lines move when update_copyrights is run again. It also means that any
two PRs touching images are likely to have merge conflicts, as they'll
change line 2 of copyrights.csv.

Make the CI fail unless the file has been sorted again after editing.
2023-12-28 13:01:11 +01:00
pentarctagon
b46f9c7acc update_copyrights - improve performance a lot 2023-10-02 19:43:24 -05:00
pentarctagon
97c8feb8ca add image copyright tracking 2023-09-25 11:47:07 -05:00