Skip to content

Commit 1dc0352

Browse files
authored
Pre-commit configuration (#1015)
* flake8 added * Create Pre-commit-hooks.yml
1 parent e381bf7 commit 1dc0352

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: pre-commit
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow pull request events but only for the master branch
8+
pull_request:
9+
push:
10+
branches: [master]
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
16+
jobs:
17+
# Using Ubuntu image with latest tag
18+
pre-commit:
19+
runs-on: ubuntu-latest
20+
21+
# Steps represent a sequence of tasks that will be executed as part of the job
22+
steps:
23+
- uses: actions/checkout@v3
24+
#setting up Python v3.0.0
25+
- uses: actions/setup-python@v3.0.0
26+
#using pre-commit latest i.e v2.0.3
27+
- uses: pre-commit/action@v2.0.3
28+
#Running pre-commit for all files
29+
- name: Pre-Commit-Run
30+
run: |
31+
pip install pre-commit
32+
pre-commit run --all-files

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
default_stages: [commit, push]
2+
default_language_version:
3+
python: python3.8
4+
repos:
5+
- repo: https://github.com/PyCQA/flake8
6+
rev: 3.8.2
7+
hooks:
8+
- id: flake8
9+
args: [
10+
--max-line-length=100
11+
]
12+
exclude: ^(venv/|docs/)
13+
types: ['python']

0 commit comments

Comments
 (0)