diff --git a/.editorconfig b/.editorconfig index 8ce2fa867..4ee81c2e2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -34,10 +34,16 @@ indent_size = 4 [*.{yaml,yml}] trim_trailing_whitespace = false -[helm/api-platform/**.yaml] +[.hadolint.yaml] indent_size = 2 -[.github/workflows/*.yml] +[.markdown-lint.yaml] +indent_size = 2 + +[helm/api-platform/**.{yaml,yml}] +indent_size = 2 + +[.github/**.{yaml,yml}] indent_size = 2 [.gitmodules] diff --git a/.github/linters/.hadolint.yaml b/.github/linters/.hadolint.yaml new file mode 100644 index 000000000..a33477db5 --- /dev/null +++ b/.github/linters/.hadolint.yaml @@ -0,0 +1,6 @@ +--- +ignored: + - DL3006 + - DL3008 + - DL3018 + - DL3022 diff --git a/.github/linters/.markdown-lint.yaml b/.github/linters/.markdown-lint.yaml new file mode 100644 index 000000000..0fe7cd835 --- /dev/null +++ b/.github/linters/.markdown-lint.yaml @@ -0,0 +1,4 @@ +--- +no-hard-tabs: false +MD013: false +MD033: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1206205d0..ad6cbc3ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,16 +166,3 @@ jobs: with: name: playwright-screenshots path: pwa/test-results - - lint: - name: Docker Lint - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Lint Dockerfiles - uses: hadolint/hadolint-action@v3.1.0 - with: - recursive: true diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 000000000..dd4d24ad1 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,30 @@ +name: Lint Code Base +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + build: + name: Lint Code Base + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + statuses: write + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Lint Code Base + uses: super-linter/super-linter@v5 + env: + DEFAULT_BRANCH: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MARKDOWN_CONFIG_FILE: .markdown-lint.yaml diff --git a/api/src/Serializer/BookNormalizer.php b/api/src/Serializer/BookNormalizer.php index ee7d3c27a..6545decef 100644 --- a/api/src/Serializer/BookNormalizer.php +++ b/api/src/Serializer/BookNormalizer.php @@ -36,7 +36,6 @@ public function normalize(mixed $object, string $format = null, array $context = ]); $object->rating = $this->repository->getAverageRating($object); - /** @var array $data */ return $this->normalizer->normalize($object, $format, [self::class => true] + $context); }