Skip to content
代码片段 群组 项目
lefthook.yml 1.7 KB
更新 更旧
pre-push:
  parallel: true
  commands:
    danger:
      run: bundle exec danger dry_run
    eslint:
      tags: frontend style
Albert Salim's avatar
Albert Salim 已提交
      files: git diff --name-only --diff-filter=d $(git merge-base origin/master HEAD)..HEAD
      glob: '*.{js,vue}'
      run: yarn run lint:eslint {files}
    haml-lint:
      tags: view haml style
Albert Salim's avatar
Albert Salim 已提交
      files: git diff --name-only --diff-filter=d $(git merge-base origin/master HEAD)..HEAD
      glob: '*.html.haml'
      run: bundle exec haml-lint --config .haml-lint.yml {files}
    markdownlint:
      tags: documentation style
Albert Salim's avatar
Albert Salim 已提交
      files: git diff --name-only --diff-filter=d $(git merge-base origin/master HEAD)..HEAD
      glob: 'doc/*.md'
      run: yarn markdownlint {files}
      tags: stylesheet css style
Albert Salim's avatar
Albert Salim 已提交
      files: git diff --name-only --diff-filter=d $(git merge-base origin/master HEAD)..HEAD
      glob: '*.scss{,.css}'
      run: yarn stylelint {files}
Lukas Eipert's avatar
Lukas Eipert 已提交
    prettier:
      tags: frontend style
Albert Salim's avatar
Albert Salim 已提交
      files: git diff --name-only --diff-filter=d $(git merge-base origin/master HEAD)..HEAD
      glob: '*.{js,vue,graphql}'
Lukas Eipert's avatar
Lukas Eipert 已提交
      run: yarn run prettier --check {files}
    rubocop:
      tags: backend style
Albert Salim's avatar
Albert Salim 已提交
      files: git diff --name-only --diff-filter=d $(git merge-base origin/master HEAD)..HEAD
      glob: '*.rb'
      run: REVEAL_RUBOCOP_TODO=0 bundle exec rubocop --parallel --force-exclusion {files}
Evan Read's avatar
Evan Read 已提交
    vale:  # Requires Vale: https://docs.gitlab.com/ee/development/documentation/#install-linters
      tags: documentation style
Albert Salim's avatar
Albert Salim 已提交
      files: git diff --name-only --diff-filter=d $(git merge-base origin/master HEAD)..HEAD
      glob: 'doc/*.md'
      run: if command -v vale 2> /dev/null; then vale --config .vale.ini --minAlertLevel error {files}; else echo "Vale not found. Install Vale"; fi