Skip to content

Commit

Permalink
Merge pull request #10 from monarch-initiative/issue-fix_linting
Browse files Browse the repository at this point in the history
lint files to pass qc check
  • Loading branch information
twhetzel authored Mar 21, 2024
2 parents d734c2e + cb5709a commit 54ccc63
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 18 deletions.
13 changes: 7 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
import sys
from datetime import date
from mondolib import __version__

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'mondolib'
project = "mondolib"
copyright = f"{date.today().year}, Chris Mungall <[email protected]>"
author = 'Chris Mungall <[email protected]>'
author = "Chris Mungall <[email protected]>"
release = __version__

# -- General configuration ---------------------------------------------------
Expand All @@ -24,7 +25,7 @@
"sphinx_rtd_theme",
"sphinx_click",
"sphinx_autodoc_typehints",
"myst_parser"
"myst_parser",
]

# generate autosummary pages
Expand All @@ -45,13 +46,13 @@
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

templates_path = ['_templates']
templates_path = ["_templates"]

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ line-length = 120
target-version = ["py38", "py39", "py310"]

[tool.ruff]
extend-ignore = [
lint.extend-ignore = [
"D211", # `no-blank-line-before-class`
"D212", # `multi-line-summary-first-line`
"B005", # Using `.strip()` with multi-character strings is misleading the reader
Expand All @@ -50,10 +50,10 @@ exclude = [
line-length = 120

# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
lint.fixable = ["ALL"]

# Select or ignore from https://beta.ruff.rs/docs/rules/
select = [
lint.select = [
"B", # bugbear
"D", # pydocstyle
"E", # pycodestyle errors
Expand All @@ -63,10 +63,10 @@ select = [
"W", # Warning
]

unfixable = []
lint.unfixable = []
target-version = "py310"

[tool.ruff.mccabe]
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10

Expand Down
1 change: 1 addition & 0 deletions src/mondolib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""mondolib package."""

import importlib_metadata

try:
Expand Down
1 change: 1 addition & 0 deletions src/mondolib/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Command line interface for mondolib."""

import logging

import click
Expand Down
1 change: 1 addition & 0 deletions src/mondolib/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants used in package."""

from pathlib import Path

ONT_DIR = Path(__file__).resolve().parents[1] / "ontology"
Expand Down
10 changes: 4 additions & 6 deletions src/mondolib/datamodels/mondolib_schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Autogenerated Schema file."""

# Auto generated from mondolib_schema.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-06-10T11:39:26
# Schema: mondolib_schema
Expand Down Expand Up @@ -44,7 +45,6 @@ class CandidateObsoletionTerm(extended_str):

@dataclass
class LexicalPattern(YAMLRoot):

"""A lexical pattern that is matched against labels."""

_inherited_slots: ClassVar[List[str]] = []
Expand Down Expand Up @@ -119,9 +119,9 @@ class CandidateObsoletion(YAMLRoot):
label: Optional[str] = None
confidence: Optional[float] = None
is_ordo_only: Optional[Union[bool, Bool]] = None
lexical_pattern_matches: Optional[
Union[Union[dict, LexicalPattern], List[Union[dict, LexicalPattern]]]
] = empty_list()
lexical_pattern_matches: Optional[Union[Union[dict, LexicalPattern], List[Union[dict, LexicalPattern]]]] = (
empty_list()
)
direct_child_terms: Optional[Union[str, List[str]]] = empty_list()
is_likely_grouping: Optional[Union[bool, Bool]] = None
has_definition: Optional[Union[bool, Bool]] = None
Expand Down Expand Up @@ -164,7 +164,6 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):

@dataclass
class Report(YAMLRoot):

"""A pan-ontology report. This focuses on bespoke Mondo checks rather than generic OBO checks."""

_inherited_slots: ClassVar[List[str]] = []
Expand All @@ -191,7 +190,6 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):

# Enumerations
class ValidationCheckScope(EnumDefinitionImpl):

"""Some validations are only performed in particular contexts or scopes."""

ORDO_ONLY = PermissibleValue(
Expand Down
1 change: 1 addition & 0 deletions src/mondolib/datamodels/vocabulary.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""mondolib datamodel vocabularies."""

ORPHANET_PREFIX = "Orphanet"
1 change: 1 addition & 0 deletions src/mondolib/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Main python file."""

import csv
from typing import List, Tuple

Expand Down
1 change: 1 addition & 0 deletions src/mondolib/qc/term_validator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""mondolib term-validator."""

import logging
import os
import re
Expand Down
1 change: 1 addition & 0 deletions src/mondolib/utilities/curie_utilities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""mondolib CURIE utilities."""

from oaklib.types import CURIE


Expand Down
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""mondolib tests."""

import os
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions tests/test_qc/test_term_validator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""mondolib QC test: test validator."""

import unittest

from linkml_runtime.dumpers import yaml_dumper
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ deps =
ruff
skip_install = true
commands =
black --check --diff src/ tests/
; black --check --diff src/ tests/
ruff check src/ tests/
description = Run linters.

Expand Down

0 comments on commit 54ccc63

Please sign in to comment.