Merge pull request #3459 from mozilla/move-linter-circleci

Move linting job to CircleCI
This commit is contained in:
Reuben Morais 2020-12-08 13:24:35 +02:00 committed by GitHub
commit 857ce297f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 22 deletions

View File

@ -72,6 +72,30 @@ jobs:
docker push "${DOCKERHUB_REPO}:${CIRCLE_TAG}" docker push "${DOCKERHUB_REPO}:${CIRCLE_TAG}"
fi fi
lint:
docker:
- image: circleci/python:3.7.9
steps:
- checkout
- run:
name: Install dependencies
command: |
pip install --upgrade cardboardlint pylint
- run:
name: Run linter
command: |
set -ex
# Check if branch can be merged with master (if failing script will stop due to set -e)
git config user.email "you@example.com"
git config user.name "Your Name"
git merge --no-commit --no-ff origin/master
# Undo merge changes if any
git reset --hard $CIRCLE_BRANCH
# Lint differences against master
cardboardlinter --refspec origin/master -n auto;
workflows: workflows:
version: 2 version: 2
build-deploy: build-deploy:
@ -87,3 +111,7 @@ workflows:
filters: filters:
tags: tags:
only: /.*/ only: /.*/
lint:
jobs:
- lint

View File

@ -1,22 +0,0 @@
language: python
cache: pip
before_cache:
- rm ~/.cache/pip/log/debug.log
python:
- "3.6"
jobs:
include:
- name: cardboard linter
install:
- pip install --upgrade cardboardlint pylint
script: |
# Run cardboardlinter, in case of pull requests
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
if [ "$TRAVIS_BRANCH" != "master" ]; then
git fetch origin $TRAVIS_BRANCH:$TRAVIS_BRANCH
fi
cardboardlinter --refspec $TRAVIS_BRANCH -n auto;
fi