build(deps): updte dependencies

This commit is contained in:
Nathaniel Landau
2023-08-28 09:29:47 -04:00
parent 34aa78c103
commit 461a067115
6 changed files with 448 additions and 481 deletions

View File

@@ -5,7 +5,7 @@ default_stages: [commit, manual]
fail_fast: true
repos:
- repo: "https://github.com/commitizen-tools/commitizen"
rev: 3.5.2
rev: 3.7.0
hooks:
- id: commitizen
- id: commitizen-branch
@@ -61,14 +61,14 @@ repos:
entry: yamllint --strict --config-file .yamllint.yml
- repo: "https://github.com/charliermarsh/ruff-pre-commit"
rev: "v0.0.277"
rev: "v0.0.286"
hooks:
- id: ruff
args: ["--extend-ignore", "I001,D301,D401"]
exclude: tests/
- repo: "https://github.com/jendrikseipp/vulture"
rev: "v2.7"
rev: "v2.9.1"
hooks:
- id: vulture

871
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -17,16 +17,16 @@
obsidian-metadata = "obsidian_metadata.cli:app"
[tool.poetry.dependencies]
charset-normalizer = "^3.1.0"
emoji = "^2.6.0"
charset-normalizer = "^3.2.0"
emoji = "^2.8.0"
loguru = "^0.7.0"
python = "^3.10"
questionary = "^1.10.0"
regex = "^2023.6.3"
rich = "^13.4.2"
regex = "^2023.8.8"
rich = "^13.5.2"
ruamel-yaml = "^0.17.32"
shellingham = "^1.5.0.post1"
tomlkit = "^0.11.8"
shellingham = "^1.5.3"
tomlkit = "^0.12.1"
typer = "^0.9.0"
[tool.poetry.group.test.dependencies]
@@ -37,19 +37,18 @@
pytest-xdist = "^3.3.1"
[tool.poetry.group.dev.dependencies]
black = "^23.3.0"
commitizen = "^3.5.2"
coverage = "^7.2.7"
black = "^23.7.0"
commitizen = "^3.7.0"
coverage = "^7.3.0"
interrogate = "^1.5.0"
mypy = "^1.4.1"
mypy = "^1.5.1"
pdoc = "^14.0.0"
poethepoet = "^0.20.0"
poethepoet = "^0.22.0"
pre-commit = "^3.3.3"
ruff = "^0.0.277"
sh = "^2.0.4"
typeguard = "^4.0.0"
types-python-dateutil = "^2.8.19.13"
vulture = "^2.7"
ruff = "^0.0.286"
sh = "^2.0.6"
types-python-dateutil = "^2.8.19.14"
vulture = "^2.9.1"
[tool.black]
line-length = 100

View File

@@ -124,14 +124,10 @@ def dim(msg: str) -> None:
def _log_formatter(record: dict) -> str:
"""Create custom log formatter based on the log level. This effects the logs sent to stdout/stderr but not the log file."""
if (
record["level"].name == "INFO"
or record["level"].name == "SUCCESS"
or record["level"].name == "WARNING"
):
if record["level"].name in ("INFO", "SUCCESS", "WARNING"):
return "<level><normal>{level: <8} | {message}</normal></level>\n{exception}"
if record["level"].name == "TRACE" or record["level"].name == "DEBUG":
if record["level"].name in ("TRACE", "DEBUG"):
return "<level><normal>{level: <8} | {message}</normal></level> <fg #c5c5c5>({name}:{function}:{line})</fg #c5c5c5>\n{exception}"
return "<level>{level: <8} | {message}</level> <fg #c5c5c5>({name}:{function}:{line})</fg #c5c5c5>\n{exception}"

View File

@@ -236,7 +236,7 @@ def validate_csv_bulk_imports( # noqa: C901
{"type": row["type"], "key": row["key"], "value": row["value"]}
)
if row_num == 0 or row_num == 1:
if row_num in [0, 1]:
raise typer.BadParameter("Empty CSV file")
paths_to_remove = [x for x in csv_dict if x not in note_paths]

View File

@@ -481,7 +481,7 @@ class Note:
MetadataType.FRONTMATTER, search_key, search_value, is_regex
) or self.contains_metadata(MetadataType.INLINE, search_key, search_value, is_regex)
if meta_type == MetadataType.FRONTMATTER or meta_type == MetadataType.INLINE:
if meta_type in [MetadataType.FRONTMATTER, MetadataType.INLINE]:
if search_key is None or re.match(r"^\s*$", search_key):
return False
@@ -562,8 +562,7 @@ class Note:
meta_to_delete.extend(
self._find_matching_fields(MetadataType.TAGS, key, value, is_regex)
)
elif meta_type == MetadataType.FRONTMATTER or meta_type == MetadataType.INLINE:
elif meta_type in {MetadataType.FRONTMATTER, MetadataType.INLINE}:
if key is None or re.match(r"^\s*$", key):
log.error("A valid key must be specified.")
raise typer.Exit(code=1)
@@ -770,7 +769,9 @@ class Note:
if not is_regex:
pattern = re.escape(pattern)
self.file_content, num_subs = re.subn(pattern, replacement, self.file_content, re.MULTILINE)
self.file_content, num_subs = re.subn(
pattern, replacement, self.file_content, flags=re.MULTILINE
)
return num_subs > 0
@@ -801,7 +802,7 @@ class Note:
if begin == MetadataType.FRONTMATTER and end == MetadataType.FRONTMATTER:
return False
if begin == MetadataType.TAGS or end == MetadataType.TAGS:
if MetadataType.TAGS in {begin, end}:
# TODO: Implement transposing to and from tags
return False