diff --git a/.codespellrc b/.codespellrc index cf10116..34d227d 100644 --- a/.codespellrc +++ b/.codespellrc @@ -6,4 +6,4 @@ ignore-words-list = , builtin = clear,informal,en-GB_to_en-US check-filenames = check-hidden = -skip = ./.git,./go.mod,./go.sum,./package-lock.json,./poetry.lock,./yarn.lock +skip = ./.git,./.licenses,./go.mod,./go.sum,./package-lock.json,./poetry.lock,./yarn.lock diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..fedf617 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,8 @@ +--- +# Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/minimal/bug-report.md +name: Bug report +about: Report a problem with the code or documentation in this repository. +title: "" +labels: "type: imperfection" +assignees: "" +--- diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..951859f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,16 @@ +# Source: +# https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/template-choosers/general/config.yml +# See: +# https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser + +blank_issues_enabled: false +contact_links: + - name: Learn about the Arduino Library Manager registry + url: https://github.com/arduino/library-registry#readme + about: arduino/library-registry-submission-parser is a component of the Arduino Library Manager registry infrastructure. + - name: Support request + url: https://forum.arduino.cc/ + about: We can help you out on the Arduino Forum! + - name: Discuss development work on the project + url: https://groups.google.com/a/arduino.cc/g/developers + about: Arduino Developers Mailing List diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000..081d58c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,8 @@ +--- +# Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/minimal/feature-request.md +name: Feature request +about: Suggest an enhancement to this project. +title: "" +labels: "type: enhancement" +assignees: "" +--- diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 575043a..0f80e5f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,6 +6,9 @@ updates: # See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot - package-ecosystem: github-actions directory: / # Check the repository's workflows under /.github/workflows/ + assignees: + - per1234 + open-pull-requests-limit: 100 schedule: interval: daily labels: @@ -13,6 +16,9 @@ updates: # Go dependencies - package-ecosystem: gomod directory: / + assignees: + - per1234 + open-pull-requests-limit: 100 schedule: interval: daily labels: @@ -20,6 +26,9 @@ updates: # Python dependencies - package-ecosystem: pip directory: / + assignees: + - per1234 + open-pull-requests-limit: 100 schedule: interval: daily labels: diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml new file mode 100644 index 0000000..f6cc4e9 --- /dev/null +++ b/.github/workflows/check-go-dependencies-task.yml @@ -0,0 +1,141 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-dependencies-task.md +name: Check Go Dependencies + +env: + # See: https://github.com/actions/setup-go/tree/main#supported-version-syntax + GO_VERSION: "1.17" + +# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows +on: + create: + push: + paths: + - ".github/workflows/check-go-dependencies-task.ya?ml" + - ".licenses/**" + - ".licensed.json" + - ".licensed.ya?ml" + - "Taskfile.ya?ml" + - "**/.gitmodules" + - "**/go.mod" + - "**/go.sum" + pull_request: + paths: + - ".github/workflows/check-go-dependencies-task.ya?ml" + - ".licenses/**" + - ".licensed.json" + - ".licensed.ya?ml" + - "Taskfile.ya?ml" + - "**/.gitmodules" + - "**/go.mod" + - "**/go.sum" + schedule: + # Run periodically to catch breakage caused by external changes. + - cron: "0 8 * * WED" + workflow_dispatch: + repository_dispatch: + +jobs: + run-determination: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. + if [[ + "${{ github.event_name }}" != "create" || + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "::set-output name=result::$RESULT" + + check-cache: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install licensed + uses: jonabc/setup-licensed@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Task + uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Update dependencies license metadata cache + run: task --silent general:cache-dep-licenses + + - name: Check for outdated cache + id: diff + run: | + git add . + if ! git diff --cached --color --exit-code; then + echo + echo "::error::Dependency license metadata out of sync. See: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-dependencies-task.md#metadata-cache" + exit 1 + fi + + # Some might find it convenient to have CI generate the cache rather than setting up for it locally + - name: Upload cache to workflow artifact + if: failure() && steps.diff.outcome == 'failure' + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + include-hidden-files: true + name: dep-licenses-cache + path: .licenses/ + + check-deps: + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install licensed + uses: jonabc/setup-licensed@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Task + uses: arduino/setup-task@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Check for dependencies with unapproved licenses + run: task --silent general:check-dep-licenses diff --git a/.github/workflows/check-go-task.yml b/.github/workflows/check-go-task.yml index 86eb4ce..114d292 100644 --- a/.github/workflows/check-go-task.yml +++ b/.github/workflows/check-go-task.yml @@ -2,8 +2,8 @@ name: Check Go env: - # See: https://github.com/actions/setup-go/tree/v2#readme - GO_VERSION: "1.16" + # See: https://github.com/actions/setup-go/tree/main#supported-version-syntax + GO_VERSION: "1.17" # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows on: @@ -41,15 +41,15 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: Install Task - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x @@ -72,15 +72,15 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: Install Task - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x @@ -106,15 +106,15 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: Install Task - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x @@ -140,15 +140,15 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: Install Task - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x @@ -174,10 +174,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} diff --git a/.github/workflows/check-license.yml b/.github/workflows/check-license.yml index 91ca62b..b8a6013 100644 --- a/.github/workflows/check-license.yml +++ b/.github/workflows/check-license.yml @@ -34,7 +34,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Ruby uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/check-prettier-formatting-task.yml b/.github/workflows/check-prettier-formatting-task.yml index b180ac0..d1fce0d 100644 --- a/.github/workflows/check-prettier-formatting-task.yml +++ b/.github/workflows/check-prettier-formatting-task.yml @@ -207,10 +207,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Task - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x diff --git a/.github/workflows/check-python-task.yml b/.github/workflows/check-python-task.yml index 375130d..dbbf3d2 100644 --- a/.github/workflows/check-python-task.yml +++ b/.github/workflows/check-python-task.yml @@ -2,7 +2,7 @@ name: Check Python env: - # See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python + # See: https://github.com/actions/setup-python/tree/main#available-versions-of-python PYTHON_VERSION: "3.9" # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows @@ -36,10 +36,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -47,13 +47,13 @@ jobs: run: pip install poetry - name: Install Task - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x - name: Run flake8 - uses: liskin/gh-problem-matcher-wrap@v1 + uses: liskin/gh-problem-matcher-wrap@v3 with: linters: flake8 run: task python:lint @@ -63,10 +63,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -74,7 +74,7 @@ jobs: run: pip install poetry - name: Install Task - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index de15e35..7eb6074 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,8 @@ name: Create Release env: - # See: https://github.com/actions/setup-go/tree/v2#readme - GO_VERSION: "1.16" + # See: https://github.com/actions/setup-go/tree/main#supported-version-syntax + GO_VERSION: "1.17" on: push: @@ -20,18 +20,18 @@ jobs: echo "CHANGELOG_PATH=${{ runner.temp }}/CHANGELOG.md" >> "$GITHUB_ENV" - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Taskfile - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} diff --git a/.github/workflows/spell-check-task.yml b/.github/workflows/spell-check-task.yml index 3b59435..9abc8f6 100644 --- a/.github/workflows/spell-check-task.yml +++ b/.github/workflows/spell-check-task.yml @@ -2,7 +2,7 @@ name: Spell Check env: - # See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python + # See: https://github.com/actions/setup-python/tree/main#available-versions-of-python PYTHON_VERSION: "3.9" # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows @@ -21,10 +21,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -32,7 +32,7 @@ jobs: run: pip install poetry - name: Install Task - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml new file mode 100644 index 0000000..514f29a --- /dev/null +++ b/.github/workflows/sync-labels.yml @@ -0,0 +1,139 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md +name: Sync Labels + +# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/sync-labels.ya?ml" + - ".github/label-configuration-files/*.ya?ml" + pull_request: + paths: + - ".github/workflows/sync-labels.ya?ml" + - ".github/label-configuration-files/*.ya?ml" + schedule: + # Run daily at 8 AM UTC to sync with changes to shared label configurations. + - cron: "0 8 * * *" + workflow_dispatch: + repository_dispatch: + +env: + CONFIGURATIONS_FOLDER: .github/label-configuration-files + CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file- + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download JSON schema for labels configuration file + id: download-schema + uses: carlosperate/download-file-action@v2 + with: + file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json + location: ${{ runner.temp }}/label-configuration-schema + + - name: Install JSON schema validator + run: | + sudo npm install \ + --global \ + ajv-cli \ + ajv-formats + + - name: Validate local labels configuration + run: | + # See: https://github.com/ajv-validator/ajv-cli#readme + ajv validate \ + --all-errors \ + -c ajv-formats \ + -s "${{ steps.download-schema.outputs.file-path }}" \ + -d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}" + + download: + needs: check + runs-on: ubuntu-latest + + strategy: + matrix: + filename: + # Filenames of the shared configurations to apply to the repository in addition to the local configuration. + # https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels + - universal.yml + + steps: + - name: Download + uses: carlosperate/download-file-action@v2 + with: + file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} + + - name: Pass configuration files to next job via workflow artifact + uses: actions/upload-artifact@v4 + with: + path: | + *.yaml + *.yml + if-no-files-found: error + name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}${{ matrix.filename }} + + sync: + needs: download + runs-on: ubuntu-latest + + steps: + - name: Set environment variables + run: | + # See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable + echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV" + + - name: Determine whether to dry run + id: dry-run + if: > + github.event_name == 'pull_request' || + ( + ( + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' + ) && + github.ref != format('refs/heads/{0}', github.event.repository.default_branch) + ) + run: | + # Use of this flag in the github-label-sync command will cause it to only check the validity of the + # configuration. + echo "::set-output name=flag::--dry-run" + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download configuration file artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true + pattern: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* + path: ${{ env.CONFIGURATIONS_FOLDER }} + + - name: Remove unneeded artifacts + uses: geekyeggo/delete-artifact@v5 + with: + name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* + + - name: Merge label configuration files + run: | + # Merge all configuration files + shopt -s extglob + cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}" + + - name: Install github-label-sync + run: sudo npm install --global github-label-sync + + - name: Sync labels + env: + GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # See: https://github.com/Financial-Times/github-label-sync + github-label-sync \ + --labels "${{ env.MERGED_CONFIGURATION_PATH }}" \ + ${{ steps.dry-run.outputs.flag }} \ + ${{ github.repository }} diff --git a/.github/workflows/test-go-integration-task.yml b/.github/workflows/test-go-integration-task.yml index 7a52a25..d54d646 100644 --- a/.github/workflows/test-go-integration-task.yml +++ b/.github/workflows/test-go-integration-task.yml @@ -2,9 +2,9 @@ name: Test Integration env: - # See: https://github.com/actions/setup-go/tree/v2#readme - GO_VERSION: "1.16" - # See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python + # See: https://github.com/actions/setup-go/tree/main#supported-version-syntax + GO_VERSION: "1.17" + # See: https://github.com/actions/setup-python/tree/main#available-versions-of-python PYTHON_VERSION: "3.9" # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows @@ -38,15 +38,15 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: Install Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} @@ -54,7 +54,7 @@ jobs: run: pip install poetry - name: Install Task - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x diff --git a/.github/workflows/test-go-task.yml b/.github/workflows/test-go-task.yml index 7c822f5..51842d1 100644 --- a/.github/workflows/test-go-task.yml +++ b/.github/workflows/test-go-task.yml @@ -2,8 +2,8 @@ name: Test Go env: - # See: https://github.com/actions/setup-go/tree/v2#readme - GO_VERSION: "1.16" + # See: https://github.com/actions/setup-go/tree/main#supported-version-syntax + GO_VERSION: "1.17" # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows on: @@ -46,15 +46,15 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: Install Task - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x @@ -66,7 +66,7 @@ jobs: - name: Send unit tests coverage to Codecov if: matrix.operating-system == 'ubuntu-latest' - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: file: ${{ matrix.module.path }}coverage_unit.txt flags: ${{ matrix.module.codecov-flags }} diff --git a/.gitignore b/.gitignore index bfde72f..1228ee4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Build artifacts -parser +/parser +!/parser/ parser.exe # Test artifacts diff --git a/.licensed.yml b/.licensed.yml new file mode 100644 index 0000000..aa03e1d --- /dev/null +++ b/.licensed.yml @@ -0,0 +1,84 @@ +# See: https://github.com/github/licensed/blob/master/docs/configuration.md +sources: + go: true + +apps: + - source_path: ./ + +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies/GPL-3.0/.licensed.yml +allowed: + # The following are based on: https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses + - gpl-1.0-or-later + - gpl-1.0+ # Deprecated ID for `gpl-1.0-or-later` + - gpl-2.0-or-later + - gpl-2.0+ # Deprecated ID for `gpl-2.0-or-later` + - gpl-3.0-only + - gpl-3.0 # Deprecated ID for `gpl-3.0-only` + - gpl-3.0-or-later + - gpl-3.0+ # Deprecated ID for `gpl-3.0-or-later` + - lgpl-2.0-or-later + - lgpl-2.0+ # Deprecated ID for `lgpl-2.0-or-later` + - lgpl-2.1-only + - lgpl-2.1 # Deprecated ID for `lgpl-2.1-only` + - lgpl-2.1-or-later + - lgpl-2.1+ # Deprecated ID for `lgpl-2.1-or-later` + - lgpl-3.0-only + - lgpl-3.0 # Deprecated ID for `lgpl-3.0-only` + - lgpl-3.0-or-later + - lgpl-3.0+ # Deprecated ID for `lgpl-3.0-or-later` + - fsfap + - apache-2.0 + - artistic-2.0 + - clartistic + - sleepycat + - bsl-1.0 + - bsd-3-clause + - cecill-2.0 + - bsd-3-clause-clear + # "Cryptix General License" - no SPDX ID (https://github.com/spdx/license-list-XML/issues/456) + - ecos-2.0 + - ecl-2.0 + - efl-2.0 + - eudatagrid + - mit + - bsd-2-clause # Subsumed by `bsd-2-clause-views` + - bsd-2-clause-netbsd # Deprecated ID for `bsd-2-clause` + - bsd-2-clause-views # This is the version linked from https://www.gnu.org/licenses/license-list.html#FreeBSD + - bsd-2-clause-freebsd # Deprecated ID for `bsd-2-clause-views` + - ftl + - hpnd + - imatix + - imlib2 + - ijg + # "Informal license" - this is a general class of license + - intel + - isc + - mpl-2.0 + - ncsa + # "License of Netscape JavaScript" - no SPDX ID + - oldap-2.7 + # "License of Perl 5 and below" - possibly `Artistic-1.0-Perl` ? + - cc0-1.0 + - cc-pddc + - psf-2.0 + - ruby + - sgi-b-2.0 + - smlnj + - standardml-nj # Deprecated ID for `smlnj` + - unicode-dfs-2015 + - upl-1.0 + - unlicense + - vim + - w3c + - wtfpl + - lgpl-2.0-or-later with wxwindows-exception-3.1 + - wxwindows # Deprecated ID for `lgpl-2.0-or-later with wxwindows-exception-3.1` + - x11 + - xfree86-1.1 + - zlib + - zpl-2.0 + - zpl-2.1 + # The following are based on individual license text + - eupl-1.2 + - liliq-r-1.1 + - liliq-rplus-1.1 diff --git a/.licenses/library-registry-submission-parser/go/github.com/arduino/go-paths-helper.dep.yml b/.licenses/library-registry-submission-parser/go/github.com/arduino/go-paths-helper.dep.yml new file mode 100644 index 0000000..0189936 --- /dev/null +++ b/.licenses/library-registry-submission-parser/go/github.com/arduino/go-paths-helper.dep.yml @@ -0,0 +1,350 @@ +--- +name: github.com/arduino/go-paths-helper +version: v1.12.1 +type: go +summary: +homepage: https://pkg.go.dev/github.com/arduino/go-paths-helper +license: gpl-2.0-or-later +licenses: +- sources: LICENSE + text: |2 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public + License is intended to guarantee your freedom to share and change free + software--to make sure the software is free for all its users. This + General Public License applies to most of the Free Software + Foundation's software and to any other program whose authors commit to + using it. (Some other Free Software Foundation software is covered by + the GNU Lesser General Public License instead.) You can apply it to + your programs, too. + + When we speak of free software, we are referring to freedom, not + price. Our General Public Licenses are designed to make sure that you + have the freedom to distribute copies of free software (and charge for + this service if you wish), that you receive source code or can get it + if you want it, that you can change the software or use pieces of it + in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid + anyone to deny you these rights or to ask you to surrender the rights. + These restrictions translate to certain responsibilities for you if you + distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether + gratis or for a fee, you must give the recipients all the rights that + you have. You must make sure that they, too, receive or can get the + source code. And you must show them these terms so they know their + rights. + + We protect your rights with two steps: (1) copyright the software, and + (2) offer you this license which gives you legal permission to copy, + distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain + that everyone understands that there is no warranty for this free + software. If the software is modified by someone else and passed on, we + want its recipients to know that what they have is not the original, so + that any problems introduced by others will not reflect on the original + authors' reputations. + + Finally, any free program is threatened constantly by software + patents. We wish to avoid the danger that redistributors of a free + program will individually obtain patent licenses, in effect making the + program proprietary. To prevent this, we have made it clear that any + patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and + modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains + a notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", below, + refers to any such program or work, and a "work based on the Program" + means either the Program or any derivative work under copyright law: + that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another + language. (Hereinafter, translation is included without limitation in + the term "modification".) Each licensee is addressed as "you". + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of + running the Program is not restricted, and the output from the Program + is covered only if its contents constitute a work based on the + Program (independent of having been made by running the Program). + Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's + source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any warranty; + and give any other recipients of the Program a copy of this License + along with the Program. + + You may charge a fee for the physical act of transferring a copy, and + you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work based + on the Program, the distribution of the whole must be on the terms of + this License, whose permissions for other licensees extend to the + entire whole, and thus to each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is to + exercise the right to control the distribution of derivative or + collective works based on the Program. + + In addition, mere aggregation of another work not based on the Program + with the Program (or with a work based on the Program) on a volume of + a storage or distribution medium does not bring the other work under + the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms of + Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete source + code means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the executable. However, as a + special exception, the source code distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of the + operating system on which the executable runs, unless that component + itself accompanies the executable. + + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this License. + However, parties who have received copies, or rights, from you under + this License will not have their licenses terminated so long as such + parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Program or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Program (or any work based on the + Program), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties to + this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you + may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program by + all those who receive copies directly or indirectly through you, then + the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended to + apply and the section as a whole is intended to apply in other + circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of any + such claims; this section has the sole purpose of protecting the + integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed to + be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions + of the General Public License from time to time. Such new versions will + be similar in spirit to the present version, but may differ in detail to + address new problems or concerns. + + Each version is given a distinguishing version number. If the Program + specifies a version number of this License which applies to it and "any + later version", you have the option of following the terms and conditions + either of that version or of any later version published by the Free + Software Foundation. If the Program does not specify a version number of + this License, you may choose any version ever published by the Free Software + Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the author + to ask for permission. For software which is copyrighted by the Free + Software Foundation, write to the Free Software Foundation; we sometimes + make exceptions for this. Our decision will be guided by the two goals + of preserving the free status of all derivatives of our free software and + of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, + REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it + free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest + to attach them to the start of each source file to most effectively + convey the exclusion of warranty; and each file should have at least + the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Also add information on how to contact you by electronic and paper mail. + + If the program is interactive, make it output a short notice like this + when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + + The hypothetical commands `show w' and `show c' should show the appropriate + parts of the General Public License. Of course, the commands you use may + be called something other than `show w' and `show c'; they could even be + mouse-clicks or menu items--whatever suits your program. + + You should also get your employer (if you work as a programmer) or your + school, if any, to sign a "copyright disclaimer" for the program, if + necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + + This General Public License does not permit incorporating your program into + proprietary programs. If your program is a subroutine library, you may + consider it more useful to permit linking proprietary applications with the + library. If this is what you want to do, use the GNU Lesser General + Public License instead of this License. +notices: [] diff --git a/.licenses/library-registry-submission-parser/go/github.com/arduino/go-properties-orderedmap.dep.yml b/.licenses/library-registry-submission-parser/go/github.com/arduino/go-properties-orderedmap.dep.yml new file mode 100644 index 0000000..07b731a --- /dev/null +++ b/.licenses/library-registry-submission-parser/go/github.com/arduino/go-properties-orderedmap.dep.yml @@ -0,0 +1,350 @@ +--- +name: github.com/arduino/go-properties-orderedmap +version: v1.8.1 +type: go +summary: Package properties is a library for handling maps of hierarchical properties. +homepage: https://pkg.go.dev/github.com/arduino/go-properties-orderedmap +license: gpl-2.0-or-later +licenses: +- sources: LICENSE + text: |2 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public + License is intended to guarantee your freedom to share and change free + software--to make sure the software is free for all its users. This + General Public License applies to most of the Free Software + Foundation's software and to any other program whose authors commit to + using it. (Some other Free Software Foundation software is covered by + the GNU Lesser General Public License instead.) You can apply it to + your programs, too. + + When we speak of free software, we are referring to freedom, not + price. Our General Public Licenses are designed to make sure that you + have the freedom to distribute copies of free software (and charge for + this service if you wish), that you receive source code or can get it + if you want it, that you can change the software or use pieces of it + in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid + anyone to deny you these rights or to ask you to surrender the rights. + These restrictions translate to certain responsibilities for you if you + distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether + gratis or for a fee, you must give the recipients all the rights that + you have. You must make sure that they, too, receive or can get the + source code. And you must show them these terms so they know their + rights. + + We protect your rights with two steps: (1) copyright the software, and + (2) offer you this license which gives you legal permission to copy, + distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain + that everyone understands that there is no warranty for this free + software. If the software is modified by someone else and passed on, we + want its recipients to know that what they have is not the original, so + that any problems introduced by others will not reflect on the original + authors' reputations. + + Finally, any free program is threatened constantly by software + patents. We wish to avoid the danger that redistributors of a free + program will individually obtain patent licenses, in effect making the + program proprietary. To prevent this, we have made it clear that any + patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and + modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains + a notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", below, + refers to any such program or work, and a "work based on the Program" + means either the Program or any derivative work under copyright law: + that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another + language. (Hereinafter, translation is included without limitation in + the term "modification".) Each licensee is addressed as "you". + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of + running the Program is not restricted, and the output from the Program + is covered only if its contents constitute a work based on the + Program (independent of having been made by running the Program). + Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's + source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any warranty; + and give any other recipients of the Program a copy of this License + along with the Program. + + You may charge a fee for the physical act of transferring a copy, and + you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work based + on the Program, the distribution of the whole must be on the terms of + this License, whose permissions for other licensees extend to the + entire whole, and thus to each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is to + exercise the right to control the distribution of derivative or + collective works based on the Program. + + In addition, mere aggregation of another work not based on the Program + with the Program (or with a work based on the Program) on a volume of + a storage or distribution medium does not bring the other work under + the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms of + Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete source + code means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the executable. However, as a + special exception, the source code distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of the + operating system on which the executable runs, unless that component + itself accompanies the executable. + + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this License. + However, parties who have received copies, or rights, from you under + this License will not have their licenses terminated so long as such + parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Program or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Program (or any work based on the + Program), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties to + this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you + may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program by + all those who receive copies directly or indirectly through you, then + the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended to + apply and the section as a whole is intended to apply in other + circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of any + such claims; this section has the sole purpose of protecting the + integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed to + be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions + of the General Public License from time to time. Such new versions will + be similar in spirit to the present version, but may differ in detail to + address new problems or concerns. + + Each version is given a distinguishing version number. If the Program + specifies a version number of this License which applies to it and "any + later version", you have the option of following the terms and conditions + either of that version or of any later version published by the Free + Software Foundation. If the Program does not specify a version number of + this License, you may choose any version ever published by the Free Software + Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the author + to ask for permission. For software which is copyrighted by the Free + Software Foundation, write to the Free Software Foundation; we sometimes + make exceptions for this. Our decision will be guided by the two goals + of preserving the free status of all derivatives of our free software and + of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, + REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it + free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest + to attach them to the start of each source file to most effectively + convey the exclusion of warranty; and each file should have at least + the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Also add information on how to contact you by electronic and paper mail. + + If the program is interactive, make it output a short notice like this + when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + + The hypothetical commands `show w' and `show c' should show the appropriate + parts of the General Public License. Of course, the commands you use may + be called something other than `show w' and `show c'; they could even be + mouse-clicks or menu items--whatever suits your program. + + You should also get your employer (if you work as a programmer) or your + school, if any, to sign a "copyright disclaimer" for the program, if + necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + + This General Public License does not permit incorporating your program into + proprietary programs. If your program is a subroutine library, you may + consider it more useful to permit linking proprietary applications with the + library. If this is what you want to do, use the GNU Lesser General + Public License instead of this License. +notices: [] diff --git a/.licenses/library-registry-submission-parser/go/github.com/sourcegraph/go-diff/diff.dep.yml b/.licenses/library-registry-submission-parser/go/github.com/sourcegraph/go-diff/diff.dep.yml new file mode 100644 index 0000000..b73bb98 --- /dev/null +++ b/.licenses/library-registry-submission-parser/go/github.com/sourcegraph/go-diff/diff.dep.yml @@ -0,0 +1,57 @@ +--- +name: github.com/sourcegraph/go-diff/diff +version: v0.7.0 +type: go +summary: Package diff provides a parser for unified diffs. +homepage: https://pkg.go.dev/github.com/sourcegraph/go-diff/diff +license: mit +licenses: +- sources: go-diff@v0.7.0/LICENSE + text: | + Copyright (c) 2014 Sourcegraph, Inc. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------- + + Portions adapted from python-unidiff: + + Copyright (c) 2012 Matias Bordese + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE + OR OTHER DEALINGS IN THE SOFTWARE. +notices: [] diff --git a/.licenses/library-registry-submission-parser/go/gopkg.in/yaml.v3.dep.yml b/.licenses/library-registry-submission-parser/go/gopkg.in/yaml.v3.dep.yml new file mode 100644 index 0000000..09288ff --- /dev/null +++ b/.licenses/library-registry-submission-parser/go/gopkg.in/yaml.v3.dep.yml @@ -0,0 +1,82 @@ +--- +name: gopkg.in/yaml.v3 +version: v3.0.1 +type: go +summary: Package yaml implements YAML support for the Go language. +homepage: https://pkg.go.dev/gopkg.in/yaml.v3 +# Apache-2.0 subsumes MIT +# https://www.gnu.org/licenses/license-compatibility.html#combining +license: apache-2.0 +licenses: +- sources: LICENSE + text: |2 + + This project is covered by two different licenses: MIT and Apache. + + #### MIT License #### + + The following files were ported to Go from C files of libyaml, and thus + are still covered by their original MIT license, with the additional + copyright staring in 2011 when the project was ported over: + + apic.go emitterc.go parserc.go readerc.go scannerc.go + writerc.go yamlh.go yamlprivateh.go + + Copyright (c) 2006-2010 Kirill Simonov + Copyright (c) 2006-2011 Kirill Simonov + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished to do + so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + + ### Apache License ### + + All the remaining project files are covered by the Apache license: + + Copyright (c) 2011-2019 Canonical Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +- sources: README.md + text: |- + The yaml package is licensed under the MIT and Apache License 2.0 licenses. + Please see the LICENSE file for details. +notices: +- sources: NOTICE + text: |- + Copyright 2011-2016 Canonical Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..b32a211 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +/.licenses/ diff --git a/README.md b/README.md index 31f5d8a..ccab938 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [![Check Python status](https://github.com/arduino/library-registry-submission-parser/actions/workflows/check-python-task.yml/badge.svg)](https://github.com/arduino/library-registry-submission-parser/actions/workflows/check-python-task.yml) [![Check Prettier Formatting status](https://github.com/arduino/library-registry-submission-parser/actions/workflows/check-prettier-formatting-task.yml/badge.svg)](https://github.com/arduino/library-registry-submission-parser/actions/workflows/check-prettier-formatting-task.yml) [![Spell Check status](https://github.com/arduino/library-registry-submission-parser/actions/workflows/spell-check-task.yml/badge.svg)](https://github.com/arduino/library-registry-submission-parser/actions/workflows/spell-check-task.yml) +[![Check Go Dependencies status](https://github.com/arduino/library-registry-submission-parser/actions/workflows/check-go-dependencies-task.yml/badge.svg)](https://github.com/arduino/library-registry-submission-parser/actions/workflows/check-go-dependencies-task.yml) This is the tool used to parse submissions to [the Arduino Library Manager registry](https://github.com/arduino/library-registry). diff --git a/Taskfile.yml b/Taskfile.yml index eeee419..91c5eac 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -112,6 +112,30 @@ tasks: cmds: - poetry run black . + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies-task/Taskfile.yml + general:cache-dep-licenses: + desc: Cache dependency license metadata + cmds: + - | + if ! which licensed &>/dev/null; then + if [[ "{{OS}}" == "windows" ]]; then + echo "Licensed does not have Windows support." + echo "Please use Linux/macOS or download the dependencies cache from the GitHub Actions workflow artifact." + else + echo "licensed not found or not in PATH. Please install: https://github.com/github/licensed#as-an-executable" + fi + exit 1 + fi + - licensed cache + + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies-task/Taskfile.yml + general:check-dep-licenses: + desc: Check for unapproved dependency licenses + deps: + - task: general:cache-dep-licenses + cmds: + - licensed status + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-prettier-formatting-task/Taskfile.yml general:format-prettier: desc: Format all supported files with Prettier diff --git a/go.mod b/go.mod index b9bd81a..bcf77bd 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,16 @@ module github.com/arduino/library-registry-submission-parser/parser -go 1.16 +go 1.17 require ( - github.com/arduino/go-paths-helper v1.6.1 - github.com/arduino/go-properties-orderedmap v1.7.0 - github.com/sourcegraph/go-diff v0.6.1 - github.com/stretchr/testify v1.7.0 + github.com/arduino/go-paths-helper v1.12.1 + github.com/arduino/go-properties-orderedmap v1.8.1 + github.com/sourcegraph/go-diff v0.7.0 + github.com/stretchr/testify v1.10.0 + gopkg.in/yaml.v3 v3.0.1 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect ) diff --git a/go.sum b/go.sum index 82ba368..f360623 100644 --- a/go.sum +++ b/go.sum @@ -1,26 +1,32 @@ github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= -github.com/arduino/go-paths-helper v1.6.1 h1:lha+/BuuBsx0qTZ3gy6IO1kU23lObWdQ/UItkzVWQ+0= -github.com/arduino/go-paths-helper v1.6.1/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU= -github.com/arduino/go-properties-orderedmap v1.7.0 h1:8bxVibJP+LjnyTFqsg3LsvgpAzovpuv0QQ6mXZXOxRs= -github.com/arduino/go-properties-orderedmap v1.7.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/arduino/go-paths-helper v1.12.1 h1:WkxiVUxBjKWlLMiMuYy8DcmVrkxdP7aKxQOAq7r2lVM= +github.com/arduino/go-paths-helper v1.12.1/go.mod h1:jcpW4wr0u69GlXhTYydsdsqAjLaYK5n7oWHfKqOG6LM= +github.com/arduino/go-properties-orderedmap v1.8.1 h1:nU5S6cXPwMoxZs4ORw61wPTALNfriIduvNB4cxTmNYM= +github.com/arduino/go-properties-orderedmap v1.8.1/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/sourcegraph/go-diff v0.6.1 h1:hmA1LzxW0n1c3Q4YbrFgg4P99GSnebYa3x8gr0HZqLQ= -github.com/sourcegraph/go-diff v0.6.1/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= +github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0= +github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main.go b/main.go index 1f1eb49..74a0470 100644 --- a/main.go +++ b/main.go @@ -34,6 +34,7 @@ import ( "strings" "github.com/sourcegraph/go-diff/diff" + "gopkg.in/yaml.v3" "github.com/arduino/go-paths-helper" properties "github.com/arduino/go-properties-orderedmap" @@ -67,8 +68,32 @@ var recommendedOrganizations []string = []string{ "github.com/adafruit", } +// accessType is the type of the access control level. +type accessType string + +const ( + // Allow allows unrestricted access. The entity can make requests even for library repositories whose owner is denied + // access. + Allow accessType = "allow" + // Default gives default access. The entity can make requests as long as the owner of the library's repository is not + // denied access. + Default = "default" + // Deny denies all access. The entity is not permitted to make requests, and registration of libraries from + // repositories they own is not permitted. + Deny = "deny" +) + +// accessDataType is the type of the access control data. +type accessDataType struct { + Access accessType `yaml:"access"` // Access level. + Host string `yaml:"host"` // Account host (e.g., `github.com`). + Name string `yaml:"name"` // User or organization account name. + Reference string `yaml:"reference"` // URL that provides additional information about the access control entry. +} + // request is the type of the request data. type request struct { + Conclusion string `json:"conclusion"` // Request conclusion. Type string `json:"type"` // Request type. ArduinoLintLibraryManagerSetting string `json:"arduinoLintLibraryManagerSetting"` // Argument to pass to Arduino Lint's --library-manager flag. Submissions []submissionType `json:"submissions"` // Data for submitted libraries. @@ -89,14 +114,23 @@ type submissionType struct { } // Command line flags. +// Path of the access control file, relative to repopath. +var accesslistArgument = flag.String("accesslist", "", "") var diffPathArgument = flag.String("diffpath", "", "") var repoPathArgument = flag.String("repopath", "", "") var listNameArgument = flag.String("listname", "", "") +// GitHub username of the user making the submission. +var submitterArgument = flag.String("submitter", "", "") + func main() { // Validate flag input. flag.Parse() + if *accesslistArgument == "" { + errorExit("--accesslist flag is required") + } + if *diffPathArgument == "" { errorExit("--diffpath flag is required") } @@ -109,8 +143,18 @@ func main() { errorExit("--listname flag is required") } + if *submitterArgument == "" { + errorExit("--submitter flag is required") + } + + accesslistPath := paths.New(*repoPathArgument, *accesslistArgument) + exist, err := accesslistPath.ExistCheck() + if !exist { + errorExit("Access control file not found") + } + diffPath := paths.New(*diffPathArgument) - exist, err := diffPath.ExistCheck() + exist, err = diffPath.ExistCheck() if !exist { errorExit("diff file not found") } @@ -121,23 +165,60 @@ func main() { errorExit(fmt.Sprintf("list file %s not found", listPath)) } - // Parse the PR diff. - rawDiff, err := diffPath.ReadFile() + rawAccessList, err := accesslistPath.ReadFile() if err != nil { panic(err) } + + // Unmarshal access control file. + var accessList []accessDataType + err = yaml.Unmarshal(rawAccessList, &accessList) + if err != nil { + errorExit(fmt.Sprintf("Access control file has invalid format:\n\n%s", err)) + } + var req request var submissionURLs []string - req.Type, req.Error, req.ArduinoLintLibraryManagerSetting, submissionURLs = parseDiff(rawDiff, *listNameArgument) + + // Determine access level of submitter. + var submitterAccess accessType = Default + for _, accessData := range accessList { + if accessData.Host == "github.com" && *submitterArgument == accessData.Name { + submitterAccess = accessData.Access + if submitterAccess == Deny { + req.Conclusion = "declined" + req.Type = "invalid" + req.Error = fmt.Sprintf("Library registry privileges for @%s have been revoked.%%0ASee: %s", *submitterArgument, accessData.Reference) + } + break + } + } + + if req.Error == "" { + // Parse the PR diff. + rawDiff, err := diffPath.ReadFile() + if err != nil { + panic(err) + } + req.Type, req.Error, req.ArduinoLintLibraryManagerSetting, submissionURLs = parseDiff(rawDiff, *listNameArgument) + } // Process the submissions. var indexEntries []string var indexerLogsURLs []string + allowedSubmissions := false for _, submissionURL := range submissionURLs { - submission, indexEntry := populateSubmission(submissionURL, listPath) + submission, indexEntry, allowed := populateSubmission(submissionURL, listPath, accessList, submitterAccess) req.Submissions = append(req.Submissions, submission) indexEntries = append(indexEntries, indexEntry) indexerLogsURLs = append(indexerLogsURLs, indexerLogsURL(submission.NormalizedURL)) + if allowed { + allowedSubmissions = true + } + } + if len(submissionURLs) > 0 && !allowedSubmissions { + // If none of the submissions are allowed, decline the request. + req.Conclusion = "declined" } // Check for duplicates within the submission itself. @@ -158,9 +239,9 @@ func main() { req.IndexerLogsURLs = strings.Join(indexerLogsURLs, "%0A") // Marshal the request data into a JSON document. - var marshalledRequest bytes.Buffer - jsonEncoder := json.NewEncoder(io.Writer(&marshalledRequest)) - // By default, the json package HTML-sanitizes strings during marshalling (https://golang.org/pkg/encoding/json/#Marshal) + var marshaledRequest bytes.Buffer + jsonEncoder := json.NewEncoder(io.Writer(&marshaledRequest)) + // By default, the json package HTML-sanitizes strings during marshaling (https://golang.org/pkg/encoding/json/#Marshal) // It's not possible to change this behavior when using the simple json.MarshalIndent() approach. jsonEncoder.SetEscapeHTML(false) jsonEncoder.SetIndent("", "") // Single line. @@ -169,7 +250,7 @@ func main() { panic(err) } - fmt.Println(marshalledRequest.String()) + fmt.Println(marshaledRequest.String()) } // errorExit prints the error message in a standardized format and exits with status 1. @@ -240,7 +321,7 @@ func parseDiff(rawDiff []byte, listName string) (string, string, string, []strin } // populateSubmission does the checks on the submission that aren't provided by Arduino Lint and gathers the necessary data on it. -func populateSubmission(submissionURL string, listPath *paths.Path) (submissionType, string) { +func populateSubmission(submissionURL string, listPath *paths.Path, accessList []accessDataType, submitterAccess accessType) (submissionType, string, bool) { indexSourceSeparator := "|" var submission submissionType @@ -250,18 +331,18 @@ func populateSubmission(submissionURL string, listPath *paths.Path) (submissionT submissionURLObject, err := url.Parse(submission.SubmissionURL) if err != nil { submission.Error = fmt.Sprintf("Invalid submission URL (%s)", err) - return submission, "" + return submission, "", true } // Check if URL is accessible. httpResponse, err := http.Get(submissionURLObject.String()) if err != nil { submission.Error = fmt.Sprintf("Unable to load submission URL: %s", err) - return submission, "" + return submission, "", true } if httpResponse.StatusCode != http.StatusOK { submission.Error = "Unable to load submission URL. Is the repository public?" - return submission, "" + return submission, "", true } // Resolve redirects and normalize. @@ -269,10 +350,21 @@ func populateSubmission(submissionURL string, listPath *paths.Path) (submissionT submission.NormalizedURL = normalizedURLObject.String() + if submitterAccess != Allow { + // Check library repository owner access. + for _, accessData := range accessList { + ownerSlug := fmt.Sprintf("%s/%s", accessData.Host, accessData.Name) + if accessData.Access == Deny && uRLIsUnder(normalizedURLObject, []string{ownerSlug}) { + submission.Error = fmt.Sprintf("Library registry privileges for library repository owner `%s` have been revoked.%%0ASee: %s", ownerSlug, accessData.Reference) + return submission, "", false + } + } + } + // Check if URL is from a supported Git host. if !uRLIsUnder(normalizedURLObject, supportedHosts) { submission.Error = fmt.Sprintf("`%s` is not currently supported as a Git hosting website for Library Manager.%%0A%%0ASee: https://github.com/arduino/library-registry/blob/main/FAQ.md#what-are-the-requirements-for-a-library-to-be-added-to-library-manager", normalizedURLObject.Host) - return submission, "" + return submission, "", true } // Check if URL is a Git repository @@ -280,7 +372,7 @@ func populateSubmission(submissionURL string, listPath *paths.Path) (submissionT if err != nil { if _, ok := err.(*exec.ExitError); ok { submission.Error = "Submission URL is not a Git clone URL (e.g., `https://github.com/arduino-libraries/Servo`)." - return submission, "" + return submission, "", true } panic(err) @@ -299,7 +391,7 @@ func populateSubmission(submissionURL string, listPath *paths.Path) (submissionT normalizedListURLObject := normalizeURL(listURLObject) if normalizedListURLObject.String() == normalizedURLObject.String() { submission.Error = "Submission URL is already in the Library Manager index." - return submission, "" + return submission, "", true } } @@ -344,7 +436,7 @@ func populateSubmission(submissionURL string, listPath *paths.Path) (submissionT } if string(tagList) == "" { submission.Error = "The repository has no tags. You need to create a [release](https://docs.github.com/en/github/administering-a-repository/managing-releases-in-a-repository) or [tag](https://git-scm.com/docs/git-tag) that matches the `version` value in the library's library.properties file." - return submission, "" + return submission, "", true } latestTag, err := exec.Command("git", "describe", "--tags", strings.TrimSpace(string(tagList))).Output() if err != nil { @@ -362,18 +454,18 @@ func populateSubmission(submissionURL string, listPath *paths.Path) (submissionT libraryPropertiesPath := submissionClonePath.Join("library.properties") if !libraryPropertiesPath.Exist() { submission.Error = "Library is missing a library.properties metadata file.%0A%0ASee: https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata" - return submission, "" + return submission, "", true } libraryProperties, err := properties.LoadFromPath(libraryPropertiesPath) if err != nil { submission.Error = fmt.Sprintf("Invalid library.properties file: %s%%0A%%0ASee: https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata", err) - return submission, "" + return submission, "", true } var ok bool submission.Name, ok = libraryProperties.GetOk("name") if !ok { submission.Error = "library.properties is missing a name field.%0A%0ASee: https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata" - return submission, "" + return submission, "", true } // Assemble Library Manager index source entry string @@ -386,7 +478,7 @@ func populateSubmission(submissionURL string, listPath *paths.Path) (submissionT indexSourceSeparator, ) - return submission, indexEntry + return submission, indexEntry, true } // normalizeURL converts the URL into the standardized format used in the index. diff --git a/poetry.lock b/poetry.lock index fa56509..25f13d2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,396 +1,300 @@ -[[package]] -name = "appdirs" -version = "1.4.4" -description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" -optional = false -python-versions = "*" - -[[package]] -name = "atomicwrites" -version = "1.4.0" -description = "Atomic file writes." -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - -[[package]] -name = "attrs" -version = "21.2.0" -description = "Classes Without Boilerplate" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[package.extras] -dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit"] -docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] -tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"] -tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"] +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "black" -version = "21.7b0" +version = "24.10.0" description = "The uncompromising code formatter." -category = "dev" optional = false -python-versions = ">=3.6.2" +python-versions = ">=3.9" +files = [ + {file = "black-24.10.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e6668650ea4b685440857138e5fe40cde4d652633b1bdffc62933d0db4ed9812"}, + {file = "black-24.10.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1c536fcf674217e87b8cc3657b81809d3c085d7bf3ef262ead700da345bfa6ea"}, + {file = "black-24.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:649fff99a20bd06c6f727d2a27f401331dc0cc861fb69cde910fe95b01b5928f"}, + {file = "black-24.10.0-cp310-cp310-win_amd64.whl", hash = "sha256:fe4d6476887de70546212c99ac9bd803d90b42fc4767f058a0baa895013fbb3e"}, + {file = "black-24.10.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5a2221696a8224e335c28816a9d331a6c2ae15a2ee34ec857dcf3e45dbfa99ad"}, + {file = "black-24.10.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f9da3333530dbcecc1be13e69c250ed8dfa67f43c4005fb537bb426e19200d50"}, + {file = "black-24.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4007b1393d902b48b36958a216c20c4482f601569d19ed1df294a496eb366392"}, + {file = "black-24.10.0-cp311-cp311-win_amd64.whl", hash = "sha256:394d4ddc64782e51153eadcaaca95144ac4c35e27ef9b0a42e121ae7e57a9175"}, + {file = "black-24.10.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b5e39e0fae001df40f95bd8cc36b9165c5e2ea88900167bddf258bacef9bbdc3"}, + {file = "black-24.10.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d37d422772111794b26757c5b55a3eade028aa3fde43121ab7b673d050949d65"}, + {file = "black-24.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:14b3502784f09ce2443830e3133dacf2c0110d45191ed470ecb04d0f5f6fcb0f"}, + {file = "black-24.10.0-cp312-cp312-win_amd64.whl", hash = "sha256:30d2c30dc5139211dda799758559d1b049f7f14c580c409d6ad925b74a4208a8"}, + {file = "black-24.10.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1cbacacb19e922a1d75ef2b6ccaefcd6e93a2c05ede32f06a21386a04cedb981"}, + {file = "black-24.10.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1f93102e0c5bb3907451063e08b9876dbeac810e7da5a8bfb7aeb5a9ef89066b"}, + {file = "black-24.10.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ddacb691cdcdf77b96f549cf9591701d8db36b2f19519373d60d31746068dbf2"}, + {file = "black-24.10.0-cp313-cp313-win_amd64.whl", hash = "sha256:680359d932801c76d2e9c9068d05c6b107f2584b2a5b88831c83962eb9984c1b"}, + {file = "black-24.10.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:17374989640fbca88b6a448129cd1745c5eb8d9547b464f281b251dd00155ccd"}, + {file = "black-24.10.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:63f626344343083322233f175aaf372d326de8436f5928c042639a4afbbf1d3f"}, + {file = "black-24.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfa1d0cb6200857f1923b602f978386a3a2758a65b52e0950299ea014be6800"}, + {file = "black-24.10.0-cp39-cp39-win_amd64.whl", hash = "sha256:2cd9c95431d94adc56600710f8813ee27eea544dd118d45896bb734e9d7a0dc7"}, + {file = "black-24.10.0-py3-none-any.whl", hash = "sha256:3bb2b7a1f7b685f85b11fed1ef10f8a9148bceb49853e47a294a3dd963c1dd7d"}, + {file = "black-24.10.0.tar.gz", hash = "sha256:846ea64c97afe3bc677b761787993be4991810ecc7a4a937816dd6bddedc4875"}, +] [package.dependencies] -appdirs = "*" -click = ">=7.1.2" +click = ">=8.0.0" mypy-extensions = ">=0.4.3" -pathspec = ">=0.8.1,<1" -regex = ">=2020.1.8" -tomli = ">=0.2.6,<2.0.0" +packaging = ">=22.0" +pathspec = ">=0.9.0" +platformdirs = ">=2" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} [package.extras] colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.6.0)", "aiohttp-cors (>=0.4.0)"] -python2 = ["typed-ast (>=1.4.2)"] +d = ["aiohttp (>=3.10)"] +jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "click" version = "8.0.1" description = "Composable command line interface toolkit" -category = "dev" optional = false python-versions = ">=3.6" +files = [ + {file = "click-8.0.1-py3-none-any.whl", hash = "sha256:fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6"}, + {file = "click-8.0.1.tar.gz", hash = "sha256:8c04c11192119b1ef78ea049e0a6f0463e4c48ef00a30160c704337586f3ad7a"}, +] [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} [[package]] name = "codespell" -version = "2.1.0" +version = "2.3.0" description = "Codespell" -category = "dev" optional = false -python-versions = ">=3.5" +python-versions = ">=3.8" +files = [ + {file = "codespell-2.3.0-py3-none-any.whl", hash = "sha256:a9c7cef2501c9cfede2110fd6d4e5e62296920efe9abfb84648df866e47f58d1"}, + {file = "codespell-2.3.0.tar.gz", hash = "sha256:360c7d10f75e65f67bad720af7007e1060a5d395670ec11a7ed1fed9dd17471f"}, +] [package.extras] -dev = ["check-manifest", "flake8", "pytest", "pytest-cov", "pytest-dependency"] +dev = ["Pygments", "build", "chardet", "pre-commit", "pytest", "pytest-cov", "pytest-dependency", "ruff", "tomli", "twine"] hard-encoding-detection = ["chardet"] +toml = ["tomli"] +types = ["chardet (>=5.1.0)", "mypy", "pytest", "pytest-cov", "pytest-dependency"] [[package]] name = "colorama" version = "0.4.4" description = "Cross-platform colored terminal text." -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, + {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, +] [[package]] -name = "flake8" -version = "3.9.2" -description = "the modular source code checker: pep8 pyflakes and co" -category = "dev" +name = "exceptiongroup" +version = "1.0.0rc9" +description = "Backport of PEP 654 (exception groups)" optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.0.0rc9-py3-none-any.whl", hash = "sha256:2e3c3fc1538a094aab74fad52d6c33fc94de3dfee3ee01f187c0e0c72aec5337"}, + {file = "exceptiongroup-1.0.0rc9.tar.gz", hash = "sha256:9086a4a21ef9b31c72181c77c040a074ba0889ee56a7b289ff0afb0d97655f96"}, +] -[package.dependencies] -mccabe = ">=0.6.0,<0.7.0" -pycodestyle = ">=2.7.0,<2.8.0" -pyflakes = ">=2.3.0,<2.4.0" +[package.extras] +test = ["pytest (>=6)"] [[package]] -name = "flake8-polyfill" -version = "1.0.2" -description = "Polyfill package for Flake8 plugins" -category = "dev" +name = "flake8" +version = "7.1.1" +description = "the modular source code checker: pep8 pyflakes and co" optional = false -python-versions = "*" +python-versions = ">=3.8.1" +files = [ + {file = "flake8-7.1.1-py2.py3-none-any.whl", hash = "sha256:597477df7860daa5aa0fdd84bf5208a043ab96b8e96ab708770ae0364dd03213"}, + {file = "flake8-7.1.1.tar.gz", hash = "sha256:049d058491e228e03e67b390f311bbf88fce2dbaa8fa673e7aea87b7198b8d38"}, +] [package.dependencies] -flake8 = "*" +mccabe = ">=0.7.0,<0.8.0" +pycodestyle = ">=2.12.0,<2.13.0" +pyflakes = ">=3.2.0,<3.3.0" [[package]] name = "iniconfig" version = "1.1.1" description = "iniconfig: brain-dead simple config-ini parsing" -category = "dev" optional = false python-versions = "*" +files = [ + {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, + {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, +] [[package]] name = "invoke" -version = "1.6.0" +version = "2.2.0" description = "Pythonic task execution" -category = "dev" optional = false -python-versions = "*" +python-versions = ">=3.6" +files = [ + {file = "invoke-2.2.0-py3-none-any.whl", hash = "sha256:6ea924cc53d4f78e3d98bc436b08069a03077e6f85ad1ddaa8a116d7dad15820"}, + {file = "invoke-2.2.0.tar.gz", hash = "sha256:ee6cbb101af1a859c7fe84f2a264c059020b0cb7fe3535f9424300ab568f6bd5"}, +] [[package]] name = "mccabe" -version = "0.6.1" +version = "0.7.0" description = "McCabe checker, plugin for flake8" -category = "dev" optional = false -python-versions = "*" +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] [[package]] name = "mypy-extensions" version = "0.4.3" description = "Experimental type system extensions for programs checked with the mypy typechecker." -category = "dev" optional = false python-versions = "*" +files = [ + {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, + {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, +] [[package]] name = "packaging" -version = "21.0" +version = "23.0" description = "Core utilities for Python packages" -category = "dev" optional = false -python-versions = ">=3.6" - -[package.dependencies] -pyparsing = ">=2.0.2" +python-versions = ">=3.7" +files = [ + {file = "packaging-23.0-py3-none-any.whl", hash = "sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2"}, + {file = "packaging-23.0.tar.gz", hash = "sha256:b6ad297f8907de0fa2fe1ccbd26fdaf387f5f47c7275fedf8cce89f99446cf97"}, +] [[package]] name = "pathspec" version = "0.9.0" description = "Utility library for gitignore style pattern matching of file paths." -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" +files = [ + {file = "pathspec-0.9.0-py2.py3-none-any.whl", hash = "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a"}, + {file = "pathspec-0.9.0.tar.gz", hash = "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1"}, +] [[package]] name = "pep8-naming" -version = "0.12.1" +version = "0.14.1" description = "Check PEP-8 naming conventions, plugin for flake8" -category = "dev" optional = false -python-versions = "*" +python-versions = ">=3.8" +files = [ + {file = "pep8-naming-0.14.1.tar.gz", hash = "sha256:1ef228ae80875557eb6c1549deafed4dabbf3261cfcafa12f773fe0db9be8a36"}, + {file = "pep8_naming-0.14.1-py3-none-any.whl", hash = "sha256:63f514fc777d715f935faf185dedd679ab99526a7f2f503abb61587877f7b1c5"}, +] [package.dependencies] -flake8 = ">=3.9.1" -flake8-polyfill = ">=1.0.2,<2" +flake8 = ">=5.0.0" [[package]] -name = "pluggy" -version = "0.13.1" -description = "plugin and hook calling mechanisms for python" -category = "dev" +name = "platformdirs" +version = "2.2.0" +description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = ">=3.6" +files = [ + {file = "platformdirs-2.2.0-py3-none-any.whl", hash = "sha256:4666d822218db6a262bdfdc9c39d21f23b4cfdb08af331a81e92751daf6c866c"}, + {file = "platformdirs-2.2.0.tar.gz", hash = "sha256:632daad3ab546bd8e6af0537d09805cec458dce201bccfe23012df73332e181e"}, +] [package.extras] -dev = ["pre-commit", "tox"] +docs = ["Sphinx (>=4)", "furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx-autodoc-typehints (>=1.12)"] +test = ["appdirs (==1.4.4)", "pytest (>=6)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)"] [[package]] -name = "py" -version = "1.10.0" -description = "library with cross-python path, ini-parsing, io, code, log facilities" -category = "dev" +name = "pluggy" +version = "1.5.0" +description = "plugin and hook calling mechanisms for python" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = ">=3.8" +files = [ + {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, + {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] [[package]] name = "pycodestyle" -version = "2.7.0" +version = "2.12.0" description = "Python style guide checker" -category = "dev" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = ">=3.8" +files = [ + {file = "pycodestyle-2.12.0-py2.py3-none-any.whl", hash = "sha256:949a39f6b86c3e1515ba1787c2022131d165a8ad271b11370a8819aa070269e4"}, + {file = "pycodestyle-2.12.0.tar.gz", hash = "sha256:442f950141b4f43df752dd303511ffded3a04c2b6fb7f65980574f0c31e6e79c"}, +] [[package]] name = "pyflakes" -version = "2.3.1" +version = "3.2.0" description = "passive checker of Python programs" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - -[[package]] -name = "pyparsing" -version = "2.4.7" -description = "Python parsing module" -category = "dev" optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +python-versions = ">=3.8" +files = [ + {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, + {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, +] [[package]] name = "pytest" -version = "6.2.4" +version = "8.3.4" description = "pytest: simple powerful testing with Python" -category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" +files = [ + {file = "pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6"}, + {file = "pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761"}, +] [package.dependencies] -atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} -attrs = ">=19.2.0" colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" -pluggy = ">=0.12,<1.0.0a1" -py = ">=1.8.2" -toml = "*" +pluggy = ">=1.5,<2" +tomli = {version = ">=1", markers = "python_version < \"3.11\""} [package.extras] -testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] - -[[package]] -name = "regex" -version = "2021.8.3" -description = "Alternative regular expression module, to replace re." -category = "dev" -optional = false -python-versions = "*" - -[[package]] -name = "toml" -version = "0.10.2" -description = "Python Library for Tom's Obvious, Minimal Language" -category = "dev" -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] [[package]] name = "tomli" version = "1.2.1" description = "A lil' TOML parser" -category = "dev" optional = false python-versions = ">=3.6" - -[metadata] -lock-version = "1.1" -python-versions = "^3.9" -content-hash = "83c2e46d6c4d0dcffffb97cf58677912d5dfde983291a12b794f92909dbeca61" - -[metadata.files] -appdirs = [ - {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, - {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, -] -atomicwrites = [ - {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, - {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, -] -attrs = [ - {file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"}, - {file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"}, -] -black = [ - {file = "black-21.7b0-py3-none-any.whl", hash = "sha256:1c7aa6ada8ee864db745b22790a32f94b2795c253a75d6d9b5e439ff10d23116"}, - {file = "black-21.7b0.tar.gz", hash = "sha256:c8373c6491de9362e39271630b65b964607bc5c79c83783547d76c839b3aa219"}, -] -click = [ - {file = "click-8.0.1-py3-none-any.whl", hash = "sha256:fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6"}, - {file = "click-8.0.1.tar.gz", hash = "sha256:8c04c11192119b1ef78ea049e0a6f0463e4c48ef00a30160c704337586f3ad7a"}, -] -codespell = [ - {file = "codespell-2.1.0-py3-none-any.whl", hash = "sha256:b864c7d917316316ac24272ee992d7937c3519be4569209c5b60035ac5d569b5"}, - {file = "codespell-2.1.0.tar.gz", hash = "sha256:19d3fe5644fef3425777e66f225a8c82d39059dcfe9edb3349a8a2cf48383ee5"}, -] -colorama = [ - {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, - {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, -] -flake8 = [ - {file = "flake8-3.9.2-py2.py3-none-any.whl", hash = "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5101e25e3110907"}, - {file = "flake8-3.9.2.tar.gz", hash = "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b"}, -] -flake8-polyfill = [ - {file = "flake8-polyfill-1.0.2.tar.gz", hash = "sha256:e44b087597f6da52ec6393a709e7108b2905317d0c0b744cdca6208e670d8eda"}, - {file = "flake8_polyfill-1.0.2-py2.py3-none-any.whl", hash = "sha256:12be6a34ee3ab795b19ca73505e7b55826d5f6ad7230d31b18e106400169b9e9"}, -] -iniconfig = [ - {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, - {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, -] -invoke = [ - {file = "invoke-1.6.0-py2-none-any.whl", hash = "sha256:e6c9917a1e3e73e7ea91fdf82d5f151ccfe85bf30cc65cdb892444c02dbb5f74"}, - {file = "invoke-1.6.0-py3-none-any.whl", hash = "sha256:769e90caeb1bd07d484821732f931f1ad8916a38e3f3e618644687fc09cb6317"}, - {file = "invoke-1.6.0.tar.gz", hash = "sha256:374d1e2ecf78981da94bfaf95366216aaec27c2d6a7b7d5818d92da55aa258d3"}, -] -mccabe = [ - {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, - {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, -] -mypy-extensions = [ - {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, - {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, -] -packaging = [ - {file = "packaging-21.0-py3-none-any.whl", hash = "sha256:c86254f9220d55e31cc94d69bade760f0847da8000def4dfe1c6b872fd14ff14"}, - {file = "packaging-21.0.tar.gz", hash = "sha256:7dc96269f53a4ccec5c0670940a4281106dd0bb343f47b7471f779df49c2fbe7"}, -] -pathspec = [ - {file = "pathspec-0.9.0-py2.py3-none-any.whl", hash = "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a"}, - {file = "pathspec-0.9.0.tar.gz", hash = "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1"}, -] -pep8-naming = [ - {file = "pep8-naming-0.12.1.tar.gz", hash = "sha256:bb2455947757d162aa4cad55dba4ce029005cd1692f2899a21d51d8630ca7841"}, - {file = "pep8_naming-0.12.1-py2.py3-none-any.whl", hash = "sha256:4a8daeaeb33cfcde779309fc0c9c0a68a3bbe2ad8a8308b763c5068f86eb9f37"}, -] -pluggy = [ - {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, - {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, -] -py = [ - {file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"}, - {file = "py-1.10.0.tar.gz", hash = "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3"}, -] -pycodestyle = [ - {file = "pycodestyle-2.7.0-py2.py3-none-any.whl", hash = "sha256:514f76d918fcc0b55c6680472f0a37970994e07bbb80725808c17089be302068"}, - {file = "pycodestyle-2.7.0.tar.gz", hash = "sha256:c389c1d06bf7904078ca03399a4816f974a1d590090fecea0c63ec26ebaf1cef"}, -] -pyflakes = [ - {file = "pyflakes-2.3.1-py2.py3-none-any.whl", hash = "sha256:7893783d01b8a89811dd72d7dfd4d84ff098e5eed95cfa8905b22bbffe52efc3"}, - {file = "pyflakes-2.3.1.tar.gz", hash = "sha256:f5bc8ecabc05bb9d291eb5203d6810b49040f6ff446a756326104746cc00c1db"}, -] -pyparsing = [ - {file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, - {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, -] -pytest = [ - {file = "pytest-6.2.4-py3-none-any.whl", hash = "sha256:91ef2131a9bd6be8f76f1f08eac5c5317221d6ad1e143ae03894b862e8976890"}, - {file = "pytest-6.2.4.tar.gz", hash = "sha256:50bcad0a0b9c5a72c8e4e7c9855a3ad496ca6a881a3641b4260605450772c54b"}, -] -regex = [ - {file = "regex-2021.8.3-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:8764a78c5464ac6bde91a8c87dd718c27c1cabb7ed2b4beaf36d3e8e390567f9"}, - {file = "regex-2021.8.3-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4551728b767f35f86b8e5ec19a363df87450c7376d7419c3cac5b9ceb4bce576"}, - {file = "regex-2021.8.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:577737ec3d4c195c4aef01b757905779a9e9aee608fa1cf0aec16b5576c893d3"}, - {file = "regex-2021.8.3-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:c856ec9b42e5af4fe2d8e75970fcc3a2c15925cbcc6e7a9bcb44583b10b95e80"}, - {file = "regex-2021.8.3-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3835de96524a7b6869a6c710b26c90e94558c31006e96ca3cf6af6751b27dca1"}, - {file = "regex-2021.8.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:cea56288eeda8b7511d507bbe7790d89ae7049daa5f51ae31a35ae3c05408531"}, - {file = "regex-2021.8.3-cp36-cp36m-win32.whl", hash = "sha256:a4eddbe2a715b2dd3849afbdeacf1cc283160b24e09baf64fa5675f51940419d"}, - {file = "regex-2021.8.3-cp36-cp36m-win_amd64.whl", hash = "sha256:57fece29f7cc55d882fe282d9de52f2f522bb85290555b49394102f3621751ee"}, - {file = "regex-2021.8.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a5c6dbe09aff091adfa8c7cfc1a0e83fdb8021ddb2c183512775a14f1435fe16"}, - {file = "regex-2021.8.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ff4a8ad9638b7ca52313d8732f37ecd5fd3c8e3aff10a8ccb93176fd5b3812f6"}, - {file = "regex-2021.8.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b63e3571b24a7959017573b6455e05b675050bbbea69408f35f3cb984ec54363"}, - {file = "regex-2021.8.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:fbc20975eee093efa2071de80df7f972b7b35e560b213aafabcec7c0bd00bd8c"}, - {file = "regex-2021.8.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:14caacd1853e40103f59571f169704367e79fb78fac3d6d09ac84d9197cadd16"}, - {file = "regex-2021.8.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:bb350eb1060591d8e89d6bac4713d41006cd4d479f5e11db334a48ff8999512f"}, - {file = "regex-2021.8.3-cp37-cp37m-win32.whl", hash = "sha256:18fdc51458abc0a974822333bd3a932d4e06ba2a3243e9a1da305668bd62ec6d"}, - {file = "regex-2021.8.3-cp37-cp37m-win_amd64.whl", hash = "sha256:026beb631097a4a3def7299aa5825e05e057de3c6d72b139c37813bfa351274b"}, - {file = "regex-2021.8.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:16d9eaa8c7e91537516c20da37db975f09ac2e7772a0694b245076c6d68f85da"}, - {file = "regex-2021.8.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3905c86cc4ab6d71635d6419a6f8d972cab7c634539bba6053c47354fd04452c"}, - {file = "regex-2021.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:937b20955806381e08e54bd9d71f83276d1f883264808521b70b33d98e4dec5d"}, - {file = "regex-2021.8.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:28e8af338240b6f39713a34e337c3813047896ace09d51593d6907c66c0708ba"}, - {file = "regex-2021.8.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c09d88a07483231119f5017904db8f60ad67906efac3f1baa31b9b7f7cca281"}, - {file = "regex-2021.8.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:85f568892422a0e96235eb8ea6c5a41c8ccbf55576a2260c0160800dbd7c4f20"}, - {file = "regex-2021.8.3-cp38-cp38-win32.whl", hash = "sha256:bf6d987edd4a44dd2fa2723fca2790f9442ae4de2c8438e53fcb1befdf5d823a"}, - {file = "regex-2021.8.3-cp38-cp38-win_amd64.whl", hash = "sha256:8fe58d9f6e3d1abf690174fd75800fda9bdc23d2a287e77758dc0e8567e38ce6"}, - {file = "regex-2021.8.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7976d410e42be9ae7458c1816a416218364e06e162b82e42f7060737e711d9ce"}, - {file = "regex-2021.8.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9569da9e78f0947b249370cb8fadf1015a193c359e7e442ac9ecc585d937f08d"}, - {file = "regex-2021.8.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:459bbe342c5b2dec5c5223e7c363f291558bc27982ef39ffd6569e8c082bdc83"}, - {file = "regex-2021.8.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:4f421e3cdd3a273bace013751c345f4ebeef08f05e8c10757533ada360b51a39"}, - {file = "regex-2021.8.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ea212df6e5d3f60341aef46401d32fcfded85593af1d82b8b4a7a68cd67fdd6b"}, - {file = "regex-2021.8.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:a3b73390511edd2db2d34ff09aa0b2c08be974c71b4c0505b4a048d5dc128c2b"}, - {file = "regex-2021.8.3-cp39-cp39-win32.whl", hash = "sha256:f35567470ee6dbfb946f069ed5f5615b40edcbb5f1e6e1d3d2b114468d505fc6"}, - {file = "regex-2021.8.3-cp39-cp39-win_amd64.whl", hash = "sha256:bfa6a679410b394600eafd16336b2ce8de43e9b13f7fb9247d84ef5ad2b45e91"}, - {file = "regex-2021.8.3.tar.gz", hash = "sha256:8935937dad2c9b369c3d932b0edbc52a62647c2afb2fafc0c280f14a8bf56a6a"}, -] -toml = [ - {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, - {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, -] -tomli = [ +files = [ {file = "tomli-1.2.1-py3-none-any.whl", hash = "sha256:8dd0e9524d6f386271a36b41dbf6c57d8e32fd96fd22b6584679dc569d20899f"}, {file = "tomli-1.2.1.tar.gz", hash = "sha256:a5b75cb6f3968abb47af1b40c1819dc519ea82bcc065776a866e8d74c5ca9442"}, ] + +[[package]] +name = "typing-extensions" +version = "4.7.1" +description = "Backported and Experimental Type Hints for Python 3.7+" +optional = false +python-versions = ">=3.7" +files = [ + {file = "typing_extensions-4.7.1-py3-none-any.whl", hash = "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36"}, + {file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"}, +] + +[metadata] +lock-version = "2.0" +python-versions = "^3.9" +content-hash = "af58401d674f5a2167da37a4eda819642ee118c10818d022c8b4f0d695ea49b7" diff --git a/pyproject.toml b/pyproject.toml index f20f163..1ff2aaf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,12 +8,12 @@ authors = ["Arduino "] python = "^3.9" [tool.poetry.dev-dependencies] -black = "^21.7b0" -flake8 = "^3.9.2" -pep8-naming = "^0.12.1" -codespell = "^2.1.0" -pytest = "6.2.4" -invoke = "1.6.0" +black = "^24.10" +flake8 = "^7.1.1" +pep8-naming = "^0.14.1" +codespell = "^2.3.0" +pytest = "8.3.4" +invoke = "2.2.0" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/tests/test_all.py b/tests/test_all.py index 449c3e8..70668f1 100644 --- a/tests/test_all.py +++ b/tests/test_all.py @@ -22,27 +22,66 @@ @pytest.mark.parametrize( "repopath_folder_name," + "submitter," + "expected_conclusion," "expected_type," "expected_error," "expected_submissions," "expected_indexentry," "expected_indexerlogsurls", [ - ("list-deleted-diff", "other", "", None, "", ""), - ("multi-file-diff", "other", "", None, "", ""), - ("non-list-diff", "other", "", None, "", ""), - ("list-rename-diff", "other", "", None, "", ""), + ( + "submitter-access-allow", + "AllowUser", + "", + "submission", + "", + [ + { + "submissionURL": "https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library", + "normalizedURL": "https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library.git", + "repositoryName": "SparkFun_Ublox_Arduino_Library", + "name": "SparkFun u-blox Arduino Library", + "official": False, + "tag": "v1.8.11", + "error": "", + } + ], + "https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library.git|Contributed|SparkFun u-blox Arduino Library" + "", + "http://downloads.arduino.cc/libraries/logs/github.com/sparkfun/SparkFun_Ublox_Arduino_Library/", + ), + ( + "submitter-access-deny", + "DenyUser", + "declined", + "invalid", + "Library registry privileges for @DenyUser have been revoked.%0ASee: https://example.com", + None, + "", + "", + ), + ("list-deleted-diff", "FooUser", "", "other", "", None, "", ""), + ("list-deleted-diff", "FooUser", "", "other", "", None, "", ""), + ("list-deleted-diff", "FooUser", "", "other", "", None, "", ""), + ("multi-file-diff", "FooUser", "", "other", "", None, "", ""), + ("non-list-diff", "FooUser", "", "other", "", None, "", ""), + ("list-rename-diff", "FooUser", "", "other", "", None, "", ""), ( "no-final-newline-diff", + "FooUser", + "", "invalid", "Pull request removes newline from the end of a file.%0APlease add a blank line to the end of the file.", None, "", "", ), - ("removal", "removal", "", None, "", ""), + ("removal", "FooUser", "", "removal", "", None, "", ""), ( "modification", + "FooUser", + "", "modification", "", [ @@ -61,6 +100,8 @@ ), ( "url-error", + "FooUser", + "", "submission", "", [ @@ -79,6 +120,8 @@ ), ( "url-404", + "FooUser", + "", "submission", "", [ @@ -95,8 +138,62 @@ "", "http://downloads.arduino.cc/libraries/logs//", ), + ( + "all-owner-access-deny", + "FooUser", + "declined", + "submission", + "", + [ + { + "submissionURL": "https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library", + "normalizedURL": "https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library.git", + "repositoryName": "", + "name": "", + "official": False, + "tag": "", + "error": "Library registry privileges for library repository owner `github.com/sparkfun` have been" + " revoked.%0ASee: https://example.com", + }, + ], + "", + "http://downloads.arduino.cc/libraries/logs/github.com/sparkfun/SparkFun_Ublox_Arduino_Library/", + ), + ( + "some-owner-access-deny", + "FooUser", + "", + "submission", + "", + [ + { + "submissionURL": "https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library", + "normalizedURL": "https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library.git", + "repositoryName": "", + "name": "", + "official": False, + "tag": "", + "error": "Library registry privileges for library repository owner `github.com/sparkfun` have been" + " revoked.%0ASee: https://example.com", + }, + { + "submissionURL": "https://github.com/adafruit/Adafruit_TinyFlash", + "normalizedURL": "https://github.com/adafruit/Adafruit_TinyFlash.git", + "repositoryName": "Adafruit_TinyFlash", + "name": "Adafruit TinyFlash", + "official": False, + "tag": "1.0.4", + "error": "", + }, + ], + "%0Ahttps://github.com/adafruit/Adafruit_TinyFlash.git|Recommended|Adafruit TinyFlash", + "http://downloads.arduino.cc/libraries/logs/github.com/sparkfun/SparkFun_Ublox_Arduino_Library/%0Ahttp://do" + "wnloads.arduino.cc/libraries/logs/github.com/adafruit/Adafruit_TinyFlash/", + ), ( "not-supported-git-host", + "FooUser", + "", "submission", "", [ @@ -117,6 +214,8 @@ ), ( "not-git-clone-url", + "FooUser", + "", "submission", "", [ @@ -136,6 +235,8 @@ ), ( "already-in-library-manager", + "FooUser", + "", "submission", "", [ @@ -154,6 +255,8 @@ ), ( "type-arduino", + "FooUser", + "", "submission", "", [ @@ -172,6 +275,8 @@ ), ( "type-partner", + "FooUser", + "", "submission", "", [ @@ -190,6 +295,8 @@ ), ( "type-recommended", + "FooUser", + "", "submission", "", [ @@ -208,6 +315,8 @@ ), ( "type-contributed", + "FooUser", + "", "submission", "", [ @@ -227,6 +336,8 @@ ), ( "no-tags", + "FooUser", + "", "submission", "", [ @@ -247,6 +358,8 @@ ), ( "no-library-properties", + "FooUser", + "", "submission", "", [ @@ -266,6 +379,8 @@ ), ( "duplicates-in-submission", + "FooUser", + "", "submission", "", [ @@ -298,20 +413,37 @@ def test_request( run_command, repopath_folder_name, + submitter, + expected_conclusion, expected_type, expected_error, expected_submissions, expected_indexentry, expected_indexerlogsurls, ): + accesslist = ".github/workflows/assets/accesslist.yml" diffpath = test_data_path.joinpath(repopath_folder_name, "diff.txt") repopath = test_data_path.joinpath(repopath_folder_name) listname = "repositories.txt" - result = run_command(cmd=["--diffpath", diffpath, "--repopath", repopath, "--listname", listname]) + result = run_command( + cmd=[ + "--accesslist", + accesslist, + "--diffpath", + diffpath, + "--repopath", + repopath, + "--listname", + listname, + "--submitter", + submitter, + ] + ) assert result.ok request = json.loads(result.stdout) + assert request["conclusion"] == expected_conclusion assert request["type"] == expected_type assert request["error"] == expected_error assert request["submissions"] == expected_submissions diff --git a/tests/testdata/all-owner-access-deny/.github/workflows/assets/accesslist.yml b/tests/testdata/all-owner-access-deny/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..68b906c --- /dev/null +++ b/tests/testdata/all-owner-access-deny/.github/workflows/assets/accesslist.yml @@ -0,0 +1,4 @@ +- host: github.com + name: sparkfun + access: deny + reference: https://example.com diff --git a/tests/testdata/all-owner-access-deny/diff.txt b/tests/testdata/all-owner-access-deny/diff.txt new file mode 100644 index 0000000..fd58d54 --- /dev/null +++ b/tests/testdata/all-owner-access-deny/diff.txt @@ -0,0 +1,8 @@ +diff --git a/repositories.txt b/repositories.txt +index c080a7a..1194257 100644 +--- a/repositories.txt ++++ b/repositories.txt +@@ -1,2 +1,3 @@ ++https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library + https://github.com/arduino-libraries/Servo + https://github.com/arduino-libraries/Stepper diff --git a/tests/testdata/all-owner-access-deny/repositories.txt b/tests/testdata/all-owner-access-deny/repositories.txt new file mode 100644 index 0000000..c080a7a --- /dev/null +++ b/tests/testdata/all-owner-access-deny/repositories.txt @@ -0,0 +1,2 @@ +https://github.com/arduino-libraries/Servo +https://github.com/arduino-libraries/Stepper diff --git a/tests/testdata/already-in-library-manager/.github/workflows/assets/accesslist.yml b/tests/testdata/already-in-library-manager/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/already-in-library-manager/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/duplicates-in-submission/.github/workflows/assets/accesslist.yml b/tests/testdata/duplicates-in-submission/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/duplicates-in-submission/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/list-deleted-diff/.github/workflows/assets/accesslist.yml b/tests/testdata/list-deleted-diff/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/list-deleted-diff/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/list-rename-diff/.github/workflows/assets/accesslist.yml b/tests/testdata/list-rename-diff/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/list-rename-diff/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/modification/.github/workflows/assets/accesslist.yml b/tests/testdata/modification/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/modification/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/multi-file-diff/.github/workflows/assets/accesslist.yml b/tests/testdata/multi-file-diff/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/multi-file-diff/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/no-final-newline-diff/.github/workflows/assets/accesslist.yml b/tests/testdata/no-final-newline-diff/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/no-final-newline-diff/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/no-library-properties/.github/workflows/assets/accesslist.yml b/tests/testdata/no-library-properties/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/no-library-properties/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/no-tags/.github/workflows/assets/accesslist.yml b/tests/testdata/no-tags/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/no-tags/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/non-list-diff/.github/workflows/assets/accesslist.yml b/tests/testdata/non-list-diff/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/non-list-diff/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/not-git-clone-url/.github/workflows/assets/accesslist.yml b/tests/testdata/not-git-clone-url/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/not-git-clone-url/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/not-supported-git-host/.github/workflows/assets/accesslist.yml b/tests/testdata/not-supported-git-host/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/not-supported-git-host/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/removal/.github/workflows/assets/accesslist.yml b/tests/testdata/removal/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/removal/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/some-owner-access-deny/.github/workflows/assets/accesslist.yml b/tests/testdata/some-owner-access-deny/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..68b906c --- /dev/null +++ b/tests/testdata/some-owner-access-deny/.github/workflows/assets/accesslist.yml @@ -0,0 +1,4 @@ +- host: github.com + name: sparkfun + access: deny + reference: https://example.com diff --git a/tests/testdata/some-owner-access-deny/diff.txt b/tests/testdata/some-owner-access-deny/diff.txt new file mode 100644 index 0000000..29df5b1 --- /dev/null +++ b/tests/testdata/some-owner-access-deny/diff.txt @@ -0,0 +1,9 @@ +diff --git a/repositories.txt b/repositories.txt +index c080a7a..1194257 100644 +--- a/repositories.txt ++++ b/repositories.txt +@@ -1,2 +1,3 @@ ++https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library ++https://github.com/adafruit/Adafruit_TinyFlash + https://github.com/arduino-libraries/Servo + https://github.com/arduino-libraries/Stepper diff --git a/tests/testdata/some-owner-access-deny/repositories.txt b/tests/testdata/some-owner-access-deny/repositories.txt new file mode 100644 index 0000000..c080a7a --- /dev/null +++ b/tests/testdata/some-owner-access-deny/repositories.txt @@ -0,0 +1,2 @@ +https://github.com/arduino-libraries/Servo +https://github.com/arduino-libraries/Stepper diff --git a/tests/testdata/submitter-access-allow/.github/workflows/assets/accesslist.yml b/tests/testdata/submitter-access-allow/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..65f9ff0 --- /dev/null +++ b/tests/testdata/submitter-access-allow/.github/workflows/assets/accesslist.yml @@ -0,0 +1,8 @@ +- host: github.com + name: AllowUser + access: allow + reference: https://example.com +- host: github.com + name: sparkfun + access: deny + reference: https://example.com diff --git a/tests/testdata/submitter-access-allow/diff.txt b/tests/testdata/submitter-access-allow/diff.txt new file mode 100644 index 0000000..fd58d54 --- /dev/null +++ b/tests/testdata/submitter-access-allow/diff.txt @@ -0,0 +1,8 @@ +diff --git a/repositories.txt b/repositories.txt +index c080a7a..1194257 100644 +--- a/repositories.txt ++++ b/repositories.txt +@@ -1,2 +1,3 @@ ++https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library + https://github.com/arduino-libraries/Servo + https://github.com/arduino-libraries/Stepper diff --git a/tests/testdata/submitter-access-allow/repositories.txt b/tests/testdata/submitter-access-allow/repositories.txt new file mode 100644 index 0000000..c080a7a --- /dev/null +++ b/tests/testdata/submitter-access-allow/repositories.txt @@ -0,0 +1,2 @@ +https://github.com/arduino-libraries/Servo +https://github.com/arduino-libraries/Stepper diff --git a/tests/testdata/submitter-access-deny/.github/workflows/assets/accesslist.yml b/tests/testdata/submitter-access-deny/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..c853a65 --- /dev/null +++ b/tests/testdata/submitter-access-deny/.github/workflows/assets/accesslist.yml @@ -0,0 +1,4 @@ +- host: github.com + name: DenyUser + access: deny + reference: https://example.com diff --git a/tests/testdata/submitter-access-deny/diff.txt b/tests/testdata/submitter-access-deny/diff.txt new file mode 100644 index 0000000..fd58d54 --- /dev/null +++ b/tests/testdata/submitter-access-deny/diff.txt @@ -0,0 +1,8 @@ +diff --git a/repositories.txt b/repositories.txt +index c080a7a..1194257 100644 +--- a/repositories.txt ++++ b/repositories.txt +@@ -1,2 +1,3 @@ ++https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library + https://github.com/arduino-libraries/Servo + https://github.com/arduino-libraries/Stepper diff --git a/tests/testdata/submitter-access-deny/repositories.txt b/tests/testdata/submitter-access-deny/repositories.txt new file mode 100644 index 0000000..c080a7a --- /dev/null +++ b/tests/testdata/submitter-access-deny/repositories.txt @@ -0,0 +1,2 @@ +https://github.com/arduino-libraries/Servo +https://github.com/arduino-libraries/Stepper diff --git a/tests/testdata/type-arduino/.github/workflows/assets/accesslist.yml b/tests/testdata/type-arduino/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/type-arduino/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/type-contributed/.github/workflows/assets/accesslist.yml b/tests/testdata/type-contributed/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/type-contributed/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/type-partner/.github/workflows/assets/accesslist.yml b/tests/testdata/type-partner/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/type-partner/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/type-recommended/.github/workflows/assets/accesslist.yml b/tests/testdata/type-recommended/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/type-recommended/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/url-404/.github/workflows/assets/accesslist.yml b/tests/testdata/url-404/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/url-404/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[] diff --git a/tests/testdata/url-error/.github/workflows/assets/accesslist.yml b/tests/testdata/url-error/.github/workflows/assets/accesslist.yml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/testdata/url-error/.github/workflows/assets/accesslist.yml @@ -0,0 +1 @@ +[]