Skip to content

Commit 74db326

Browse files
authored
use github actions for pre-commit checks (#1658)
* use github actions for pre-commit checks * remove pre-commit run from Jenkins * remove linting CI job * use correct repo and newest version of flake8 thanks @basepi for the heads-up
1 parent c86c5e8 commit 74db326

File tree

5 files changed

+19
-132
lines changed

5 files changed

+19
-132
lines changed

.ci/jobs/apm-agent-python-linting-mbp.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.ci/linting.groovy

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/pre-commit.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v3
14+
- uses: pre-commit/[email protected]

.pre-commit-config.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
repos:
22
- repo: https://github.com/pycqa/isort
3-
rev: 5.7.0
3+
rev: 5.10.1
44
hooks:
55
- id: isort
66
- repo: https://github.com/ambv/black
7-
rev: 22.3.0
7+
rev: 22.8.0
88
hooks:
99
- id: black
1010
language_version: python3
11-
- repo: https://gitlab.com/pycqa/flake8
12-
rev: 3.8.4
11+
exclude: elasticapm\/utils\/wrapt
12+
- repo: https://github.com/PyCQA/flake8
13+
rev: 5.0.4
1314
hooks:
1415
- id: flake8
1516
exclude: elasticapm\/utils\/wrapt|build|src|tests|dist|conftest.py|setup.py

Jenkinsfile

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -67,35 +67,6 @@ pipeline {
6767
}
6868
}
6969
}
70-
stage('Sanity checks') {
71-
when {
72-
beforeAgent true
73-
allOf {
74-
expression { return env.ONLY_DOCS == "false" }
75-
anyOf {
76-
not { changeRequest() }
77-
expression { return params.Run_As_Main_Branch }
78-
}
79-
}
80-
}
81-
environment {
82-
PATH = "${env.WORKSPACE}/.local/bin:${env.WORKSPACE}/bin:${env.PATH}"
83-
}
84-
steps {
85-
withGithubNotify(context: 'Sanity checks', tab: 'tests') {
86-
deleteDir()
87-
unstash 'source'
88-
script {
89-
docker.image('python:3.7-stretch').inside(){
90-
dir("${BASE_DIR}"){
91-
// registry: '' will help to disable the docker login
92-
preCommit(commit: "${GIT_BASE_COMMIT}", junit: true, registry: '')
93-
}
94-
}
95-
}
96-
}
97-
}
98-
}
9970
/**
10071
Execute unit tests.
10172
*/

0 commit comments

Comments
 (0)