Skip to content

Commit

Permalink
Pre-commit configuration (zarr-developers#1015)
Browse files Browse the repository at this point in the history
* flake8 added

* Create Pre-commit-hooks.yml
  • Loading branch information
Alt-Shivam authored Apr 29, 2022
1 parent e381bf7 commit 1dc0352
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/Pre-commit-hooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This is a basic workflow to help you get started with Actions

name: pre-commit

# Controls when the workflow will run
on:
# Triggers the workflow pull request events but only for the master branch
pull_request:
push:
branches: [master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Using Ubuntu image with latest tag
pre-commit:
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v3
#setting up Python v3.0.0
- uses: actions/[email protected]
#using pre-commit latest i.e v2.0.3
- uses: pre-commit/[email protected]
#Running pre-commit for all files
- name: Pre-Commit-Run
run: |
pip install pre-commit
pre-commit run --all-files
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
default_stages: [commit, push]
default_language_version:
python: python3.8
repos:
- repo: https://github.com/PyCQA/flake8
rev: 3.8.2
hooks:
- id: flake8
args: [
--max-line-length=100
]
exclude: ^(venv/|docs/)
types: ['python']

0 comments on commit 1dc0352

Please sign in to comment.