[util] Add Licence Checker

This commit adds a script which can checks the licence headers in our
source code against an expected licence header.

The script can check most text file formats that we have checked into
the repository, though it has some limitations. It ensures the entire
licence appears on consecutive lines in the first comment in the file,
and those lines contain nothing else.

The primary limitation of the checker is that each file suffix can only
match one comment style, which is used for checking for the licence
header. In text formats which accept multiple comment styles, there is
now a canonical one that the licence must use. Where available, the
licence should use a line comment style.

The other limitation is for files where the canonical style is block
comments, like `/* */`, each line must be wrapped in the comment prefix
and suffix, rather than the whole licence header being wrapped in a
single comment prefix and suffix. This is an artefact of how the checker
searches for the licence.

The checker is configured using a hjson file, which contains the exact
licence header, and a list of file patterns to exclude from checking the
licence for, which is used to exclude vendored and other externally
sourced files.

Signed-off-by: Sam Elliott <selliott@lowrisc.org>
2 files changed
tree: 3cd86ba028c3cb38815ec8a59878d299c1e2783b
  1. .github/
  2. ci/
  3. doc/
  4. hw/
  5. site/
  6. sw/
  7. test/
  8. util/
  9. .clang-format
  10. .dockerignore
  11. .flake8
  12. .gitignore
  13. .style.yapf
  14. _index.md
  15. apt-requirements.txt
  16. azure-pipelines.yml
  17. check_tool_requirements.core
  18. CLA
  19. COMMITTERS
  20. CONTRIBUTING.md
  21. LICENSE
  22. meson.build
  23. meson_init.sh
  24. meson_options.txt
  25. python-requirements.txt
  26. README.md
  27. tool_requirements.py
  28. toolchain.txt
README.md

OpenTitan

OpenTitan logo

About the project

OpenTitan is an open source silicon Root of Trust (RoT) project. OpenTitan will make the silicon RoT design and implementation more transparent, trustworthy, and secure for enterprises, platform providers, and chip manufacturers. OpenTitan is administered by lowRISC CIC as a collaborative project to produce high quality, open IP for instantiation as a full-featured product. See the OpenTitan site and OpenTitan docs for more information about the project.

About this repository

This repository contains hardware, software and utilities written as part of the OpenTitan project. It is structured as monolithic repository, or “monorepo”, where all components live in one repository. It exists to enable collaboration across partners participating in the OpenTitan project.

Documentation

The project contains comprehensive documentation of all IPs and tools. You can access it online at docs.opentitan.org.

How to contribute

Have a look at CONTRIBUTING for guidelines on how to contribute code to this repository.

Licensing

Unless otherwise noted, everything in this repository is covered by the Apache License, Version 2.0 (see LICENSE for full text).