Skip to content

Commit

Permalink
pre-commit upgrade
Browse files Browse the repository at this point in the history
* updates the deps
* removes unnecessary ignores
  • Loading branch information
RonnyPfannschmidt committed Feb 22, 2023
1 parent 0d8b32a commit 34b89c7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 26 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ repos:
- id: reorder-python-imports
args: [--py37-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.0
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.1.0
hooks:
- id: black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
#- id: check-yaml
- id: debug-statements
- repo: https://github.com/pycqa/flake8
rev: '5.0.4'
rev: '6.0.0'
hooks:
- id: flake8
exclude: tests
additional_dependencies:
- flake8-quotes>=3.2
- flake8-docstrings>=1.5
- flake8-quotes>=3.3.2
- flake8-docstrings>=1.7.0
6 changes: 3 additions & 3 deletions prance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
__copyright__ = "Copyright (c) 2016-2021 Jens Finkhaeuser"
__license__ = "MIT"
__all__ = ("util", "mixins", "cli", "convert")
import sys

from packaging.version import Version

Expand All @@ -20,16 +21,15 @@
# todo: better gussing
__version__ = "0.20.0+unknown"

from . import mixins


# Define our own error class
class ValidationError(Exception):
pass


from . import mixins

# Placeholder for when no URL is specified for the main spec file
import sys

if sys.platform == "win32": # pragma: nocover
# Placeholder must be absolute
Expand Down
4 changes: 1 addition & 3 deletions prance/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import click

import prance
from prance.util import default_validation_backend


def __write_to_file(filename, specs): # noqa: N802
Expand Down Expand Up @@ -115,9 +116,6 @@ def command_invoke(ctx):
return command_invoke


from prance.util import default_validation_backend


@click.group(cls=GroupWithCommandOptions)
@click.option(
"--resolve/--no-resolve",
Expand Down
5 changes: 3 additions & 2 deletions prance/util/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def is_pathname_valid(pathname):
otherwise.
:rtype: bool
"""
import errno, os
import errno
import os

# If this pathname is either not a string or is but is empty, this pathname
# is invalid.
Expand Down Expand Up @@ -195,7 +196,7 @@ def canonical_filename(filename):
:return: The canonical filename.
:rtype: str
"""
import os, os.path
import os.path

path = from_posix(filename)
while True:
Expand Down
5 changes: 2 additions & 3 deletions prance/util/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ def _dereferencing_iterator(self, base_url, partial, path, recursions):
# Split the reference string into parsed URL and object path
ref_url, obj_path = _url.split_url_reference(base_url, refstring)

translate = (
self.__resolve_method == TRANSLATE_EXTERNAL
and self.parsed_url.path != ref_url.path
translate = (self.__resolve_method == TRANSLATE_EXTERNAL) and (
self.parsed_url.path != ref_url.path
)

if self._skip_reference(base_url, ref_url):
Expand Down
11 changes: 2 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,10 @@ exclude =
.git,
__pycache__,
docs/source/conf.py,old,build,dist,.eggs,
ENV,lib,setup.py
.toxgit di
ENV,lib,.tox,
prance/_version.py

ignore =
E111,E114,E128,E121,
E251,
E402,
E401,
N807.
W503

max-line-length = 88
show-source = True
doctests = True

0 comments on commit 34b89c7

Please sign in to comment.