Skip to content

Ignore rendered examples for linting #188

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

Merged
merged 2 commits into from
Apr 21, 2023
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
7 changes: 4 additions & 3 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you add into your final commit message that you add viewcode? or is this related to the linting

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No sorry, I have to add this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not related to the linting, right? So I wondered if you can just mention this in your commit message when you squash, that you add viewcode?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay sorry it is already two commits. Okay forget what I said. Everything fine.

"sphinx_gallery.gen_gallery",
"sphinx.ext.intersphinx",
"sphinx_toggleprompt",
]

Expand All @@ -61,12 +62,12 @@
# Configuration for intersphinx: refer to the Python standard library
# and other packages
intersphinx_mapping = {
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"pandas": ("https://pandas.pydata.org/docs/", None),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this allow a correct linking of external libraries in the in-code doc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it should be done already. I just did the sorting of the librariers in alphabetical order to be consistent.

"python": ("https://docs.python.org/3/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"sklearn": ("https://scikit-learn.org/stable", None),
"pandas": ("https://pandas.pydata.org/docs/", None),
}


Expand Down
12 changes: 10 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ envlist =
lint
tests

lint_folders = "{toxinidir}/src" "{toxinidir}/tests" "{toxinidir}/docs/src/" "{toxinidir}/examples"
lint_folders =
"{toxinidir}/src" \
"{toxinidir}/tests" \
"{toxinidir}/docs/src/" \
"{toxinidir}/examples"


[testenv:tests]
Expand Down Expand Up @@ -43,7 +47,9 @@ commands =
black --check --diff {[tox]lint_folders}
blackdoc --check --diff {[tox]lint_folders}
isort --check-only --diff {[tox]lint_folders}
sphinx-lint --enable line-too-long --max-line-length 88 {[tox]lint_folders} "{toxinidir}/README.rst"
sphinx-lint --enable line-too-long --max-line-length 88 \
-i "{toxinidir}/docs/src/examples" \
{[tox]lint_folders} "{toxinidir}/README.rst"

[testenv:format]
# Abuse tox to do actual formatting. Users can call `tox -e format` to run
Expand All @@ -68,6 +74,8 @@ commands = sphinx-build {posargs:-E} -W -b html docs/src docs/build/html

[flake8]
max_line_length = 88
exclude =
docs/src/examples/
per-file-ignores =
# D205 and D400 are incompatible with the requirements of sphinx-gallery
examples/**:D205, D400