From 038d6c52bfad73634e822d6419f67cc0e324ecfd Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Sat, 21 Sep 2024 19:46:52 -0500 Subject: [PATCH 1/3] Upgrde Pre-Commit hooks and config as of 2024-09-20 --- .eslintrc.json | 17 -------- .github/ISSUE_TEMPLATE.md | 3 +- .github/PULL_REQUEST_TEMPLATE.md | 3 +- .github/workflows/lint.yaml | 2 +- .pre-commit-config.yaml | 74 ++++++++++++++++---------------- .stylelintrc.json | 2 +- eslint.config.js | 20 +++++++++ 7 files changed, 63 insertions(+), 58 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.js diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index efa7ef140..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "env": { - "browser": true, - "es2021": true, - "jquery": true - }, - "extends": [ - "standard", - "prettier" - ], - "parserOptions": { - "ecmaVersion": 12 - }, - "rules": { - "no-var": "off" - } -} diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 075e77b95..9164690fe 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,8 +1,9 @@ +# Issue Report + -# Issue Report ## Issue Description diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f7af4298c..b7fb84c66 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,7 +1,8 @@ +# Pull Request + -# Pull Request ## Pull Request Checklist diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 2f02753d2..6d56ae035 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -29,4 +29,4 @@ jobs: with: python-version: '3.11' - name: Run pre-commit hooks - uses: pre-commit/action@v3.0.0 + uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 14431a425..55b701a95 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: # General fixers - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: trailing-whitespace name: Trim trailing whitespace @@ -41,7 +41,7 @@ repos: # More general fixers - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.1 + rev: v1.5.1 # Pinned for now to avoid requiring pre-commit >=3.2.0 hooks: - id: remove-tabs name: Replace tabs with spaces @@ -51,7 +51,7 @@ repos: # Check and fix spelling - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: # Define separate hooks for checking and correcting spelling errors # since codespell doesn't print verbose output when writing changes @@ -64,27 +64,28 @@ repos: args: [--write-changes] # Format CSS with Prettier -- repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.3 +- repo: https://github.com/rbubley/mirrors-prettier + rev: v3.3.3 hooks: - id: prettier name: Format CSS (Prettier) types: [css] # Lint and fix CSS with stylelint -- repo: https://github.com/awebdeveloper/pre-commit-stylelint - rev: '0.0.2' +- repo: https://github.com/thibaudcolas/pre-commit-stylelint + rev: v16.9.0 hooks: - id: stylelint name: Lint and fix CSS (stylelint) args: [--fix, --color, --maxWarnings, '0'] additional_dependencies: - - 'stylelint@15.11.0' - - 'stylelint-config-standard@34.0.0' - - 'stylelint-csstree-validator@3.0.0' - - 'stylelint-declaration-block-no-ignored-properties@2.7.0' - - 'stylelint-no-unsupported-browser-features@7.0.0' - - 'stylelint-order@6.0.3' + - 'stylelint@16.9.0' + - 'stylelint-config-standard@36.0.1' + - 'stylelint-declaration-block-no-ignored-properties@2.8.0' + - 'stylelint-no-unsupported-browser-features@8.0.1' + - 'stylelint-order@6.0.4' + # Use fork of csstree-validator that supports Stylelint 16 for now + - '@carlosjeurissen/stylelint-csstree-validator@3.1.0' # Pin to avoid no-unsupported-browser-features error breaking stylelint # Should be fixed soon; see # https://github.com/RJWadley/stylelint-no-unsupported-browser-features/issues/299 @@ -92,7 +93,7 @@ repos: # Pretty-format INI - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.11.0 + rev: v2.14.0 hooks: - id: pretty-format-ini name: Format INI @@ -100,8 +101,8 @@ repos: args: [--autofix] # Format JavaScript with Prettier -- repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.3 +- repo: https://github.com/rbubley/mirrors-prettier + rev: v3.3.3 hooks: - id: prettier name: Format JavaScript (Prettier) @@ -109,17 +110,16 @@ repos: # Lint and fix JavaScript - repo: https://github.com/eslint/eslint - rev: v8.52.0 + rev: v9.11.0 hooks: - id: eslint name: Lint and fix JavaScript (ESLint) - args: [--fix, --max-warnings, '0', --color --report-unused-disable-directives] + args: [--fix, --color, --max-warnings, '0'] additional_dependencies: - - 'eslint-config-standard@17.1.0' - - 'eslint-config-prettier@v9.0.0' - - 'eslint-plugin-import@2.29.0' - - 'eslint-plugin-n@16.2.0' - - 'eslint-plugin-promise@6.1.1' + - 'eslint-plugin-import@2.30.0' + - 'eslint-plugin-n@17.10.3' + - 'eslint-plugin-promise@7.1.0' + - 'neostandard@0.11.5' # Lint Jinja - repo: https://github.com/thibaudcolas/curlylint @@ -132,7 +132,7 @@ repos: # Check JSON - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-json name: Check JSON @@ -147,7 +147,7 @@ repos: # Lint Markdown - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.37.0 + rev: v0.41.0 hooks: - id: markdownlint name: Lint Markdown @@ -155,21 +155,21 @@ repos: # Check Python - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-ast name: Check Python AST # Lint Python - repo: https://github.com/pycqa/flake8 - rev: '7.0.0' + rev: '7.1.1' hooks: - id: flake8 name: Lint Python with Flake8 exclude: '\bworkshops\b' - repo: https://github.com/pycqa/pylint - rev: v3.0.3 + rev: v3.3.0 hooks: - id: pylint name: Lint Python with Pylint @@ -177,7 +177,7 @@ repos: # Check Python dependencies - repo: https://github.com/Lucas-C/pre-commit-hooks-safety - rev: v1.3.2 + rev: v1.3.3 hooks: - id: python-safety-dependencies-check name: Check Python dependencies (Safety) @@ -197,7 +197,7 @@ repos: # Lint RST - repo: https://github.com/sphinx-contrib/sphinx-lint - rev: v0.9.1 + rev: v1.0.0 hooks: - id: sphinx-lint name: Lint RST @@ -205,7 +205,7 @@ repos: # Check TOML and XML - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-toml name: Check TOML @@ -214,7 +214,7 @@ repos: # Pretty-format YAML - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.11.0 + rev: v2.14.0 hooks: - id: pretty-format-yaml name: Format YAML @@ -223,14 +223,14 @@ repos: # Check YAML - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-yaml name: Check YAML # Lint YAML - repo: https://github.com/adrienverge/yamllint.git - rev: v1.32.0 + rev: v1.35.1 hooks: - id: yamllint name: Lint YAML @@ -239,7 +239,7 @@ repos: # Replace CRLF with LF post-prettify - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.1 + rev: v1.5.1 # Pinned for now to avoid requiring pre-commit >=3.2.0 hooks: - id: remove-crlf name: Replace CRLFs with LF @@ -256,7 +256,7 @@ repos: name: Check for Unicode replacement chars - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-added-large-files name: Check for added large files @@ -284,7 +284,7 @@ repos: # Check commit message spelling - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell name: Check commit message spelling diff --git a/.stylelintrc.json b/.stylelintrc.json index b50fdcc6d..12f529583 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -4,7 +4,7 @@ "reportInvalidScopeDisables": true, "reportNeedlessDisables": true, "plugins": [ - "stylelint-csstree-validator", + "@carlosjeurissen/stylelint-csstree-validator", "stylelint-declaration-block-no-ignored-properties", "stylelint-no-unsupported-browser-features", "stylelint-order" diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 000000000..caedfa131 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,20 @@ +const neostandard = require("neostandard"); + +module.exports = [ + ...neostandard({noStyle: true}), + { + languageOptions: { + sourceType: "script", + globals: { + browser: true, + jquery: true, + }, + }, + linterOptions: { + reportUnusedDisableDirectives: "warn", + }, + rules: { + "no-var": "off", + }, + }, +]; From fe0454fe293154ee8f97a6c508a0d891193bbaf7 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Sun, 22 Sep 2024 00:17:15 -0500 Subject: [PATCH 2/3] Update hook configuration with new/changed settings since last upgrade --- .github/ISSUE_TEMPLATE.md | 2 +- .markdownlint.json | 44 ---------- .markdownlint.yaml | 146 +++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 44 +++++----- .prettierrc.yaml | 4 +- .yamllint.yml | 2 + CONTRIBUTING.md | 5 +- README.md | 6 +- SECURITY.md | 3 +- STYLEGUIDE.md | 4 +- doc/_static/js/custom_scripts.js | 45 +++++----- eslint.config.js | 5 +- 12 files changed, 209 insertions(+), 101 deletions(-) delete mode 100644 .markdownlint.json create mode 100644 .markdownlint.yaml diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 9164690fe..142bc476c 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -36,7 +36,7 @@ * [ ] Spyder 3 (``3.x``, frozen) -* Are you planning on submitting a Github pull request with a suitable change? +* Are you planning on submitting a GitHub pull request with a suitable change? * [ ] Yes * [ ] No diff --git a/.markdownlint.json b/.markdownlint.json deleted file mode 100644 index 7e9bd1651..000000000 --- a/.markdownlint.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "default": true, - "line-length": false, - "heading-style": { - "style": "atx" - }, - "ul-style": { - "style": "asterisk" - }, - "ul-indent": { - "indent": 4 - }, - "no-trailing-spaces": { - "br_spaces": 0, - "strict": true - }, - "no-hard-tabs": { - "spaces_per_tab": 4 - }, - "no-multiple-blanks": { - "maximum": 4 - }, - "no-duplicate-heading": { - "siblings_only": true - }, - "hr-style": { - "style": "---" - }, - "proper-names": { - "code_blocks": false - }, - "code-block-style": { - "style": "fenced" - }, - "code-fence-style": { - "style": "backtick" - }, - "emphasis-style": { - "style": "asterisk" - }, - "strong-style": { - "style": "asterisk" - } -} diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 000000000..d1dc2e0c1 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,146 @@ +# Configuration file for markdownlint + +# Default state for all rules +default: true + +# MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md003.md +heading-style: + # Heading style + style: 'atx' + +# MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md004.md +ul-style: + # List style + style: 'asterisk' + +# MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md007.md +ul-indent: + # Spaces for indent + indent: 4 + # Whether to indent the first level of the list + start_indented: false + # Spaces for first level indent (when start_indented is set) + start_indent: 4 + +# MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md009.md +no-trailing-spaces: + # Spaces for line break + br_spaces: 0 + # Allow spaces for empty lines in list items + list_item_empty_lines: false + # Include unnecessary breaks + strict: true + +# MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md010.md +no-hard-tabs: + # Include code blocks + code_blocks: true + # Fenced code languages to ignore + ignore_code_languages: [] + # Number of spaces for each hard tab + spaces_per_tab: 4 + +# MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md012.md +no-multiple-blanks: + # Consecutive blank lines + maximum: 4 + +# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md013.md +line-length: false + +# MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md022.md +blanks-around-headings: + # Blank lines above heading + lines_above: 2 + # Blank lines below heading + lines_below: 1 + +# MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md024.md +no-duplicate-heading: + # Only check sibling headings + siblings_only: true + +# MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md029.md +ol-prefix: + # List style + style: 'one' + +# MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md031.md +blanks-around-fences: + # Include list items + list_items: false + +# MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md035.md +hr-style: + # Horizontal rule style + style: '---' + +# MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md040.md +fenced-code-language: + # List of languages + allowed_languages: [] + # Require language only + language_only: true + +# MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md044.md +MD044: + # List of proper names + names: + - 'CAM Gerlach' + - 'GitHub' + - 'github.com' + - 'Python' + - 'python.org' + - 'reStructuredText' + - 'Sphinx' + - 'sphinx-doc.org' + - 'Spyder' + - 'Spyder-IDE' + - 'spyder-ide.org' + - 'Spyder-API-Docs' + - 'Spyder-Docs' + - 'Spyder-Website' + # Include code blocks + code_blocks: false + # Include HTML elements + html_elements: false + +# MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md046.md +code-block-style: + # Block style + style: 'fenced' + +# MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md048.md +code-fence-style: + # Code fence style + style: 'backtick' + +# MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md049.md +emphasis-style: + # Emphasis style + style: 'asterisk' + +# MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md050.md +strong-style: + # Strong style + style: 'asterisk' + +# MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md054.md +link-image-style: + # Allow autolinks + autolink: false + # Allow inline links and images + inline: true + # Allow full reference links and images + full: true + # Allow collapsed reference links and images + collapsed: false + # Allow shortcut reference links and images + shortcut: false + # Allow URLs as inline links + url_inline: false + +# MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md055.md +table-pipe-style: + # Table pipe style + style: 'leading_and_trailing' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 55b701a95..2e701b2bf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -63,14 +63,6 @@ repos: exclude: '\.gitattributes|\bworkshops\b' args: [--write-changes] -# Format CSS with Prettier -- repo: https://github.com/rbubley/mirrors-prettier - rev: v3.3.3 - hooks: - - id: prettier - name: Format CSS (Prettier) - types: [css] - # Lint and fix CSS with stylelint - repo: https://github.com/thibaudcolas/pre-commit-stylelint rev: v16.9.0 @@ -91,6 +83,14 @@ repos: # https://github.com/RJWadley/stylelint-no-unsupported-browser-features/issues/299 - 'caniuse-lite@1.0.30001653' +# Format CSS with Prettier +- repo: https://github.com/rbubley/mirrors-prettier + rev: v3.3.3 + hooks: + - id: prettier + name: Format CSS (Prettier) + types: [css] + # Pretty-format INI - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks rev: v2.14.0 @@ -100,14 +100,6 @@ repos: types: [ini] args: [--autofix] -# Format JavaScript with Prettier -- repo: https://github.com/rbubley/mirrors-prettier - rev: v3.3.3 - hooks: - - id: prettier - name: Format JavaScript (Prettier) - types: [javascript] - # Lint and fix JavaScript - repo: https://github.com/eslint/eslint rev: v9.11.0 @@ -121,14 +113,23 @@ repos: - 'eslint-plugin-promise@7.1.0' - 'neostandard@0.11.5' +# Format JavaScript with Prettier +- repo: https://github.com/rbubley/mirrors-prettier + rev: v3.3.3 + hooks: + - id: prettier + 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] + types: [html, jinja, twig] files: 'templates/' + require_serial: true # Check JSON - repo: https://github.com/pre-commit/pre-commit-hooks @@ -146,10 +147,10 @@ repos: args: [--maxlevel, '3', --update-only] # Lint Markdown -- repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.41.0 +- repo: https://github.com/DavidAnson/markdownlint-cli2 + rev: v0.14.0 hooks: - - id: markdownlint + - id: markdownlint-cli2 name: Lint Markdown args: [--fix] @@ -181,6 +182,7 @@ repos: hooks: - id: python-safety-dependencies-check name: Check Python dependencies (Safety) + args: [--disable-optional-telemetry] files: '.*requirements.*.txt' types: [text] @@ -235,7 +237,7 @@ repos: - id: yamllint name: Lint YAML types: [yaml] - args: [-s, -f, colored] + args: [--strict, --format, colored] # Replace CRLF with LF post-prettify - repo: https://github.com/Lucas-C/pre-commit-hooks diff --git a/.prettierrc.yaml b/.prettierrc.yaml index 3a613f332..e4af41ef5 100644 --- a/.prettierrc.yaml +++ b/.prettierrc.yaml @@ -5,12 +5,12 @@ tabWidth: 2 useTabs: false semi: true singleQuote: false -trailingComma: 'es5' +trailingComma: 'all' bracketSpacing: false arrowParens: 'always' proseWrap: 'preserve' endOfLine: 'lf' -singleAttributePerLine: false +singleAttributePerLine: true overrides: - files: '*.css' diff --git a/.yamllint.yml b/.yamllint.yml index 041dd7668..08f7da173 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -26,6 +26,8 @@ rules: spaces: 2 indent-sequences: consistent check-multi-line-strings: true + key-duplicates: + forbid-duplicated-merge-keys: true line-length: disable new-lines: disable octal-values: enable diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 13d2cb7bf..ae1325ca7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ First off, thanks for your interest in helping out with the documentation for Sp **Important Note:** This is the repository for the documentation sources used to build the [Spyder docs site](https://docs.Spyder-IDE.org/)—not the IDE itself. For more information about Spyder, please see the [website](https://www.spyder-ide.org/), and for the core Spyder codebase, visit the [main repo](https://github.com/spyder-ide/spyder). -You can view the live documentation for current and past Spyder versions at [docs.Spyder-IDE.org](https://docs.spyder-ide.org). +You can view the live documentation for current and past Spyder versions at [docs.spyder-ide.org](https://docs.spyder-ide.org). Spyder-Docs is part of the Spyder IDE GitHub org, and is developed with standard GitHub flow. If you're not comfortable with at least the basics of ``git`` and GitHub, we recommend reading beginner tutorials such as [GitHub's Git Guide](https://github.com/git-guides/), its [introduction to basic Git commands](https://docs.github.com/en/get-started/using-git/about-git#basic-git) and its [guide to the fork workflow](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project). @@ -313,7 +313,7 @@ Where ```` is the name of your feature branch, e.g. ``fix-docs-t ## Submitting a Pull Request -Finally, create a pull request to the [spyder-ide/spyder-docs repository](https://github.com/spyder-ide/spyder-docs/) on GitHub. +Finally, create a pull request to the [``spyder-ide/spyder-docs`` repository](https://github.com/spyder-ide/spyder-docs/) on GitHub. Make sure to set the target branch to the one you based your PR off of (``master`` or ``X.x``). We'll then review your changes, and after they're ready to go, your work will become an official part of Spyder-Docs. @@ -324,6 +324,7 @@ Thanks for taking the time to read and follow this guide, and we look forward to ## Standards and Conventions + ### Key standards Make sure you follow these to ensure clarity, consistency and correctness throughout our documentation and its repo. diff --git a/README.md b/README.md index ce3a9b066..deb88b15f 100644 --- a/README.md +++ b/README.md @@ -34,14 +34,14 @@ ## Overview This repository contains the documentation for Spyder, the Scientific Python Development Environment. -You can view the live docs for current and past Spyder versions at [docs.Spyder-IDE.org](https://docs.spyder-ide.org). +You can view the live docs for current and past Spyder versions at [docs.spyder-ide.org](https://docs.spyder-ide.org). For more information about Spyder itself, please see our [website](https://www.spyder-ide.org/) and the [main repo](https://github.com/spyder-ide/spyder). ## Building and Deploying -The docs are built with [Sphinx](https://www.sphinx-doc.org/) and deployed with GitHub Actions to the [docs.Spyder-IDE.org](https://docs.spyder-ide.org/) domain. +The docs are built with [Sphinx](https://www.sphinx-doc.org/) and deployed with GitHub Actions to the [docs.spyder-ide.org](https://docs.spyder-ide.org/) domain. [Nox](https://nox.thea.codes/) is used to automate setup, building and numerous other project tasks. The ``master`` branch contains the in-development docs for Spyder 5, while the frozen ``4.x`` and ``3.x`` branches retain the docs for Spyder 4 and Spyder 3. @@ -61,7 +61,7 @@ Thanks for your interest in Spyder and its documentation, and we appreciate your [Online Documentation](https://docs.spyder-ide.org/) -[Spyder Github](https://github.com/spyder-ide/spyder) +[Spyder GitHub](https://github.com/spyder-ide/spyder) [Development Wiki](https://github.com/spyder-ide/spyder/wiki/Dev:-Index) diff --git a/SECURITY.md b/SECURITY.md index 2084032af..b25aa3d2e 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,8 +1,9 @@ # Security Policy + ## Reporting a Vulnerability -If you believe you've discovered a security vulnerability in this website or its dependencies, please contact the docs maintainer at or the Spyder team at . +If you believe you've discovered a security vulnerability in this website or its dependencies, please contact the docs maintainer at or the Spyder team at . Please be sure to carefully document the vulnerability, including a summary, describing the impacts, identifying the line(s) of code affected, stating the conditions under which it is exploitable and including a minimal reproducible test case. Further information and advice or patches on how to mitigate it is always welcome. You can usually expect to hear back within one week, at which point we'll inform you of our evaluation of the vulnerability and what steps we plan to take, and will reach out if we need further clarification from you. diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md index bfa6e485a..62c69efb6 100644 --- a/STYLEGUIDE.md +++ b/STYLEGUIDE.md @@ -49,7 +49,7 @@ Must (not), should (not), recommended, suggested, may, and can generally follow ## Technical -* Markdown, Github-flavored (``.md``) for any non-documentation rendered text files in the root of the repo, e.g. ``README``, ``CONTRIBUTING``, etc. +* Markdown, GitHub-flavored (``.md``) for any non-documentation rendered text files in the root of the repo, e.g. ``README``, ``CONTRIBUTING``, etc. * reStructuredText, (reST, ``.rst``) for documentation format, i.e. any user-visible files in the ``/doc`` directory * Where not otherwise contradicted by this guide or specific individual requirements, a subset of Markdown corresponding to that cross-compatible with reST should be preferred where possible; e.g. ``*italic*`` vs. ``_italic_``, ``*`` for bulleted lists, double backtick for inline code vs. single, etc. * Documentation should build with no warnings with ``Sphinx`` in nitpicky mode @@ -78,7 +78,7 @@ Must (not), should (not), recommended, suggested, may, and can generally follow * GUI elements (names of things in the UI): Use ``:guilabel:`` , e.g. ``:guilabel:`Name` ``; make sure to use the exact name and capitalization as printed in the UI, except for the proper names of Spyder panes (i.e. those listed in the ``View > Panes`` menu), which should always be written in Title Case ("Variable Explorer", "Code Analysis", "IPython Console", etc. as they are proper names). Also, for consistency and clarity, they should be referred to as panes, rather than modules, plugins, panels, etc. * Menu items and preference panes: Use :menuselection: to format and ``-->`` to separate, e.g. `` :menuselection:`Project --> New Project` ``. Make sure to use the exact name and capitalization of each level element * Short commands/lines of code (under 20-30 characters), use `` , e.g. ``code`` -* For any code longer than one line, ~20-30 characters, or that is otherwise important to emphasize rather than just mention, use ``code-block::`` tags, closed with ``end``, and specify the programming language (bash for command line, python for python, ini for configuration files, etc.). PEP 8 should be followed for Python code, with all "recommended"/"preferred"/"suggested" guidelines being treated as *should* i.e. only broken with appropriate justification in a situation requiring them; similarly, PEP 257 for docstrings where needed. Additionally, all code must be valid and idiomatic Python 3 unless specifically meant to illustrate a distinction with Python 2, and code should for the time being fall under the common subset supported by Spyder's supported platforms (currently, Python 3.6-3.8). Wrap code blocks at a width of 70 characters from the page margin for readability. +* For any code longer than one line, ≈20-30 characters, or that is otherwise important to emphasize rather than just mention, use ``code-block::`` tags, closed with ``end``, and specify the programming language (``shell`` for command line, ``python`` for Python scripts, ``toml`` for TOML configuration, etc.). [PEP 8](https://peps.python.org/pep-0008) should be followed for Python code, with all "recommended"/"preferred"/"suggested" guidelines being treated as *should* i.e. only broken with appropriate justification in a situation requiring them. Similarly, follow [PEP 257](https://peps.python.org/pep-0257) for docstrings where needed. Additionally, all code must be valid and idiomatic Python 3, and code should work on all upstream-supported Python versions. Wrap code blocks at a width of 70 characters from the page margin for readability. * Internal links to sections should never rely on implicit references, since they may change with section titles or other re-organization. Instead, always use explicit references above the target with one blank line between; keep ref names short, use ``-`` to replace spaces, use unique and distinctive names and append ``-ref`` to the end of the name for clarity. * All external links should be inline (not bare) unless specifically needed to illustrate some property of the link itself, should be HTTPS if available, and should, generally, be written as a reference with `` `Test Link Name`_`` and then included in full after the end of the paragraph in which it appears, e.g. `` .._Test Link Name: https://www.example.com/ `` . A block of links should be separated from paragraphs above and below by one blank line, with no blank lines between links. Make sure to check your links, as the build will automatically check for broken ones. Strip anything unnecessary (parameters, referrers, etc) off the end. As the base docs are in US English, any links should be to the English, desktop version of the site. * Use enumerated lists with ``#.`` to list items with a clearly defined order, otherwise, use bulleted lists with ``*``. Include a space between the bullet/number and the text. No blank line between elements, unless a sublist is present, but blank lines around the list. Sublist should have no spaces around elements. You should try to avoid more than two levels of lists if at all possible, and keep lists to between 3 and 10-20 elements; anything shorter should be written in prose, and anything longer should be simplified or broken into multiple lists/sublists. diff --git a/doc/_static/js/custom_scripts.js b/doc/_static/js/custom_scripts.js index 3c76b1d88..6d7d343f6 100644 --- a/doc/_static/js/custom_scripts.js +++ b/doc/_static/js/custom_scripts.js @@ -9,7 +9,7 @@ const dropdownClassName = "dropdown"; // Interactive tour driver options - var quickstartDriverOptions = { + const quickstartDriverOptions = { animate: false, opacity: 0.1, padding: 0, @@ -19,7 +19,7 @@ }; // Step definitions for the quickstart tour - var quickstartTourSteps = [ + const quickstartTourSteps = [ { element: "#introduction-rect", popover: { @@ -152,21 +152,22 @@ // Set the active image for the tour based on the element's class function setActiveTourImage(activeElement) { - var activeClass = "tour-screenshot-active"; - var classNames = activeElement.node.className.baseVal.split(" "); - for (var i = 0; i < classNames.length; i++) { - var imageToActivate = document.getElementById(classNames[i]); + const activeClass = "tour-screenshot-active"; + const classNames = activeElement.node.className.baseVal.split(" "); + let imageToActivate = null; + for (let i = 0; i < classNames.length; i++) { + imageToActivate = document.getElementById(classNames[i]); if (imageToActivate) break; } - var imageToDeactivate = document.getElementsByClassName(activeClass)[0]; + const imageToDeactivate = document.getElementsByClassName(activeClass)[0]; imageToDeactivate.classList.remove(activeClass); imageToActivate.classList.add(activeClass); } // Add a span for the progress indicator to each tour step title function addProgressSpan(tourSteps) { - for (var i = 0; i < tourSteps.length; i++) { - var spanToAdd = + for (let i = 0; i < tourSteps.length; i++) { + const spanToAdd = '' + (i + 1).toString() + "/" + @@ -178,12 +179,12 @@ // Get the currently selected anchor element if its a dropdown function getDropdownElement() { - var dropdownID = window.location.hash; + const dropdownID = window.location.hash; if (!dropdownID) { return false; } - var dropdownElement = document.getElementById(dropdownID.substring(1)); + const dropdownElement = document.getElementById(dropdownID.substring(1)); if ( !dropdownElement || !dropdownElement.classList.contains(dropdownClassName) @@ -204,7 +205,7 @@ /* Main functions */ - var driver = null; + let driver = null; // Event handler to start tour function startTour() { @@ -235,13 +236,13 @@ // Set up ids and direct links to dropdowns in FAQ function setupDropdownLinks() { - var dropdowns = document.getElementsByClassName(dropdownClassName); - for (var i = 0; i < dropdowns.length; i++) { - for (var j = 0; j < dropdowns[i].classList.length; j++) { + const dropdowns = document.getElementsByClassName(dropdownClassName); + for (let i = 0; i < dropdowns.length; i++) { + for (let j = 0; j < dropdowns[i].classList.length; j++) { if (dropdowns[i].classList[j].startsWith("dropdown-id-")) { dropdowns[i].id = dropdowns[i].classList[j].replace( "dropdown-id-", - "" + "", ); } } @@ -249,24 +250,24 @@ dropdowns[i].id = "dropdown-" + (i + 1); } - var aTag = document.createElement("a"); + const aTag = document.createElement("a"); aTag.setAttribute("href", "#" + dropdowns[i].id); aTag.classList.add("fas"); aTag.classList.add("fa-link"); aTag.classList.add("dropdown-link"); - var summaryElement = + const summaryElement = dropdowns[i].getElementsByClassName("summary-title")[0]; summaryElement.insertBefore( aTag, - summaryElement.getElementsByClassName("docutils")[0] + summaryElement.getElementsByClassName("docutils")[0], ); } } // Open the specified dropdown, wait for images to load then scroll to it function scrollToDropdown() { - var dropdownElement = getDropdownElement(); + const dropdownElement = getDropdownElement(); if (dropdownElement) { if (dropdownElement.open) { scrollToElement(dropdownElement); @@ -279,8 +280,8 @@ // Open all dropdowns that have highlighted words function openHighlightedDropdowns() { - var dropdowns = document.getElementsByClassName(dropdownClassName); - for (var idx = 0; idx < dropdowns.length; idx++) { + const dropdowns = document.getElementsByClassName(dropdownClassName); + for (let idx = 0; idx < dropdowns.length; idx++) { if (dropdowns[idx].getElementsByClassName("highlighted").length) { dropdowns[idx].open = true; } diff --git a/eslint.config.js b/eslint.config.js index caedfa131..801cd316f 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,3 +1,5 @@ +// Configuration file for eslint + const neostandard = require("neostandard"); module.exports = [ @@ -13,8 +15,5 @@ module.exports = [ linterOptions: { reportUnusedDisableDirectives: "warn", }, - rules: { - "no-var": "off", - }, }, ]; From f136847b5a5601d1d1e25395001f04fd86f6964a Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Sun, 22 Sep 2024 00:21:57 -0500 Subject: [PATCH 3/3] Remove lib/ directory in .gitignore that shouldn't be ignored --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 26e37b2ba..2e78482cb 100644 --- a/.gitignore +++ b/.gitignore @@ -40,7 +40,6 @@ develop-eggs/ dist/ downloads/ eggs/ -lib/ lib64/ MANIFEST parts/