ament_copyright: Rolling
  • Links
    • Rosindex
    • Repository
  • Python API
    • ament_copyright package
      • Submodules
        • ament_copyright.copyright_names module
        • ament_copyright.crawler module
        • ament_copyright.licenses module
        • ament_copyright.main module
        • ament_copyright.parser module
        • ament_copyright.pytest_marker module
      • Module contents
        • get_copyright_names()
        • get_licenses()
  • Standard Documents
    • PACKAGE
    • CHANGELOG
      • Changelog for package ament_copyright
        • 0.20.2 (2025-07-30)
        • 0.20.1 (2025-06-19)
        • 0.20.0 (2025-04-24)
        • 0.19.2 (2025-04-17)
        • 0.19.1 (2025-02-02)
        • 0.19.0 (2024-11-20)
        • 0.18.1 (2024-06-17)
        • 0.18.0 (2024-04-26)
        • 0.17.0 (2024-04-16)
        • 0.16.4 (2024-03-28)
        • 0.16.3 (2024-02-07)
        • 0.16.2 (2023-12-26)
        • 0.16.1 (2023-11-06)
        • 0.16.0 (2023-10-04)
        • 0.15.2 (2023-07-11)
        • 0.15.1 (2023-06-07)
        • 0.15.0 (2023-04-27)
        • 0.14.1 (2023-04-11)
        • 0.14.0 (2023-02-14)
        • 0.13.2 (2022-09-13)
        • 0.13.1 (2022-05-09)
        • 0.13.0 (2022-04-29)
        • 0.12.3 (2022-04-08)
        • 0.12.2 (2022-03-28)
        • 0.12.1 (2022-03-01)
        • 0.12.0 (2022-02-18)
        • 0.11.4 (2022-01-14)
        • 0.11.3 (2022-01-14)
        • 0.11.2 (2021-06-18)
        • 0.11.1 (2021-06-18)
        • 0.11.0 (2021-06-18)
        • 0.10.6 (2021-05-06)
        • 0.10.5 (2021-04-14)
        • 0.10.4 (2021-03-18)
        • 0.10.3 (2021-03-03)
        • 0.10.2 (2021-02-12)
        • 0.10.1 (2021-01-25)
        • 0.10.0 (2020-09-18)
        • 0.9.4 (2020-05-26)
        • 0.9.3 (2020-05-18)
        • 0.9.2 (2020-05-08)
        • 0.9.1 (2020-04-10)
        • 0.8.1 (2019-10-23)
        • 0.8.0 (2019-09-17)
        • 0.7.4 (2019-07-31)
        • 0.7.3 (2019-05-09 14:08)
        • 0.7.2 (2019-05-09 09:30)
        • 0.7.1 (2019-05-07)
        • 0.7.0 (2019-04-11)
        • 0.6.3 (2019-01-14)
        • 0.6.2 (2018-12-06)
        • 0.6.1 (2018-11-15)
        • 0.6.0 (2018-11-14)
        • 0.5.2 (2018-06-27)
        • 0.5.1 (2018-06-18 13:47)
        • 0.5.0 (2018-06-18 10:09)
        • 0.4.0 (2017-12-08)
  • Documentation
    • ament_copyright
  • Index
ament_copyright: Rolling
  • Documentation
  • ament_copyright
  • View page source

ament_copyright

Checks C / C++ / CMake / Python source files for the existence of a copyright and license notice. Files with the following extensions are being considered: .c, .cc, .cpp, .cxx, .h, .hh, .hpp, .hxx, .cmake, .py.

When being searched for recursively the following directories and files are being excluded:

  • directories starting with . (e.g. .git) or _ (e.g. __pycache__)

  • setup.py when being a sibling of package.xml

Additionally it checks if the root of a repository contains a LICENSE and CONTRIBUTING.md file.

How to run the check from the command line?

ament_copyright [<path> ...]

When using the option --list-copyright-names a list of known copyright holders is shown. The option --list-licenses outputs a list of known licenses.

When using the option --add-missing <KNOWN_COPYRIGHT_NAME | "Copyright holder string"> <KNOWN_LICENSE> a copyright notice and license is added to all files which lack one. The first argument can either be a name from the list returned by --list-copyright-names or a custom string. The second argument must be a name from the list returned by --list-licenses.

When using the option --add-copyright-year existing copyright notices are being updated to include the current year.

How to run the check from within a CMake ament package as part of the tests?

The CMake integration is provided by the package ament_cmake_copyright.

How to add support for more licenses or copyright holders?

The package uses Python entry points to get all list of known licenses and copyright holder. You can implement a custom package and contribute more implementations to these entry points or extend this package with more licenses.

Why are my existing copyright / license notices not detected?

This script currently only checks line comments (lines starting with # / // depending on the language). Block comments / C-style comment (starting with /*) are not being detected to keep the complexity minimal. Also the content must match the templates exactly.

Previous

© Copyright The <ament_copyright> Contributors. License: Apache License 2.0.

Built with Sphinx using a theme provided by Read the Docs.