Skip to content

Commit

Permalink
style: format with Ruff (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson authored Jun 26, 2024
1 parent 95bf5ce commit f82e37d
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
run: |
isort --check src
- name: Format check with black
- name: Format check with Ruff
run: |
black --check src
ruff format --check src
# Disable bandit until issues are resolved
# - name: Security check with bandit
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ build: %:
cqa:
flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics
isort --profile black --check src
black --check src
ruff format --check src
bandit -ll -r src

#=> test: execute tests
Expand All @@ -95,9 +95,9 @@ tox:
.PHONY: reformat
reformat:
@if ! git diff --cached --exit-code >/dev/null; then echo "Repository not clean" 1>&2; exit 1; fi
black src tests
ruff format src tests
isort src tests
git commit -a -m "reformatted with black and isort"
git commit -a -m "reformatted with ruff and isort"

#=> rename: rename files and substitute content for new repo name
.PHONY: rename
Expand Down Expand Up @@ -141,13 +141,13 @@ distclean: cleanest

## <LICENSE>
## Copyright 2023 Source Code Committers
##
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
##
## http://www.apache.org/licenses/LICENSE-2.0
##
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ exclude_lines = [
"if __name__ == .__main__.:",
]

[tool.black]
line-length = 120

[tool.isort]
profile = "black"

Expand All @@ -107,3 +104,8 @@ disable = "R0913"

[tool.pylint.format]
max-line-length = "120"


[tool.ruff]
src = ["src", "tests"]
line-length = 120
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ zip_safe = True
[options.extras_require]
dev =
bandit~=1.7
black~=22.3
build~=0.8
flake8~=4.0
ipython~=8.4
isort~=5.10
mypy
pylint~=2.14
ruff == 0.4.4
test =
pytest~=7.1
pytest-cov~=4.0
pytest-optional-tests
tox~=3.25
vcrpy
docs =
docs =
mkdocs

[options.packages.find]
Expand Down
1 change: 1 addition & 0 deletions src/bioutils/accessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
The string form may be used as a CURIE, in which case the document in
which the CURIE is used must contain a map of ``{namespace : uri}``.
"""

import re

from .exceptions import BioutilsError
Expand Down
4 changes: 1 addition & 3 deletions src/bioutils/normalize.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
"""Provides functionality for normalizing alleles, ensuring comparable representations.
"""
"""Provides functionality for normalizing alleles, ensuring comparable representations."""

import copy
import enum
Expand Down
3 changes: 1 addition & 2 deletions src/bioutils/seqfetcher.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
"""Provides sequence fetching from NCBI and Ensembl.
"""Provides sequence fetching from NCBI and Ensembl."""

"""
import logging
import os
import random
Expand Down
3 changes: 1 addition & 2 deletions src/bioutils/sequences.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
"""Simple functions and lookup tables for nucleic acid and amino acid sequences.
"""
"""Simple functions and lookup tables for nucleic acid and amino acid sequences."""

import logging
import re
Expand Down

0 comments on commit f82e37d

Please sign in to comment.