Skip to content

Add flake8 config and GitHub Actions workflow for linting.Add python linter #325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 88
exclude = .venv,venv,build,dist,*.egg-info,__pycache__
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Python Linter

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8

- name: Run flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@ Certain utilities also have non-Python dependencies, which must be installed sep
- `graph-sbol` requires [Graphviz](https://graphviz.org/) to be able to render diagrams.
- `sbol-converter` requires [node.js](https://nodejs.org/en/) to be able to locally run Javascript.

## 🔗 Mapping: Command-Line Tools to Python Modules

This table provides a quick reference to help developers understand where each command-line utility is implemented within the Python package.

| **Command-line Tool** | **Python Module** | **Entry Point Function** |
| --------------------------- | ------------------------------------------------- | ------------------------ |
| `excel-to-sbol` | `sbol_utilities.excel_to_sbol` | `main` |
| `graph-sbol` | `sbol_utilities.graph_sbol` | `main` |
| `sbol-expand-derivations` | `sbol_utilities.expand_combinatorial_derivations` | `main` |
| `sbol-calculate-sequences` | `sbol_utilities.calculate_sequences` | `main` |
| `sbol-calculate-complexity` | `sbol_utilities.calculate_complexity_scores` | `main` |
| `sbol-converter` | `sbol_utilities.conversion` | `main` |
| `sbol2-to-sbol3` | `sbol_utilities.conversion` | `sbol2to3` |
| `sbol3-to-sbol2` | `sbol_utilities.conversion` | `sbol3to2` |
| `sbol-to-genbank` | `sbol_utilities.conversion` | `sbol2genbank` |
| `genbank-to-sbol` | `sbol_utilities.conversion` | `genbank2sbol` |
| `sbol-to-fasta` | `sbol_utilities.conversion` | `sbol2fasta` |
| `fasta-to-sbol` | `sbol_utilities.conversion` | `fasta2sbol` |
| `sbol-diff` | `sbol_utilities.sbol_diff` | `main` |

## Utilities

Expand Down
Loading