shikhabhadoria opened a new pull request, #22548: URL: https://github.com/apache/nuttx/pull/22548
## Summary Fixes #22040. Each C, C++, make, script, and similar source file must contain both an `SPDX-License-Identifier` tag and the license in clear text. NuttX already uses that header style in most of the tree (see the coding standard file header rules and the SPDX migrations such as #14996 and #22002), but Check CI did not enforce it. This change adds `tools/checkspdx.py` and runs it from `tools/checkpatch.sh` for every file already visited by Check. GitHub CI therefore rejects pull requests that touch source files missing either the SPDX tag or the human-readable license. The checker looks at the file header and: * requires a `SPDX-License-Identifier` tag * requires matching clear-text license wording (Apache 2.0 boilerplate, BSD, MIT, ISC, public domain, zlib, and similar grants used in-tree) * skips binaries, empty files, documentation, and other non-source paths The coding standard appendix now shows the SPDX line in the sample headers so new files get both parts of the header. ## Impact * Check CI (`tools/checkpatch.sh`) fails when a changed source, script, or make file is missing SPDX or clear-text license * Existing files without a complete header are not mass-updated here; they fail the next time a pull request touches them * No runtime, build, or hardware behavior change ## Testing Host: Ubuntu 24.04, Python 3.12.3. * `python3 tools/checkspdx.py --selftest` (13 tests, OK) * `./tools/checkpatch.sh -f tools/checkspdx.py tools/checkpatch.sh` (pass) * `./tools/checkpatch.sh -m -g HEAD~1..HEAD` (pass) * Tree scan of source/script/make files: 23657 pass; remaining failures are files that currently lack SPDX or have SPDX without license text, which is the condition this check is meant to catch No board build is required: this is a CI/tooling change only. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
