Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Curlylint, add Black and fix ESLint #385

Merged
merged 8 commits into from
Oct 3, 2024
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
3 changes: 3 additions & 0 deletions .black.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tool.black]
line-length = 79
target-version = ["py38", "py39", "py39", "py310", "py311", "py312", "py313"]
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[flake8]
count = True
ignore = E123, W504
ignore = E123, E203, W504
max-doc-length = 79
max-complexity = 15
jobs = 1
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Blacken scripts

9e75d1834b30a486e6b8d0a011be43b587e8cd2d
33 changes: 16 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

# Baseline hooks and config updated 2023-11-01
# Web hooks and config updated 2023-11-01
# Docs hooks and config updated 2024-01-29
# Python hooks and config updated 2024-01-29
# Baseline hooks and config updated 2024-09-25
# Web hooks and config updated 2024-09-25
# Docs hooks and config updated 2024-09-25
# Python hooks and config updated 2024-09-25

minimum_pre_commit_version: '2.10.0'

Expand Down Expand Up @@ -102,7 +102,7 @@ repos:

# Lint and fix JavaScript
- repo: https://github.com/eslint/eslint
rev: v9.11.0
rev: v9.9.0 # Pin to fix dep conflict on install; see eslint/eslint#18956
hooks:
- id: eslint
name: Lint and fix JavaScript (ESLint)
Expand All @@ -111,7 +111,7 @@ repos:
- '[email protected]'
- '[email protected]'
- '[email protected]'
- '[email protected].5'
- '[email protected].6'

# Format JavaScript with Prettier
- repo: https://github.com/rbubley/mirrors-prettier
Expand All @@ -121,16 +121,6 @@ repos:
name: Format JavaScript (Prettier)
types: [javascript]

# Lint Jinja
- repo: https://github.com/thibaudcolas/curlylint
rev: v0.13.1
hooks:
- id: curlylint
name: Lint Jinja templates
types: [html, jinja, twig]
files: 'templates/'
require_serial: true

# Check JSON
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand All @@ -154,6 +144,15 @@ repos:
name: Lint Markdown
args: [--fix]

# Format Python
- repo: https://github.com/psf/black-pre-commit-mirror
rev: '24.8.0'
hooks:
- id: black
name: Format Python with Black
args: ['--config', '.black.toml']
exclude: '\bworkshops\b'

# Check Python
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand All @@ -170,7 +169,7 @@ repos:
exclude: '\bworkshops\b'

- repo: https://github.com/pycqa/pylint
rev: v3.3.0
rev: v3.3.1
hooks:
- id: pylint
name: Lint Python with Pylint
Expand Down
33 changes: 20 additions & 13 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

# pylint: disable-next = import-error
from docutils import nodes

# pylint: disable-next = import-error
from docutils.parsers.rst import Directive, directives

Expand Down Expand Up @@ -69,7 +70,8 @@
# General information about the project.
project = "Spyder"
copyright = ( # pylint: disable = redefined-builtin
f" 2009-{UTC_DATE.year} Spyder Doc Contributors; MIT License")
f" 2009-{UTC_DATE.year} Spyder Doc Contributors; MIT License"
)
author = "The Spyder Doc Contributors"

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -142,7 +144,8 @@
"show_version_warning_banner": True,
"switcher": {
"json_url": (
"https://docs.spyder-ide.org/current/_static/versions.json"),
"https://docs.spyder-ide.org/current/_static/versions.json"
),
"version_match": version,
},
}
Expand Down Expand Up @@ -304,12 +307,13 @@
r"https://(www\.)?software\.opensuse\.org/?.*",
r"https://(www\.)?packages\.ubuntu\.com/?.*",
r"https://(www\.)?github\.com/.+/commit/.+",
r"https://(www\.)?figshare\.com/?.*",
# Blocks GitHub Actions
r"https://(www\.)?(\w+\.)?reddit\.com/?.*",
r"https://(www\.)?(\w+\.)?(stackoverflow|stackexchange)\.com/?.*",
# Temporary until removed (flaky/no longer used)
r"https://(www\.)?openteams\.com/?.*",
]
]


# -- Additional Directives ---------------------------------------------------
Expand All @@ -327,6 +331,7 @@
# :copyright: (c) 2012 by Danilo Bargen.
# :license: BSD 3-clause


def align(argument):
"""Convert the "align" argument to one of the specified options."""
return directives.choice(argument, ("left", "center", "right"))
Expand Down Expand Up @@ -366,16 +371,18 @@ def run(self):
class Youtube(IFrameVideo):
"""A specific directive for injecting a Youtube video in a Sphinx doc."""

html = "".join([
'<div class="video-container-container">',
'<div class="video-container">',
'<iframe src="https://www.youtube.com/embed/%(video_id)s',
'?start=%(start)s" ',
'width="%(width)u" height="%(height)u" frameborder="0" ',
# pylint: disable = inconsistent-quotes
'webkitAllowFullScreen mozallowfullscreen allowfullscreen ',
'class="align-%(align)s"></iframe></div></div>',
])
html = "".join(
[
'<div class="video-container-container">',
'<div class="video-container">',
'<iframe src="https://www.youtube.com/embed/%(video_id)s',
'?start=%(start)s" ',
'width="%(width)u" height="%(height)u" frameborder="0" ',
# pylint: disable = inconsistent-quotes
"webkitAllowFullScreen mozallowfullscreen allowfullscreen ",
'class="align-%(align)s"></iframe></div></div>',
]
)


def setup(builder): # pylint: disable = unused-argument
Expand Down
Loading