Use Pronto to check code conventions

This way developers can run the checks on their machines and using
`bundle exec` we guarantee the right versions of all our gems are being
used; with Hound we can only use the versions supported by their
service.

When including the pronto-erb_lint gem, we're getting errors in
development where our ERB does not follow the conventions Better HTML
expects. Since we only use Better HTML because ERB Lint depends on it,
and right now we are not ready to follow its conventions, we're
disabling it.

Note pronto depends on rugged, which requires CMake and pkg-config to
build the `libgit2` library it depends on. CMake and pkg-config are
installed by default in some GNU/Linux distributions like Ubuntu, but
might not be installed on other systems, so we're adding them as
development dependencies.
This commit is contained in:
Javi Martín
2020-10-02 11:36:17 +02:00
parent 94f91a4aba
commit c6a90b266d
9 changed files with 79 additions and 22 deletions

22
.github/workflows/linters.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: linters
on: [pull_request]
jobs:
linters:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- 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@v1
- name: Install eslint
run: npm install --global eslint@6.0.1
- name: Run Pronto
run: |
PRONTO_PULL_REQUEST_ID="$(jq --raw-output .number "$GITHUB_EVENT_PATH")" PRONTO_GITHUB_ACCESS_TOKEN="${{ github.token }}" bundle exec pronto run -f github_status github_pr -c origin/${{ github.base_ref }}