Skip to content

Commit

Permalink
Ruff (#806)
Browse files Browse the repository at this point in the history
Ruff

Reviewed-by: Jiri Popelka
Reviewed-by: Matej Focko
  • Loading branch information
softwarefactory-project-zuul[bot] authored Oct 12, 2023
2 parents 4c759b5 + 918245c commit 346e911
Show file tree
Hide file tree
Showing 79 changed files with 1,299 additions and 901 deletions.
15 changes: 6 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
# pre-commit install -t pre-commit -t pre-push

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
hooks:
- id: pyupgrade
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
Expand All @@ -29,11 +25,6 @@ repos:
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
args: [--max-line-length=100]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
Expand Down Expand Up @@ -63,3 +54,9 @@ repos:
- id: requre-purge
# Do not run in pre-commit.ci as it requires too much time
stages: [manual, push]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.291
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
10 changes: 4 additions & 6 deletions ogr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,22 @@
Module providing one api for multiple git services (github/gitlab/pagure)
"""

import contextlib
from importlib.metadata import PackageNotFoundError, distribution

from ogr.abstract import AuthMethod
from ogr.factory import (
get_instances_from_dict,
get_project,
get_service_class,
get_service_class_or_none,
get_instances_from_dict,
)
from ogr.services.github import GithubService
from ogr.services.gitlab import GitlabService
from ogr.services.pagure import PagureService
from ogr.abstract import AuthMethod

try:
with contextlib.suppress(PackageNotFoundError):
__version__ = distribution(__name__).version
except PackageNotFoundError:
# package is not installed
pass

__all__ = [
GithubService.__name__,
Expand Down
Loading

0 comments on commit 346e911

Please sign in to comment.