Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#239)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.1 → v0.4.2](astral-sh/ruff-pre-commit@v0.4.1...v0.4.2)
- [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.0](pre-commit/mirrors-mypy@v1.9.0...v1.10.0)

* Update ruff config and address lint error

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Steven Loria <sloria1@gmail.com>
  • Loading branch information
pre-commit-ci[bot] and sloria authored May 2, 2024
1 parent cf67faa commit 27e1bb2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exclude: docopt.py

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
rev: v0.4.2
hooks:
- id: ruff
- id: ruff-format
Expand All @@ -17,7 +17,7 @@ repos:
- id: blacken-docs
additional_dependencies: [black==23.12.1]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.10.0
hooks:
- id: mypy
exclude: example_rcfiles/
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ exclude = ["docs/_build/", "tests/test-output"]
src = ["src"]
fix = true
show-fixes = true
show-source = true
output-format = "full"

[tool.ruff.lint]
select = [
Expand Down
10 changes: 5 additions & 5 deletions src/konch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,13 +1007,13 @@ def resolve_path(filename: Path) -> typing.Union[Path, None]:

def get_editor() -> str:
for key in "KONCH_EDITOR", "VISUAL", "EDITOR":
ret = os.environ.get(key)
if ret:
return ret
rv = os.environ.get(key)
if rv:
return rv
if sys.platform.startswith("win"):
return "notepad"
for editor in "vim", "nano":
if os.system("which %s &> /dev/null" % editor) == 0:
for editor in "sensible-editor", "vim", "nano":
if os.system(f"which {editor} >/dev/null 2>&1") == 0:
return editor
return "vi"

Expand Down

0 comments on commit 27e1bb2

Please sign in to comment.