aboutsummaryrefslogtreecommitdiffstats
path: root/azure-pipelines.yml
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-03-02 10:36:02 -0800
committerGravatar MarkKoz <[email protected]>2020-03-03 19:46:25 -0800
commit3b65766cf8fe095b91556efa49fabffefce5d49e (patch)
tree6104ea907c81c1518314d194547ec1cfeac8185e /azure-pipelines.yml
parentAdd more pre-commit hooks (diff)
Use pre-commit in pipenv lint script
Diffstat (limited to 'azure-pipelines.yml')
-rw-r--r--azure-pipelines.yml12
1 files changed, 10 insertions, 2 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 35dea089a..902bfcd56 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -13,10 +13,12 @@ jobs:
variables:
PIP_CACHE_DIR: ".cache/pip"
+ PRE_COMMIT_HOME: $(Pipeline.Workspace)/pre-commit-cache
steps:
- task: UsePythonVersion@0
displayName: 'Set Python version'
+ name: PythonVersion
inputs:
versionSpec: '3.8.x'
addToPath: true
@@ -27,8 +29,14 @@ jobs:
- script: pipenv install --dev --deploy --system
displayName: 'Install project using pipenv'
- - script: python -m flake8
- displayName: 'Run linter'
+ - task: Cache@2
+ displayName: 'Restore pre-commit environment'
+ inputs:
+ key: pre-commit | .pre-commit-config.yaml | "$(PythonVersion.pythonLocation)"
+ path: $(PRE_COMMIT_HOME)
+
+ - script: pre-commit run --all-files --show-diff-on-failure
+ displayName: 'Run pre-commit hooks'
- script: BOT_API_KEY=foo BOT_SENTRY_DSN=blah BOT_TOKEN=bar WOLFRAM_API_KEY=baz REDDIT_CLIENT_ID=spam REDDIT_SECRET=ham coverage run -m xmlrunner
displayName: Run tests