Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: arduino/arduino-lint-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1
Choose a base ref
...
head repository: arduino/arduino-lint-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing with 35,099 additions and 6,589 deletions.
  1. +67 −7 .github/CONTRIBUTING.md
  2. +6 −0 .github/dependabot.yml
  3. +110 −0 .github/workflows/check-license.yml
  4. +156 −0 .github/workflows/check-npm-dependencies-task.yml
  5. +129 −0 .github/workflows/check-npm-task.yml
  6. +0 −149 .github/workflows/check-npm.yml
  7. +12 −13 .github/workflows/check-packaging-ncc-typescript-npm.yml
  8. +266 −0 .github/workflows/check-prettier-formatting-task.yml
  9. +98 −0 .github/workflows/check-toc-task.yml
  10. +0 −46 .github/workflows/check-toc.yml
  11. +60 −0 .github/workflows/check-tsconfig-task.yml
  12. +0 −65 .github/workflows/check-tsconfig.yml
  13. +3 −3 .github/workflows/integration.yml
  14. +65 −0 .github/workflows/spell-check-task.yml
  15. +0 −26 .github/workflows/spell-check.yml
  16. +50 −28 .github/workflows/{sync-labels.yml → sync-labels-npm.yml}
  17. +118 −0 .github/workflows/test-javascript-jest-task.yml
  18. +0 −43 .github/workflows/test.yml
  19. +63 −0 .licensed.yml
  20. +20 −0 .licenses/npm/@actions/core.dep.yml
  21. +20 −0 .licenses/npm/@actions/exec.dep.yml
  22. +32 −0 .licenses/npm/@actions/http-client.dep.yml
  23. +20 −0 .licenses/npm/@actions/io.dep.yml
  24. +20 −0 .licenses/npm/@actions/tool-cache.dep.yml
  25. +30 −0 .licenses/npm/@fastify/busboy.dep.yml
  26. +26 −0 .licenses/npm/semver-6.3.0.dep.yml
  27. +26 −0 .licenses/npm/semver-7.6.3.dep.yml
  28. +35 −0 .licenses/npm/tunnel.dep.yml
  29. +34 −0 .licenses/npm/undici.dep.yml
  30. +39 −0 .licenses/npm/uuid.dep.yml
  31. +3 −0 .npmrc
  32. +5 −0 .prettierignore
  33. +0 −19 LICENSE
  34. +201 −0 LICENSE.txt
  35. +9 −6 README.md
  36. +359 −0 Taskfile.yml
  37. +16 −0 __tests__/main.test.ts
  38. +1 −1 action.yml
  39. +28,001 −5,348 dist/index.js
  40. +7 −7 jest.config.js
  41. +3,824 −797 package-lock.json
  42. +18 −18 package.json
  43. +1,087 −0 poetry.lock
  44. +21 −0 pyproject.toml
  45. +18 −2 src/installer.ts
  46. +16 −0 src/main.ts
  47. +8 −11 tsconfig.json
74 changes: 67 additions & 7 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -9,14 +9,29 @@
Follow the installation instructions here:<br />
https://nodejs.dev/download

Node.js 16.x is used for development of this project. [nvm](https://github.com/nvm-sh/nvm) is recommended to easily switch between Node.js versions.
The **Node.js** version in use is defined in the `engines.node` field of [`package.json`](../package.json).

[nvm](https://github.com/nvm-sh/nvm) is recommended to easily switch between Node.js versions.

#### Python

**Python**-based tools are used for some project development operations.

The **Python** version in use is defined in the `tool.poetry.dependencies` field of [`pyproject.toml`](../pyproject.toml).

#### Task

The [**Task**](https://taskfile.dev) task runner tool is used for all common development and validation operations.

Follow the installation instructions here:<br />
https://taskfile.dev/installation/

### 2. Install dependencies

To work on the codebase you have to install all the dependencies:

```
npm install
task npm:install-deps
```

### 3. Coding
@@ -30,26 +45,25 @@ Make sure to write or update tests for your work when appropriate.
Format the code to follow the standard style for the project:

```
npm run format
task general:format-prettier
```

### 5. Run tests

To run tests set the environment variable `GITHUB_TOKEN` with a valid Personal Access Token and then:

```
npm run test
task js:test
```

See the [official Github documentation][pat-docs] to learn more about Personal Access Tokens.

### 6. Build

It is necessary to compile the code before it can be used by GitHub Actions. Remember to run these commands before committing any code changes:
It is necessary to compile the code before it can be used by GitHub Actions. Remember to run this commands before committing any code changes:

```
npm run build
npm run pack
task build
```

### 7. Commit
@@ -58,6 +72,52 @@ Everything is now ready to make your contribution to the project, so commit it t

Thanks!

## Common Development Operations

### Dependency License Metadata

Metadata about the license types of all dependencies is cached in the repository. To update this cache, run the following command from the repository root folder:

```text
task general:cache-dep-licenses
```

The necessary **Licensed** tool can be installed by following [these instructions](https://github.com/github/licensed#as-an-executable).

Unfortunately, **Licensed** does not have Windows support.

An updated cache is also generated whenever the cache is found to be outdated by the "**Check Go Dependencies**" CI workflow and made available for download via the `dep-licenses-cache` [workflow artifact](https://docs.github.com/actions/managing-workflow-runs/downloading-workflow-artifacts).

### Running Checks

Checks and tests are set up to ensure the project content is functional and compliant with the established standards.

You can run the full suite of checks by running the following command from a terminal in a path under the repository:

```text
task check
```

### Automatic Corrections

Tools are provided to automatically bring the project into compliance with some of the required checks.

You can make these automatic fixes by running the following command from a terminal in a path under the repository:

```text
task fix
```

### Other Operations

Individual tasks are provided for each specific common validation and automated correction operation. The convenience `check` and `fix` tasks run all of the relevant individual tasks, so it is not necessary for the contributor to use the individual tasks. However, in some cases it may be more efficient to run the single specific task of interest.

You can learn the names of all the available tasks by running the following command from a terminal in a path under the repository:

```text
task --list
```

## Release workflow

Instructions for releasing a new version of the action:
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -7,12 +7,18 @@ updates:
# See: https://docs.github.com/en/code-security/supply-chain-security/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:
- "topic: infrastructure"
- package-ecosystem: npm
directory: /
assignees:
- per1234
open-pull-requests-limit: 100
schedule:
interval: daily
labels:
110 changes: 110 additions & 0 deletions .github/workflows/check-license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-license.md
name: Check License

# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
on:
create:
push:
paths:
- ".github/workflows/check-license.ya?ml"
# See: https://github.com/licensee/licensee/blob/master/docs/what-we-look-at.md#detecting-the-license-file
- "[cC][oO][pP][yY][iI][nN][gG]*"
- "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*"
- "[lL][iI][cC][eE][nN][cCsS][eE]*"
- "[oO][fF][lL]*"
- "[pP][aA][tT][eE][nN][tT][sS]*"
pull_request:
paths:
- ".github/workflows/check-license.ya?ml"
- "[cC][oO][pP][yY][iI][nN][gG]*"
- "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*"
- "[lL][iI][cC][eE][nN][cCsS][eE]*"
- "[oO][fF][lL]*"
- "[pP][aA][tT][eE][nN][tT][sS]*"
schedule:
# Run periodically to catch breakage caused by external changes.
- cron: "0 6 * * WED"
workflow_dispatch:
repository_dispatch:

jobs:
run-determination:
runs-on: ubuntu-latest
permissions: {}
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 "result=$RESULT" >> $GITHUB_OUTPUT
check-license:
name: ${{ matrix.check-license.path }}
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
fail-fast: false

matrix:
check-license:
- path: ./
# TODO: Define the project's license file name here:
expected-filename: LICENSE.txt
# SPDX identifier: https://spdx.org/licenses/
expected-type: Apache-2.0

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby # Install latest version

- name: Install licensee
run: gem install licensee

- name: Check license file for ${{ matrix.check-license.path }}
run: |
EXIT_STATUS=0
# Go into folder path
cd ./${{ matrix.check-license.path }}
# See: https://github.com/licensee/licensee
LICENSEE_OUTPUT="$(licensee detect --json --confidence=100)"
DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')"
echo "Detected license file: $DETECTED_LICENSE_FILE"
if [ "$DETECTED_LICENSE_FILE" != "\"${{ matrix.check-license.expected-filename }}\"" ]; then
echo "::error file=${DETECTED_LICENSE_FILE}::detected license file $DETECTED_LICENSE_FILE doesn't match expected: ${{ matrix.check-license.expected-filename }}"
EXIT_STATUS=1
fi
DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')"
echo "Detected license type: $DETECTED_LICENSE_TYPE"
if [ "$DETECTED_LICENSE_TYPE" != "\"${{ matrix.check-license.expected-type }}\"" ]; then
echo "::error file=${DETECTED_LICENSE_FILE}::detected license type $DETECTED_LICENSE_TYPE doesn't match expected \"${{ matrix.check-license.expected-type }}\""
EXIT_STATUS=1
fi
exit $EXIT_STATUS
Loading