Skip to content

Commit

Permalink
Add static analysis workflow and minor changes in .pre-commit-config.…
Browse files Browse the repository at this point in the history
…yaml

Signed-off-by: Priyanshi Gaur <[email protected]>
  • Loading branch information
nox1134 committed Mar 12, 2024
1 parent 0b8fd6f commit 34cc9a5
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 41 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/python_static_analysis.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Static Analysis

on:
pull_request:
push:
branches: [main]
workflow_dispatch:

jobs:
job:
runs-on: ubuntu-latest

steps:

# https://github.com/actions/setup-python
- name: Install Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install black 'black[jupyter]' flake8 isort
pip install pre-commit
# https://github.com/actions/checkout
- name: Checkout quantifying
uses: actions/checkout@v4
with:
path: quantifying

- name: pre-commit
run: pre-commit run --show-diff-on-failure --color=always --all-files
working-directory: ./quantifying
28 changes: 24 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: \\.coverage.*
default_language_version:
python: python3.9
python: python3.11

ci:
autofix_commit_msg: |
Expand All @@ -16,12 +15,33 @@ ci:
skip: []
submodules: false

repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: destroyed-symlinks
- id: end-of-file-fixer
- id: mixed-line-ending
args:
- --fix=no
- id: trailing-whitespace

repos:
- repo: local
hooks:
- id: black
name: "Black"
entry: black --check
entry: black
language: system
types: ["file", "python", "text"]

Expand All @@ -33,6 +53,6 @@ repos:

- id: isort
name: "isort"
entry: isort --check --filter-files
entry: isort --filter-files
language: system
types: ["file", "python", "text"]

0 comments on commit 34cc9a5

Please sign in to comment.