Files
grecia/.github/workflows/linters.yml
Javi Martín 96e99ce6c8 Make HTML Beautifier fail on nesting errors
This way we're also checking mistakes like closing tags that don't match
their opening element, which we detected by manually running HTML
Beautifier with the `-e` option, and fixed two commits ago.

Note there was a false positive in the mailer layout. We don't know the
cause. Maybe closing the ERB tag right before the HTML opening tag and
the lack of other attributes on the tag made HTML Beautifier think the
tag wasn't correctly open, but on the other hand, we have the exact same
line in other layouts where HTML Beautifier works fine. We're fixing it
by adding an HTML id attribute to the element.
2025-03-07 16:56:29 +01:00

45 lines
1.3 KiB
YAML

name: linters
on: [pull_request]
permissions:
contents: read
jobs:
linters:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- name: RuboCop
run: bundle exec rubocop --fail-level convention --display-only-fail-level-offenses -f github
- name: ERB Lint
run: bundle exec erb_lint .
- name: ESLint
run: npx eslint . --quiet
- name: Stylelint
run: npx stylelint app/assets/stylesheets
- name: Markdownlint
run: bundle exec mdl *.md docs/
- name: HTML Beautifier
run: find app/ -name "*.html.erb" -exec bundle exec htmlbeautifier --lint-only --keep-blank-lines 1 -e {} +
name: ${{ matrix.name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- run: |
git fetch --no-tags --prune origin +refs/heads/*:refs/remotes/origin/*
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Setup NPM
uses: actions/setup-node@v4
with:
cache: "npm"
node-version-file: ".node-version"
- name: Install node packages
run: npm clean-install
- name: ${{ matrix.name }}
run: ${{ matrix.run }}