Skip to content

Add license PR checks + how to run it locally #1235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/contributing/guidelines/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Travis configuration is located in the [.travis.yml](https://github.com/ARMmbed/
- Features/netsocket.
- **travis-ci/events** - Checks that Mbed OS compiles and run events tests.
- **travis-ci/gitattributestest** - Checks there are no changes after clone. This checks that `.gitattributes` is used correctly.
- **travis-ci/licence_check** - Checks there is no GPL license text in the code.
- **travis-ci/licence_check** - Checks that there is only a permissive license in the files, including SPDX identifier.
- **travis-ci/littlefs** - Tests littlefs without embedded hardware.
- **travis-ci/tools-py2.7** - Runs Python tools tests with Python 2.7.
- **travis-ci/psa-autogen** - Runs PSA SPM code generator.
Expand Down
16 changes: 16 additions & 0 deletions docs/contributing/guidelines/license.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,22 @@ If you decide to use a different license for your work, follow the same pattern:

- If more than one license applies to the source file, use an SPDX license expression (see [SPDX Specification, Appendix IV](https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60)), to reflect the presence of multiple licenses in your *LICENSE.md* file and in each source file.

## License check in pull requests

We use scancode-toolkit to enforce the license in binaries and libraries. Please see "Continuous integration (CI) testing" section for more information.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can move Please see "Continuous integration (CI) testing" section for more information. to the end of this section, shall I?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm agnostic on this one.


To scan the files in the SCANCODE folder, please use:

```
scancode --license --json-pp mbed-os.json SCANCODE
```

Run our script to check if files confirm to this license guide:

```
python tools/test/travis-ci/scancode-evaluate.py -f mbed-os.json
```

## Contributing to the Mbed OS codebase

### Mbed OS principles
Expand Down