Skip to content

Commit 760b398

Browse files
committed
style: update ruff/precommit configs, drop other style tooling
1 parent 44e810c commit 760b398

31 files changed

+688
-387
lines changed

.deepsource.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
version = 1
22

33
test_patterns = [
4-
4+
55
]
66

77
exclude_patterns = [
8-
8+
99
]
1010

1111
[[analyzers]]
1212
name = 'python'
1313
enabled = true
1414
runtime_version = '3.x.x'
15-

.github/workflows/labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
https://raw.githubusercontent.com/biocommons/.github/main/etc/labels.yml
2727
.github/labels.yml
2828
29-
delete-other-labels: false
29+
delete-other-labels: false

.github/workflows/python-package.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@ jobs:
4444
run: |
4545
ruff format --check .
4646
47+
- name: Ensure EOF line
48+
uses: pre-commit/[email protected]
49+
with:
50+
extra_args: end-of-file-fixer --all-files
51+
52+
- name: Fix trailing whitespace
53+
uses: pre-commit/[email protected]
54+
with:
55+
extra_args: trailing-whitespace --all-files
56+
57+
- name: Fix mixed line endings
58+
uses: pre-commit/[email protected]
59+
with:
60+
extra_args: mixed-line-ending --all-files
4761
test:
4862
runs-on: ubuntu-latest
4963

@@ -136,4 +150,4 @@ jobs:
136150
name: python-package-distributions
137151
path: dist/
138152
- name: Publish distribution to PyPI
139-
uses: pypa/gh-action-pypi-publish@release/v1
153+
uses: pypa/gh-action-pypi-publish@release/v1

.pre-commit-config.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: detect-private-key
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-merge-conflict
10+
- id: detect-aws-credentials
11+
args: [ --allow-missing-credentials ]
12+
- id: mixed-line-ending
13+
args: [ --fix=lf ]
214
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.4.4
15+
rev: v0.12.8
416
hooks:
517
- id: ruff-format
6-
args: [ --check ]
18+
- id: ruff
19+
args: [ --fix, --exit-non-zero-on-fix ]
20+
minimum_pre_commit_version: 4.2.0

.vscode/settings.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

Makefile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,7 @@ build: %:
6363

6464
############################################################################
6565
#= TESTING
66-
# see test configuration in setup.cfg
67-
68-
#=> cqa: execute code quality tests
69-
cqa:
70-
flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics
71-
isort --profile black --check src
72-
ruff format --check src
73-
bandit -ll -r src
66+
# see test configuration in pyproject.toml
7467

7568
#=> test: execute tests
7669
#=> test-code: test code (including embedded doctests)
@@ -83,6 +76,17 @@ test-code:
8376
test-docs:
8477
pytest docs
8578

79+
#=> cqa: execute code quality tests
80+
cqa:
81+
ruff format --check
82+
ruff check
83+
84+
#=> reformat: reformat code
85+
.PHONY: reformat
86+
reformat:
87+
ruff check --fix
88+
ruff format
89+
8690
#=> tox -- run all tox tests
8791
tox:
8892
tox

README.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ bioutils -- bioinformatics utilities and lookup tables
66

77
bioutils provides some common utilities and lookup tables for bioinformatics.
88

9-
* bioutils.accessions -- parse accessions, infer namespaces
9+
* bioutils.accessions -- parse accessions, infer namespaces
1010
* bioutils.assemblies -- Human assembly information (from NCBI/GRCh)
1111
* bioutils.cytobands -- map cytobands to coordinates (from UCSC cytoband tables)
1212
* bioutils.digests -- implementations of various digests
1313
* bioutils.normalize -- allele normalization (left shuffle, right shuffle, expanded, vcf)
14-
14+
1515

1616
To use an E-Utilities API key run add it to an environment variable
1717
called `ncbi_api_key` and it will be used in the E-Utilities request.
@@ -38,11 +38,10 @@ called `ncbi_api_key` and it will be used in the E-Utilities request.
3838
.. |pypi_badge| image:: https://img.shields.io/pypi/v/bioutils.svg
3939
:target: https://pypi.org/project/bioutils/
4040

41-
41+
4242
.. |cc_badge| image:: https://api.codeclimate.com/v1/badges/3a99e06ad0a842174b0a/maintainability
4343
:target: https://codeclimate.com/github/biocommons/bioutils/maintainability
4444
:alt: Maintainability
4545

4646
.. |cov_badge| image:: https://coveralls.io/repos/github/biocommons/bioutils/badge.svg?branch=master
4747
:target: https://coveralls.io/github/biocommons/bioutils?branch=master
48-

bin/fasta-ga4gh-identifier

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
"""compute and display ga4gh sequence identifiers for sequences in a fasta file
44
5-
snafu$ ./bin/fasta-ga4gh-identifier ~/Downloads/GCA_000001405.28_GRCh38.p13_genomic.fna.gz
5+
snafu$ ./bin/fasta-ga4gh-identifier ~/Downloads/GCA_000001405.28_GRCh38.p13_genomic.fna.gz
66
ga4gh:SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO CM000663.2 CM000663.2 Homo sapiens chromosome 1, GRCh38 reference primary assembly
77
ga4gh:SQ.pnAqCRBrTsUoBghSD1yp_jXWSmlbdh4g CM000664.2 CM000664.2 Homo sapiens chromosome 2, GRCh38 reference primary assembly
88
ga4gh:SQ.Zu7h9AggXxhTaGVsy7h_EZSChSZGcmgX CM000665.2 CM000665.2 Homo sapiens chromosome 3, GRCh38 reference primary assembly
99
10-
snafu$ ./bin/fasta-ga4gh-identifier ~/Downloads/Homo_sapiens.GRCh38.dna.toplevel.fa.gz
10+
snafu$ ./bin/fasta-ga4gh-identifier ~/Downloads/Homo_sapiens.GRCh38.dna.toplevel.fa.gz
1111
ga4gh:SQ.2YnepKM7OkBoOrKmvHbGqguVfF9amCST 1 1 dna:chromosome chromosome:GRCh38:1:1:248956422:1 REF
1212
ga4gh:SQ.lwDyBi432Py-7xnAISyQlnlhWDEaBPv2 2 2 dna:chromosome chromosome:GRCh38:2:1:242193529:1 REF
1313
ga4gh:SQ.Eqk6_SvMMDCc6C-uEfickOUWTatLMDQZ 3 3 dna:chromosome chromosome:GRCh38:3:1:198295559:1 REF

docs/source/changelog/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ Change Log
55

66
.. toctree::
77
:maxdepth: 2
8-
8+
99
0.4/index
1010
0.5/index

docs/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ bioutils -- bioinformatics utilities and lookup tables
33

44
bioutils provides common utilities and lookup tables for bioinformatics.
55

6-
* bioutils.accessions -- parse accessions, infer namespaces
6+
* bioutils.accessions -- parse accessions, infer namespaces
77
* bioutils.assemblies -- Human assembly information (from NCBI/GRCh)
88
* bioutils.cytobands -- map cytobands to coordinates (from UCSC cytoband tables)
99
* bioutils.digests -- implementations of various digests
1010
* bioutils.normalize -- allele normalization (left shuffle, right shuffle, expanded, vcf)
11-
11+
1212
To use an E-Utilities API key run add it to an environment variable
1313
called `ncbi_api_key` and it will be used in the E-Utilities request.
1414

0 commit comments

Comments
 (0)