Skip to content

Commit

Permalink
simplifying workflows yml file, adding flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
gesinaphillips committed Feb 2, 2024
1 parent e30f426 commit 99858a1
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 31 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
extend-ignore = E203,E501,W503
max-line-length = 99
13 changes: 0 additions & 13 deletions .github/workflows/black.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/isort.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Linters

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black isort
- name: Flake8 Lint
run: |
flake8 --ignore=E501,W503,E203
- name: Black Lint
run: |
black --line-length 99 --check --verbose
- name: isort Lint
run: |
isort --profile black --check-only --diff
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.vscode/
.flake8

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ This repository contains plug-in tests for use during validation of submissions.
### Branches

- Make new feature branches from `devel`.
- Before submitting a PR, make sure your code is black and isort compliant. Run the following from the base `ingest-validation-tests` directory:
- Before submitting a PR, make sure your code is black, isort, and flake8 compliant. Run the following from the base `ingest-validation-tests` directory:

```
black --line-length 99 .
isort --profile black --multi-line 3 .
flake8
```

(You can integrate black and potentially isort with your editor to skip this step, see Setup section below)
(Integrating black and potentially isort/flake8 with your editor may allow you to skip this step, see Setup section below.)

- Make PRs to `devel`. (This is the default branch.)
- The last reviewer to approve a PR should merge it.
Expand All @@ -32,6 +33,7 @@ This repository contains plug-in tests for use during validation of submissions.
- (optional) Integrate black with your editor.
- [Instructions for black.](https://black.readthedocs.io/en/stable/integrations/editors.html)
- (optional) Integrate [isort](https://pycqa.github.io/isort/) with your editor.
- (optional) Integrate [flake8](https://flake8.pycqa.org/en/latest/index.html) with your editor.

### Testing

Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
black==23.12.1
flake8==7.0.0
git+https://github.com/hubmapconsortium/fastq-utils.git@v0.2.5#egg=hubmap-fastq-utils
imagecodecs>=2023.3.16
isort==5.13.2
Expand Down

0 comments on commit 99858a1

Please sign in to comment.