Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
15 changes: 15 additions & 0 deletions .github/workflows/ruff-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Ruff-Format
on: [workflow_dispatch, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.*"
- uses: astral-sh/ruff-action@v3
with:
args: "format --check"
continue-on-error: false
15 changes: 15 additions & 0 deletions .github/workflows/ruff-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Ruff-Lint
on: [workflow_dispatch, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.*"
- uses: astral-sh/ruff-action@v3
with:
args: "check --fix"
continue-on-error: false
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# Python
###############################################

.ruff_cache/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
2 changes: 1 addition & 1 deletion omdb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" the omdb module """
"""the omdb module"""

from omdb.exceptions import OMDBException, OMDBLimitReached, OMDBNoResults, OMDBTooManyResults
from omdb.omdb import OMDB
Expand Down
3 changes: 1 addition & 2 deletions omdb/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
""" Exceptions for the pyomdbapi project """

"""Exceptions for the pyomdbapi project"""

from typing import Dict

Expand Down
15 changes: 2 additions & 13 deletions omdb/omdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,8 @@

import requests

from omdb.exceptions import (
OMDBException,
OMDBInvalidAPIKey,
OMDBLimitReached,
OMDBNoResults,
OMDBTooManyResults,
)
from omdb.utilities import (
camelcase_to_snake_case,
clean_up_strings,
range_inclusive,
to_int,
)
from omdb.exceptions import OMDBException, OMDBInvalidAPIKey, OMDBLimitReached, OMDBNoResults, OMDBTooManyResults
from omdb.utilities import camelcase_to_snake_case, clean_up_strings, range_inclusive, to_int


class OMDB:
Expand Down
2 changes: 1 addition & 1 deletion omdb/utilities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""A utilitites suite"""
"""A utilities suite"""


def camelcase_to_snake_case(_input: str) -> str:
Expand Down
95 changes: 95 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,101 @@ line-length = 120
target-version = ['py36']
include = '\.pyi?$'

############################################
# Ruff
###########################################
[tool.ruff]
include = ["pyproject.toml", "omdb/**/*.py", "omdb/*.py"]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]

# Same as Black.
line-length = 120
indent-width = 4

# Assume Python 3.8
target-version = "py38"

[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
]
ignore = []

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

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
docstring-code-format = false

# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"

[build-system]
requires = ["setuptools>=61.2.0", "wheel"]
build-backend = "setuptools.build_meta"
Loading