Em Thu, 05 Sep 2019 02:28:05 -0700 Joe Perches <joe@xxxxxxxxxxx> escreveu: > On Thu, 2019-09-05 at 05:56 -0300, Mauro Carvalho Chehab wrote: > > I'll accept > > this patch and keep such rule in mind for next SPDX changes. > > > > Anyway, with regards to script, we need to change the rules in order to > > allow adding SPDX for python scripts, as otherwise the addition of SPDX > > headers may cause regressions. > > Not really. > > $ git grep -n '^# SPDX-License-Identifier' -- '*.py' | wc -l > 62 > $ git grep -n '^# SPDX-License-Identifier' -- '*.py' | \ > cut -f2 -d: | sort | uniq -c > 32 1 > 27 2 > 3 3 > $ git grep -n '^# SPDX-License-Identifier' -- '*.py' | \ > cut -f1 -d: | xargs ./scripts/spdxcheck.py --verbose > > License files: 14 > Exception files: 2 > License IDs 19 > Exception IDs 2 > > Files checked: 62 > Lines checked: 95 > Files with SPDX: 62 > Files with errors: 0 Not quite sure what you're meant with the above, but: 1) this won't cover all python scripts, as there are some without .py extension: $ git grep -lE "\#\!.*python"|grep -v \.py$ drivers/staging/greybus/tools/lbtest scripts/bloat-o-meter scripts/diffconfig scripts/show_delta tools/hv/lsvmbus tools/kvm/kvm_stat/kvm_stat 2) we have already some files that are violating PEP-263 due to SPDX headers. On a quick look at the results of: $ git grep -lE "^\#.*coding" $(git grep -lE "\#\!.*python") Documentation/sphinx/kernel_include.py Documentation/sphinx/rstFlatTable.py tools/perf/python/tracepoint.py tools/perf/python/twatch.py tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py Those three files already have such problem: tools/perf/python/tracepoint.py tools/perf/python/twatch.py tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py On those scripts, the coding line is not at the right place, and will be silently ignored by python, causing them to crash with UTF-8 encoding chars, if any. And the other two doesn't have a SPDX header file. Adding a SPDX header there would violate the "up to the second line" rule. Thanks, Mauro