refactor: Replace linting configurations

The previous package was outdated, preventing us from updating TS.
This one also lints YAML and JSON,
and applies many more rules to the test files,
explaining all the changes in this PR.
This commit is contained in:
Joachim Van Herwegen
2023-10-27 11:28:57 +02:00
parent 58daeb684f
commit 6248ed0938
327 changed files with 6424 additions and 3375 deletions

View File

@@ -52,7 +52,7 @@ jobs:
- name: Create the necessary folders
run: mkdir -p reports/css
- name: Pull the conformance harness docker
run: "docker pull solidproject/conformance-test-harness:${{ inputs.version }}"
run: 'docker pull solidproject/conformance-test-harness:${{ inputs.version }}'
- name: Wait until the server has started
run: >
curl --output /dev/null --silent --head --fail --retry 30

View File

@@ -11,10 +11,10 @@ on:
jobs:
docker-meta:
# Generates the metadata (labels and tags) for the docker containers
# - push to main results in the edge tag
# - version tag results in edge, latest and semver, major, major.minor tags
# - push to versions/ results in the next tag
# Generates the metadata (labels and tags) for the docker containers
# - push to main results in the edge tag
# - version tag results in edge, latest and semver, major, major.minor tags
# - push to versions/ results in the next tag
runs-on: ubuntu-latest
outputs:
labels: ${{ steps.meta-main.outputs.labels || steps.meta-version.outputs.labels }}
@@ -49,8 +49,8 @@ jobs:
github-token: ${{ secrets.github_token }}
docker:
# Builds, tests and pushes docker containers
# Containers are built for both linux/amd64 and linux/arm/v7 platforms
# Builds, tests and pushes docker containers
# Containers are built for both linux/amd64 and linux/arm/v7 platforms
needs: docker-meta
runs-on: ubuntu-latest
steps:
@@ -73,7 +73,7 @@ jobs:
tags: ${{ needs.docker-meta.outputs.tags }}
labels: ${{ needs.docker-meta.outputs.labels }}
- name: "Test all docker-built image tags"
- name: Test all docker-built image tags
shell: bash
# Loop over all generated image:tag names and docker run them.
# If they aren't built previously, the command will error.

View File

@@ -2,7 +2,7 @@ name: CI
on:
push:
branches:
- 'main'
- main
- 'versions/*'
tags:
- 'v*'
@@ -14,11 +14,11 @@ concurrency:
jobs:
npm-test:
# Run the tests in every case
# Run the tests in every case
uses: ./.github/workflows/npm-test.yml
cth-test:
# Run the Conformance Test Harness on PRs targeting main or versions/
# Run the Conformance Test Harness on PRs targeting main or versions/
if: github.event_name == 'pull_request' && ( github.base_ref == 'main' || startsWith( github.base_ref, 'versions/' ) )
uses: ./.github/workflows/cth-test.yml
with:
@@ -26,7 +26,7 @@ jobs:
version: 1.1.14 # The latest version that CSS is confirmed to pass
docker:
# Build docker containers on version tag, push to main and push to versions/
# Build docker containers on version tag, push to main and push to versions/
needs: npm-test
if: startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/heads/versions/')
uses: ./.github/workflows/docker.yml
@@ -35,6 +35,6 @@ jobs:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
mkdocs-release:
# Release documentation on version tag, but ignore pre-releases
# Release documentation on version tag, but ignore pre-releases
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')
uses: ./.github/workflows/mkdocs.yml

View File

@@ -2,21 +2,21 @@ name: Documentation
on:
workflow_call:
# Additional trigger to deploy changes to the documentation/ folder
# on push to main, ignoring tags so we don't trigger twice upon release
# Additional trigger to deploy changes to the documentation/ folder
# on push to main, ignoring tags so we don't trigger twice upon release
push:
branches:
- main
paths:
- documentation/**
tags-ignore:
- "*"
- '*'
jobs:
mkdocs-prep:
# Runs the markdown linter to ensure we don't release faulty markdown.
# Also gets the correct major version, whether the job is triggered by a version tag
# or a push to main to update the latest documentation.
# Runs the markdown linter to ensure we don't release faulty markdown.
# Also gets the correct major version, whether the job is triggered by a version tag
# or a push to main to update the latest documentation.
runs-on: ubuntu-latest
outputs:
major: ${{ steps.tagged_version.outputs.major || steps.current_version.outputs.major }}
@@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v4.1.1
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: 16.x
- run: npm ci --ignore-scripts
- name: Lint documentation markdown
run: npm run lint:markdown -- documentation/**/*.md
@@ -55,7 +55,6 @@ jobs:
- run: |
cd documentation && mike deploy --push --update-aliases \
${{ needs.mkdocs-prep.outputs.major }}.x latest
typedocs:
# Build typedocs and publish them to the GH page.
@@ -66,7 +65,7 @@ jobs:
- uses: actions/checkout@v4.1.1
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: 16.x
- run: npm ci --ignore-scripts
- name: Generate typedocs
run: npm run typedocs
@@ -75,4 +74,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
destination_dir: ${{ needs.mkdocs-prep.outputs.major }}.x/docs
destination_dir: ${{ needs.mkdocs-prep.outputs.major }}.x/docs

View File

@@ -10,12 +10,12 @@ jobs:
- uses: actions/checkout@v4.1.1
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: 16.x
- run: npm ci --ignore-scripts
- run: npm run lint
test-unit:
# Run unit tests on windows and linux
# Run unit tests on windows and linux
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
@@ -24,9 +24,9 @@ jobs:
- windows-latest
node-version:
- '18.0'
- '18.x'
- 18.x
- '20.0'
- '20.x'
- 20.x
timeout-minutes: 15
steps:
- name: Use Node.js ${{ matrix.node-version }}
@@ -51,13 +51,13 @@ jobs:
parallel: true
test-integration:
# Run integration tests on linux (full suite, with external dependencies)
# Run integration tests on linux (full suite, with external dependencies)
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- '18.x'
- '20.x'
- 18.x
- 20.x
env:
TEST_DOCKER: true
services:
@@ -85,13 +85,13 @@ jobs:
run: npm run test:integration
test-integration-windows:
# Run integration tests on windows (no external dependencies)
# Run integration tests on windows (no external dependencies)
runs-on: windows-latest
strategy:
matrix:
node-version:
- '18.x'
- '20.x'
- 18.x
- 20.x
timeout-minutes: 20
steps:
- name: Use Node.js ${{ matrix.node-version }}
@@ -108,7 +108,7 @@ jobs:
run: npm run test:integration
test-configs:
# Test startup of CSS with all configs inside the config/ folder
# Test startup of CSS with all configs inside the config/ folder
runs-on: ubuntu-latest
services:
sparql-endpoint:
@@ -121,7 +121,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: 16.x
- name: Check out repository
uses: actions/checkout@v4.1.1
- name: Install dependencies and run build scripts
@@ -130,7 +130,7 @@ jobs:
run: npm run test:deploy
coveralls:
# Consolidate test coverage reports from all unit tests
# Consolidate test coverage reports from all unit tests
needs: test-unit
runs-on: ubuntu-latest
steps:

View File

@@ -11,8 +11,8 @@ jobs:
fail-fast: false
matrix:
branch:
- 'main'
- 'versions/next-major'
- main
- versions/next-major
uses: ./.github/workflows/cth-test.yml
with:
branch: ${{ matrix.branch }}

View File

@@ -1,4 +1,4 @@
name: 'Stale issues and PRs'
name: Stale issues and PRs
on:
schedule:
- cron: '30 1 * * *'
@@ -24,6 +24,6 @@ jobs:
days-before-close: 30
days-before-pr-stale: -1
operations-per-run: 700
exempt-issue-labels: "🐛 bug,☀️ enhancement,📚 documentation, feature,🐌 performance,
test,📝 task,:ant: worker threads,👩🏾‍💻 developer experience"
exempt-issue-labels: '🐛 bug,☀️ enhancement,📚 documentation, feature,🐌 performance,
test,📝 task,:ant: worker threads,👩🏾‍💻 developer experience'
exempt-all-assignees: true