Skip to content

Commit

Permalink
Ruff lint (#496)
Browse files Browse the repository at this point in the history
* add ruff, pdm

* update .gitignore

* format

* test

* check failure

* fix constants.py
  • Loading branch information
sigma67 authored Dec 31, 2023
1 parent ec02876 commit 1fd93dc
Show file tree
Hide file tree
Showing 39 changed files with 1,866 additions and 1,234 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Code coverage

on:
push:
branches:
- '**'
pull_request:
branches:
- master
# pull_request:
# branches:
# - master

jobs:
build:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Ruff

on:
pull_request:
branches:
- master

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1
- uses: chartboost/ruff-action@v1
with:
args: format --check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ venv*/
*.egg-info/
build
dist
.pdm-python
21 changes: 11 additions & 10 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, '../..')

sys.path.insert(0, os.path.abspath("."))
sys.path.insert(0, "../..")
from ytmusicapi import __version__ # noqa: E402

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
on_rtd = os.environ.get("READTHEDOCS", None) == "True"

# -- Project information -----------------------------------------------------

project = 'ytmusicapi'
copyright = '2022, sigma67'
author = 'sigma67'
project = "ytmusicapi"
copyright = "2022, sigma67"
author = "sigma67"

# The full version, including alpha/beta/rc tags
version = __version__
Expand All @@ -37,17 +38,17 @@
extensions = ["sphinx.ext.autodoc"]

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

html_theme = "sphinx_rtd_theme"
html_theme = "sphinx_rtd_theme"
560 changes: 560 additions & 0 deletions pdm.lock

Large diffs are not rendered by default.

24 changes: 15 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ dependencies = [
]
dynamic = ["version", "readme"]

[project.optional-dependencies]
dev = ['pre-commit', 'flake8', 'yapf', 'coverage', 'sphinx', 'sphinx-rtd-theme']

[project.scripts]
ytmusicapi = "ytmusicapi.setup:main"

Expand All @@ -28,8 +25,6 @@ repository = "https://github.com/sigma67/ytmusicapi"
requires = ["setuptools>=65", "setuptools_scm[toml]>=7"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[tool.setuptools.dynamic]
readme = {file = ["README.rst"]}

Expand All @@ -39,9 +34,20 @@ include-package-data=false
[tool.setuptools.package-data]
"*" = ["**.rst", "**.py", "**.mo"]

[tool.yapf]
column_limit = 99
split_before_arithmetic_operator = true

[tool.coverage.run]
command_line = "-m unittest discover tests"

[tool.ruff]
line-length = 110
ignore = [ "F403", "F405", "F821", "E731" ]
extend-select = [
"I", # isort
]

[tool.pdm.dev-dependencies]
dev = [
"coverage>=7.4.0",
'sphinx<7',
'sphinx-rtd-theme',
"ruff>=0.1.9",
]
Loading

0 comments on commit 1fd93dc

Please sign in to comment.