Skip to content
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

Feature/add config params #71

Merged
merged 43 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a3cac85
changed each test to also check for warnings and specified which warn…
ant-u Apr 2, 2024
183d2b7
implemented change requests
ant-u Apr 8, 2024
473b6ab
Merge branch 'main' into feature/adapt_tests_for_warning
ant-u Apr 8, 2024
55e2230
linter issues
ant-u Apr 8, 2024
d21b4de
added location of check
ant-u Nov 11, 2024
6ca9be7
added check class
ant-u Nov 11, 2024
2da0559
added test for xml conformity
ant-u Nov 15, 2024
01d8ef7
added check for validating xml with scheme, output not yet processed …
ant-u Nov 15, 2024
7bf022e
created whole check out of validation function. introduced success an…
ant-u Nov 18, 2024
0a47e98
Merge branch 'main' into feature/adapt_tests_for_warning
ant-u Nov 21, 2024
03279cb
corrected double code
ant-u Nov 21, 2024
9dc4761
moved check to extra file
ant-u Nov 21, 2024
abf0c4d
fixed imports and whitespaces
ant-u Nov 21, 2024
8687856
changed if structure of _check method
ant-u Nov 22, 2024
3d57102
changed tests to all fullfill scheme version
ant-u Nov 25, 2024
dbef936
changed test data with source-file attribute to version 4
ant-u Nov 25, 2024
cd379e5
added case for package.xml version 4
ant-u Nov 28, 2024
9330eb2
removed todo
ant-u Nov 28, 2024
3ece023
adapted wrong test
ant-u Nov 28, 2024
bc4fabf
moved version checking and xml tree conversion to package.py
ant-u Nov 29, 2024
9716639
refactor of schema check
ant-u Dec 2, 2024
bab6691
fixed bug
ant-u Dec 2, 2024
b393418
added new args for config
ant-u Dec 5, 2024
e002704
added functionality for config options
ant-u Dec 5, 2024
7020bf3
added scheme 2 test
ant-u Dec 5, 2024
8baa2fd
added tests for all scheme versions
ant-u Dec 6, 2024
7b05817
added negative, violating tests for every scheme
ant-u Dec 6, 2024
e2ac79c
adapted tests to scan for schemacheck as well
ant-u Dec 6, 2024
f9c46d5
added online schema aquiration
ant-u Dec 9, 2024
396e73d
changed used xml validation files with online files, still need a fal…
ant-u Dec 9, 2024
7f7d0f5
changed readme due to updates on code
ant-u Dec 9, 2024
2cbfca5
changed readme
ant-u Dec 9, 2024
62ff892
changed content of arguments help
ant-u Dec 9, 2024
e3c6c89
added lazy schema request
ant-u Dec 9, 2024
19415cd
saving validation schema to reduce requests
ant-u Dec 9, 2024
125c185
deleted local shema files, rewrote schema_check cases and adapted sch…
ant-u Dec 9, 2024
711d56a
Resolved merge conflicts
ant-u Dec 12, 2024
fd38aff
implemented suggestions again
ant-u Dec 12, 2024
cf48bfd
implemented suggestions
ant-u Jan 9, 2025
56e7873
added fail case for no connection & adapted readme
ant-u Jan 13, 2025
0205104
linter issues
ant-u Jan 13, 2025
24350fe
fixing documentation bug
ant-u Jan 13, 2025
740e6d0
documentation fix
ant-u Jan 13, 2025
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
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,18 @@ graph TD

This checks:

- [x] Is `package.xml` conform to it's schema?
[- SchemaCheck](src/ros_license_toolkit/license_checks/schema_check.py#L27)
- [x] Is any license defined in `package.xml`?
[- LicenseTagExistsCheck](src/ros_license_toolkit/checks.py#L90)
[- LicenseTagExistsCheck](src/ros_license_toolkit/license_checks/license_tag_exists_check.py#L24)
- [x] Has at most one license tag without a source-files declaration?
[- LicenseTagExistsCheck](src/ros_license_toolkit/checks.py#L90)
[- LicenseTagExistsCheck](src/ros_license_toolkit/license_checks/license_tag_exists_check.py#L24)
- [x] Do all licenses tags follow the SPDX standard?
[- LicenseTagIsInSpdxListCheck](src/ros_license_toolkit/checks.py#L104)
[- LicenseTagIsInSpdxListCheck](src/ros_license_toolkit/license_checks/license_tag_is_spdx.py#L24)
- [x] Are license texts available and correctly referenced for all declared licenses?
[- LicenseTextExistsCheck](src/ros_license_toolkit/checks.py#L123)
[- LicenseTextExistsCheck](src/ros_license_toolkit/license_checks/license_text_exists_check.py#L30)
- [x] Does the code contain licenses not declared in any license tags source-file attribute (source-files="src/something/**")?
[- LicensesInCodeCheck](src/ros_license_toolkit/checks.py#L182)
[- LicensesInCodeCheck](src/ros_license_toolkit/license_checks/license_in_code_check.py#L28)

## Usage

Expand All @@ -71,7 +73,7 @@ ros_license_toolkit my_ros_package

```bash
$ ros_license_toolkit -h
usage: ros_license_toolkit [-h] [-c] [-v] [-q] path
usage: ros_license_toolkit [-h] [-c] [-v] [-q] [-e] [-w] path

Checks ROS packages for correct license declaration.

Expand All @@ -84,6 +86,11 @@ options:
generate a copyright file
-v, --verbose enable verbose output
-q, --quiet disable most output
-e, --continue_on_error
treats all errors as warnings, i.e. will give
returncode 0 even on errors
-w, --warnings_as_error
treats all warnings as errors
```

Additionally, there is an option to ignore single files, folders and types of files.
Expand Down Expand Up @@ -140,9 +147,9 @@ In particular, the following things will have to be done:
- [x] Each LicenseTag should have SPDX id.
- [x] Single license tag without file attribute and single license text should match automatically.
- [x] Turn into github action.
- [ ] Evaluate runtime. If scancode-toolkit takes too long on too many cases, we will have to look for an alternative.
- [x] Evaluate runtime. If scancode-toolkit takes too long on too many cases, we will have to look for an alternative.
- [x] Error of `LicenseTagIsInSpdxListCheck` must be a warning
- [ ] Idea: Create pull requests for package maintainers automatically.
- [ ] Error of `LicenseTagIsInSpdxListCheck` must be a warning

## License

Expand Down
89 changes: 0 additions & 89 deletions schemas/package_common.xsd

This file was deleted.

69 changes: 0 additions & 69 deletions schemas/package_format1.xsd

This file was deleted.

73 changes: 0 additions & 73 deletions schemas/package_format2.xsd

This file was deleted.

Loading