Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nvictus committed May 21, 2024
1 parent c16d39c commit eb3b3be
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ exclude = [
"__init__.py",
"__main__.py",
]

[tool.ruff.lint]
extend-select = [
"E", # style errors
# "D", # pydocstyle
Expand All @@ -112,10 +114,8 @@ extend-select = [
"W", # style warnings
]

[tool.isort]
profile = "black"
skip_gitignore = true
known_first_party = "cooler"
[tool.ruff.lint.isort]
known-first-party = ["cooler"]

[tool.pytest.ini_options]
addopts = "--cov cooler --cov-config pyproject.toml --cov-report term-missing --cov-report html --cov-report=xml"
Expand Down
2 changes: 1 addition & 1 deletion src/cooler/cli/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, sep=",", type=str):

@property
def name(self):
return "separated[%s]" % self.sep
return f"separated[{self.sep}]"

def convert(self, value, param, ctx):
# needs to pass through value = None unchanged
Expand Down
1 change: 0 additions & 1 deletion src/cooler/create/_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import numpy as np
import pandas as pd
import simplejson as json
from pandas.api.types import is_categorical_dtype

from .._logging import get_logger
from .._typing import Tabular
Expand Down
2 changes: 1 addition & 1 deletion src/cooler/fileops.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def _tree_get_icon(
elif stype in {"Group", "File"}:
return "folder"
else:
raise ValueError("Unknown type: %s" % stype)
raise ValueError(f"Unknown type: {stype}")

def _tree_widget_sublist(
node: TreeNode, root: bool = False, expand: bool = False
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_makebins():
assert result.exit_code == 0
assert (
result.output
== "chr1\t0\t8\nchr1\t8\t16\nchr1\t16\t24\nchr1\t24\t32\nchr2\t0\t8\nchr2\t8\t16\nchr2\t16\t24\nchr2\t24\t32\n"
== "chr1\t0\t8\nchr1\t8\t16\nchr1\t16\t24\nchr1\t24\t32\nchr2\t0\t8\nchr2\t8\t16\nchr2\t16\t24\nchr2\t24\t32\n" # noqa
)

result = runner.invoke(
Expand All @@ -73,7 +73,7 @@ def test_makebins():
assert result.exit_code == 0
assert (
result.output
== "chrom\tstart\tend\tid\nchr1\t0\t8\t1\nchr1\t8\t16\t2\nchr1\t16\t24\t3\nchr1\t24\t32\t4\nchr2\t0\t8\t1\nchr2\t8\t16\t2\nchr2\t16\t24\t3\nchr2\t24\t32\t4\n"
== "chrom\tstart\tend\tid\nchr1\t0\t8\t1\nchr1\t8\t16\t2\nchr1\t16\t24\t3\nchr1\t24\t32\t4\nchr2\t0\t8\t1\nchr2\t8\t16\t2\nchr2\t16\t24\t3\nchr2\t24\t32\t4\n" # noqa
)


Expand Down

0 comments on commit eb3b3be

Please sign in to comment.