From 283ceca717a2a9cb6574c0e849da695298b9d9e7 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Thu, 2 Nov 2023 23:36:02 -0500 Subject: [PATCH 01/13] Remove mostly-obselete and unmaintained CSSlint linter --- .csslintrc | 46 ----------------------------------------- .pre-commit-config.yaml | 7 ------- 2 files changed, 53 deletions(-) delete mode 100644 .csslintrc diff --git a/.csslintrc b/.csslintrc deleted file mode 100644 index bd86c5a99..000000000 --- a/.csslintrc +++ /dev/null @@ -1,46 +0,0 @@ -{ - "ignore": [ - "adjoining-classes", - "box-model", - "box-sizing", - "bulletproof-font-face", - "compatible-vendor-prefixes", - "fallback-colors", - "floats", - "font-sizes", - "ids", - "import-ie-limit", - "important", - "known-properties", - "outline-none", - "overqualified-elements", - "qualified-headings", - "regex-selectors", - "shorthand", - "unique-headings", - "universal-selector", - "unqualified-attributes" - ], - "warnings": [ - ], - "errors": [ - "display-property-grouping", - "duplicate-background-images", - "duplicate-properties", - "empty-rules", - "errors", - "font-faces", - "gradients", - "import", - "order-alphabetical", - "rules-count", - "selector-max-approaching", - "selector-max", - "selector-newline", - "star-property-hack", - "text-indent", - "underscore-property-hack", - "vendor-prefix", - "zero-units" - ] -} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 29bd56622..e135d06c3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -73,13 +73,6 @@ repos: - 'stylelint-no-unsupported-browser-features@5.0.3' - 'stylelint-order@5.0.0' -# Lint CSS with CSSlint -- repo: https://github.com/pre-commit/mirrors-csslint - rev: v1.0.5 - hooks: - - id: csslint - name: Check CSS (CSSlint) - # Pretty-format INI - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks rev: v2.4.0 From b253bba34841ba878318a7b76499c444f29b1bbe Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Thu, 2 Nov 2023 23:56:05 -0500 Subject: [PATCH 02/13] Sync pre-commit hooks and config from website as of 2023-11-01 --- .browserslistrc | 13 ++++-- .codespellrc | 3 +- .pre-commit-config.yaml | 72 ++++++++++++++++++------------- .stylelintrc.json | 10 ++++- .yamllint.yml | 5 +++ doc/_static/css/custom_styles.css | 3 +- pyproject.toml | 30 +++++++++++++ 7 files changed, 99 insertions(+), 37 deletions(-) create mode 100644 pyproject.toml diff --git a/.browserslistrc b/.browserslistrc index af7048865..1b3243a1d 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -1,6 +1,13 @@ # Browsers that we support +>0.25% +last 3 versions defaults -not IE 11 -not last 0 OperaMini version -not last 0 OperaMobile version +not Android < 5 +not Edge < 19 +not KaiOS < 3 +not OperaMini all +not OperaMobile < 13 +not QQAndroid >= 0 +not UCAndroid >= 0 +not dead diff --git a/.codespellrc b/.codespellrc index 290c5442f..d95756bc8 100644 --- a/.codespellrc +++ b/.codespellrc @@ -3,5 +3,6 @@ builtin = clear,rare,informal,code,names check-filenames = check-hidden = enable-colors = -ignore-words-list = sur +ignore-words-list = jupyter,lite,sur +quiet-level = 32 skip = .codespellrc,.gitattributes diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e135d06c3..79aedbc63 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,9 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks -minimum_pre_commit_version: '2.8.2' +# Hooks and config updated 2023-11-01 + +minimum_pre_commit_version: '2.10.0' default_language_version: python: python3 @@ -19,7 +21,7 @@ repos: # General fixers - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.5.0 hooks: - id: trailing-whitespace name: Trim trailing whitespace @@ -36,7 +38,7 @@ repos: # More general fixers - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.3.0 + rev: v1.5.1 hooks: - id: remove-tabs name: Replace tabs with spaces @@ -46,7 +48,7 @@ repos: # Check and fix spelling - repo: https://github.com/codespell-project/codespell - rev: v2.1.0 + rev: v2.2.6 hooks: # Define separate hooks for checking and correcting spelling errors # since codespell doesn't print verbose output when writing changes @@ -66,16 +68,16 @@ repos: name: Lint and fix CSS (stylelint) args: [--fix, --color, --maxWarnings, '0'] additional_dependencies: - - 'stylelint@14.9.1' - - 'stylelint-config-standard@26.0.0' - - 'stylelint-csstree-validator@2.0.0' - - 'stylelint-declaration-block-no-ignored-properties@2.5.0' - - 'stylelint-no-unsupported-browser-features@5.0.3' - - 'stylelint-order@5.0.0' + - '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' # Pretty-format INI - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.4.0 + rev: v2.11.0 hooks: - id: pretty-format-ini name: Format INI @@ -84,20 +86,29 @@ repos: # Lint and fix JavaScript - repo: https://github.com/eslint/eslint - rev: v8.20.0 + rev: v8.52.0 hooks: - id: eslint name: Lint and fix JavaScript (ESLint) args: [--fix, --max-warnings, '0', --color --report-unused-disable-directives] additional_dependencies: - - 'eslint-config-standard@17.0.0' - - 'eslint-plugin-import@2.25.4' - - 'eslint-plugin-n@15.2.4' - - 'eslint-plugin-promise@6.0.0' + - 'eslint-config-standard@17.1.0' + - 'eslint-plugin-import@2.29.0' + - 'eslint-plugin-n@16.2.0' + - 'eslint-plugin-promise@6.1.1' + +# Lint Jinja +- repo: https://github.com/thibaudcolas/curlylint + rev: v0.13.1 + hooks: + - id: curlylint + name: Lint Jinja templates + types: [html] + files: 'templates/' # Check JSON - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.5.0 hooks: - id: check-json name: Check JSON @@ -112,7 +123,7 @@ repos: # Lint Markdown - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.32.1 + rev: v0.37.0 hooks: - id: markdownlint name: Lint Markdown @@ -142,11 +153,12 @@ repos: # Check Python dependencies - repo: https://github.com/Lucas-C/pre-commit-hooks-safety - rev: v1.3.0 + rev: v1.3.2 hooks: - id: python-safety-dependencies-check - name: Run Safety check on dependencies - files: 'requirements*.txt' + name: Check Python dependencies (Safety) + files: '.*requirements.*.txt' + types: [text] # Check RST - repo: https://github.com/pre-commit/pygrep-hooks @@ -169,7 +181,7 @@ repos: # Check TOML and XML - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.5.0 hooks: - id: check-toml name: Check TOML @@ -178,7 +190,7 @@ repos: # Pretty-format YAML - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.4.0 + rev: v2.11.0 hooks: - id: pretty-format-yaml name: Format YAML @@ -187,14 +199,14 @@ repos: # Check YAML - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.5.0 hooks: - id: check-yaml name: Check YAML # Lint YAML - repo: https://github.com/adrienverge/yamllint.git - rev: v1.27.1 + rev: v1.32.0 hooks: - id: yamllint name: Lint YAML @@ -203,7 +215,7 @@ repos: # Replace CRLF with LF post-prettify - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.3.0 + rev: v1.5.1 hooks: - id: remove-crlf name: Replace CRLFs with LF @@ -214,13 +226,13 @@ repos: # General checkers - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 + rev: v1.10.0 hooks: - id: text-unicode-replacement-char name: Check for Unicode replacement chars - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.5.0 hooks: - id: check-added-large-files name: Check for added large files @@ -241,14 +253,14 @@ repos: # Check that commit message follows basic rules - repo: https://github.com/jorisroovers/gitlint - rev: v0.17.0 + rev: v0.19.1 hooks: - id: gitlint name: Check commit message # Check commit message spelling - repo: https://github.com/codespell-project/codespell - rev: v2.1.0 + rev: v2.2.6 hooks: - id: codespell name: Check commit message spelling diff --git a/.stylelintrc.json b/.stylelintrc.json index f3138a864..e6dc69447 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -16,14 +16,18 @@ "block-closing-brace-newline-before": "always", "color-named": "never", "declaration-block-semicolon-newline-before": "never-multi-line", + "declaration-property-value-no-unknown": true, "font-weight-notation": "named-where-possible", "function-comma-newline-before": "never-multi-line", "function-url-no-scheme-relative": true, "linebreaks": "unix", "max-empty-lines": 2, + "media-feature-name-value-no-unknown": true, + "media-feature-range-notation": "prefix", "media-query-list-comma-newline-before": "never-multi-line", "no-descending-specificity": null, "no-unknown-animations": true, + "no-unknown-custom-properties": true, "number-max-precision": 5, "property-no-unknown": [true, {"checkPrefixed": true}], "rule-empty-line-before": "always", @@ -35,6 +39,10 @@ "csstree/validator": true, "order/properties-alphabetical-order": true, "plugin/declaration-block-no-ignored-properties": true, - "plugin/no-unsupported-browser-features": true + "plugin/no-unsupported-browser-features": [true, { + "ignore": [ + "css-overflow" + ] + }] } } diff --git a/.yamllint.yml b/.yamllint.yml index ec6136301..041dd7668 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -5,6 +5,10 @@ extends: default locale: en_US.UTF-8 rules: + anchors: + forbid-undeclared-aliases: true + forbid-duplicated-anchors: true + forbid-unused-anchors: true braces: min-spaces-inside-empty: 0 max-spaces-inside-empty: 0 @@ -28,3 +32,4 @@ rules: quoted-strings: quote-type: single required: false + allow-quoted-quotes: true diff --git a/doc/_static/css/custom_styles.css b/doc/_static/css/custom_styles.css index 63f95e7e6..fce5ef039 100644 --- a/doc/_static/css/custom_styles.css +++ b/doc/_static/css/custom_styles.css @@ -268,8 +268,7 @@ div.scroll { font-size: 0.8em; height: 250px; margin: 1px; - overflow-x: hidden; - overflow-y: auto; + overflow: hidden auto; padding-left: 1.2rem; padding-right: 1.2rem; } diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..aff855379 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,30 @@ +[tool] + [tool.curlylint] + # include = '\.(html|jinja)$' + # exclude = ''' + + [tool.curlylint.rules] + # All role attributes must be valid. + # See https://www.curlylint.org/docs/rules/aria_role. + aria_role = true + # Forms cannot be rendered with as_table, as_ul, or as_p + # See https://www.curlylint.org/docs/rules/django_forms_rendering. + django_forms_rendering = true + # The `lang` attribute must be "en-US". + # See https://www.curlylint.org/docs/rules/html_has_lang. + html_has_lang = true + # The `alt` attribute must be present. + # See https://www.curlylint.org/docs/rules/image_alt. + image_alt = true + # Use 2 spaces for indent. + # See https://www.curlylint.org/docs/rules/indent. + # indent = 2 + # `user-scalable=no` must not be used, and `maximum-scale` should be 2 or above. + # See https://www.curlylint.org/docs/rules/meta_viewport. + meta_viewport = true + # The `autofocus` attribute must not be used. + # See https://www.curlylint.org/docs/rules/no_autofocus. + no_autofocus = true + # Avoid positive `tabindex` values, change the order of elements on the page instead. + # See https://www.curlylint.org/docs/rules/tabindex_no_positive. + tabindex_no_positive = true From 6156c4888a967cf14314f57aba329140bc0b57a4 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Thu, 26 Oct 2023 21:23:42 -0500 Subject: [PATCH 03/13] Remove deprecated Stylelint style rules --- .stylelintrc.json | 14 -------------- doc/_static/css/custom_styles.css | 2 -- 2 files changed, 16 deletions(-) diff --git a/.stylelintrc.json b/.stylelintrc.json index e6dc69447..b50fdcc6d 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -10,32 +10,18 @@ "stylelint-order" ], "rules": { - "at-rule-semicolon-space-before": "never", - "block-closing-brace-space-after": "always-single-line", - "block-opening-brace-newline-after": "always", - "block-closing-brace-newline-before": "always", "color-named": "never", - "declaration-block-semicolon-newline-before": "never-multi-line", "declaration-property-value-no-unknown": true, "font-weight-notation": "named-where-possible", - "function-comma-newline-before": "never-multi-line", "function-url-no-scheme-relative": true, - "linebreaks": "unix", - "max-empty-lines": 2, "media-feature-name-value-no-unknown": true, "media-feature-range-notation": "prefix", - "media-query-list-comma-newline-before": "never-multi-line", "no-descending-specificity": null, "no-unknown-animations": true, "no-unknown-custom-properties": true, "number-max-precision": 5, "property-no-unknown": [true, {"checkPrefixed": true}], - "rule-empty-line-before": "always", - "selector-list-comma-newline-before": "never-multi-line", - "selector-list-comma-space-after": "always-single-line", "time-min-milliseconds": 100, - "unicode-bom": "never", - "value-list-comma-newline-before": "never-multi-line", "csstree/validator": true, "order/properties-alphabetical-order": true, "plugin/declaration-block-no-ignored-properties": true, diff --git a/doc/_static/css/custom_styles.css b/doc/_static/css/custom_styles.css index fce5ef039..de8833ae3 100644 --- a/doc/_static/css/custom_styles.css +++ b/doc/_static/css/custom_styles.css @@ -160,7 +160,6 @@ div.openteams-icon::before { } @media (max-width: 767px) { - .tour-overlay .highlight-rect { stroke-width: 10; } @@ -327,7 +326,6 @@ table.installer-table tbody td:nth-child(2) p::before { } @media screen and (max-width: 991px) { - table.installer-table td { display: block; } From dbcc854e86767740abc7e20f5d6c1947f37f0f11 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Thu, 26 Oct 2023 22:35:16 -0500 Subject: [PATCH 04/13] Add Prettier to pre-commit hooks to replace stylelint for CSS --- .pre-commit-config.yaml | 8 ++++++++ .prettierrc.yaml | 13 +++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 .prettierrc.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 79aedbc63..c87573c55 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,6 +60,14 @@ repos: exclude: '\.gitattributes|\bworkshops\b' args: [--write-changes] +# Format CSS with Prettier +- repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.0.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' diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 000000000..dadfe605e --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,13 @@ +# Configuration file for Prettier + +tabWidth: 2 +useTabs: false +proseWrap: 'preserve' +endOfLine: 'lf' +singleAttributePerLine: false + +overrides: +- files: '*.css' + options: + printWidth: 120 + singleQuote: false From 3119f902ff1e602abdfb7b061e8056308ca44204 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Thu, 26 Oct 2023 23:22:34 -0500 Subject: [PATCH 05/13] Add Pretter formatting to JS with loosened config matching current --- .eslintrc.json | 7 +- .pre-commit-config.yaml | 9 +++ .prettierrc.yaml | 8 ++ doc/_static/js/custom_scripts.js | 129 +++++++++++++++++-------------- 4 files changed, 94 insertions(+), 59 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 9ed7dba47..efa7ef140 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,11 +4,14 @@ "es2021": true, "jquery": true }, - "extends": ["standard"], + "extends": [ + "standard", + "prettier" + ], "parserOptions": { "ecmaVersion": 12 }, "rules": { - "no-var": 0 + "no-var": "off" } } diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c87573c55..21ba06a0d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -92,6 +92,14 @@ repos: types: [ini] args: [--autofix] +# Format JavaScript with Prettier +- repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.0.3 + hooks: + - id: prettier + name: Format JavaScript (Prettier) + types: [javascript] + # Lint and fix JavaScript - repo: https://github.com/eslint/eslint rev: v8.52.0 @@ -101,6 +109,7 @@ repos: args: [--fix, --max-warnings, '0', --color --report-unused-disable-directives] 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' diff --git a/.prettierrc.yaml b/.prettierrc.yaml index dadfe605e..e7b88611d 100644 --- a/.prettierrc.yaml +++ b/.prettierrc.yaml @@ -1,7 +1,12 @@ # Configuration file for Prettier +printWidth: 120 tabWidth: 2 useTabs: false +semi: false +trailingComma: 'none' +bracketSpacing: false +arrowParens: 'always' proseWrap: 'preserve' endOfLine: 'lf' singleAttributePerLine: false @@ -11,3 +16,6 @@ overrides: options: printWidth: 120 singleQuote: false +- files: '*.js' + options: + singleQuote: true diff --git a/doc/_static/js/custom_scripts.js b/doc/_static/js/custom_scripts.js index 82cd0958b..5c7cc99c2 100644 --- a/doc/_static/js/custom_scripts.js +++ b/doc/_static/js/custom_scripts.js @@ -24,7 +24,8 @@ element: '#introduction-rect', popover: { title: 'Spyder', - description: 'Spyder is a powerful scientific IDE for Python. Here, we will guide you through some of its most important features.', + description: + 'Spyder is a powerful scientific IDE for Python. Here, we will guide you through some of its most important features.', position: 'bottom' } }, @@ -32,7 +33,8 @@ element: '#toolbar-rect', popover: { title: 'Toolbar', - description: 'The toolbar allows you to quickly access some of the most common commands in Spyder, such as run, save and debug files.', + description: + 'The toolbar allows you to quickly access some of the most common commands in Spyder, such as run, save and debug files.', position: 'bottom' } }, @@ -40,7 +42,8 @@ element: '#statusbar-rect', popover: { title: 'Status Bar', - description: 'The status bar shows your current Python environment, git branch, memory usage and various attributes of the currently active file.', + description: + 'The status bar shows your current Python environment, git branch, memory usage and various attributes of the currently active file.', position: 'top' } }, @@ -48,7 +51,8 @@ element: '#options-menu-rect', popover: { title: 'Options Menu', - description: 'You can display each pane\'s options menu by clicking the "hamburger" icon at the top right. It contains useful settings and actions relevant to the pane.', + description: + 'You can display each pane\'s options menu by clicking the "hamburger" icon at the top right. It contains useful settings and actions relevant to the pane.', position: 'right' } }, @@ -56,7 +60,8 @@ element: '#context-menu-rect', popover: { title: 'Context Menu', - description: 'To display the context menu for a pane, right-click anywhere over it. The menu shows actions relevant to the element under your cursor.', + description: + 'To display the context menu for a pane, right-click anywhere over it. The menu shows actions relevant to the element under your cursor.', position: 'right' } }, @@ -64,7 +69,8 @@ element: '#editor-rect', popover: { title: 'Editor', - description: 'The Editor is the pane where you can create, open and edit files. It contains useful features like autocompletion, real-time analysis and syntax highlighting.', + description: + 'The Editor is the pane where you can create, open and edit files. It contains useful features like autocompletion, real-time analysis and syntax highlighting.', position: 'right' } }, @@ -72,7 +78,8 @@ element: '#console-rect', popover: { title: 'IPython Console', - description: 'The Console allows you to run your code from the Editor or interactively. You can also use it to control Spyder’s debugger.', + description: + 'The Console allows you to run your code from the Editor or interactively. You can also use it to control Spyder’s debugger.', position: 'left' } }, @@ -80,7 +87,8 @@ element: '#help-rect', popover: { title: 'Help', - description: 'The Help pane displays documentation for the objects you are using in the Editor or the IPython Console. To trigger Help, press Ctrl-I (Cmd-I on macOS) with your cursor over an object, or type its name in the Object field.', + description: + 'The Help pane displays documentation for the objects you are using in the Editor or the IPython Console. To trigger Help, press Ctrl-I (Cmd-I on macOS) with your cursor over an object, or type its name in the Object field.', position: 'left' } }, @@ -88,7 +96,8 @@ element: '#variable-explorer-rect', popover: { title: 'Variable Explorer', - description: 'The Variable Explorer allows you to browse and interact with the objects generated when running your code. Double-clicking a variable will open a specialized viewer, allowing you to inspect its contents.', + description: + 'The Variable Explorer allows you to browse and interact with the objects generated when running your code. Double-clicking a variable will open a specialized viewer, allowing you to inspect its contents.', position: 'left' } }, @@ -96,7 +105,8 @@ element: '#plots-rect', popover: { title: 'Plots', - description: 'The Plots pane shows the figures and images created during your code execution. It allows you to browse, zoom, copy, and save the generated plots.', + description: + 'The Plots pane shows the figures and images created during your code execution. It allows you to browse, zoom, copy, and save the generated plots.', position: 'left' } }, @@ -104,7 +114,8 @@ element: '#files-rect', popover: { title: 'Files', - description: 'The Files pane lets you browse the directories on your computer, open files in the Editor, and perform a variety of other operations.', + description: + 'The Files pane lets you browse the directories on your computer, open files in the Editor, and perform a variety of other operations.', position: 'left' } }, @@ -112,7 +123,8 @@ element: '#find-rect', popover: { title: 'Find', - description: 'The Find pane allows you to search for text in a given directory and navigate through all the found occurrences.', + description: + 'The Find pane allows you to search for text in a given directory and navigate through all the found occurrences.', position: 'left' } }, @@ -120,7 +132,8 @@ element: '#profiler-rect', popover: { title: 'Profiler', - description: 'The Profiler helps you optimize your code by determining the run time and number of calls for every function and method used in a file. It also allows you to save and compare your results between runs.', + description: + 'The Profiler helps you optimize your code by determining the run time and number of calls for every function and method used in a file. It also allows you to save and compare your results between runs.', position: 'left' } }, @@ -128,7 +141,8 @@ element: '#code-analysis-rect', popover: { title: 'Code Analysis', - description: 'The Code Analysis helps you improve the quality of your programs by detecting style issues, bad practices and potential bugs.', + description: + 'The Code Analysis helps you improve the quality of your programs by detecting style issues, bad practices and potential bugs.', position: 'left' } } @@ -137,60 +151,61 @@ /* Helper functions */ // Set the active image for the tour based on the element's class - function setActiveTourImage (activeElement) { + 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]) if (imageToActivate) break - }; + } var 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) { + function addProgressSpan(tourSteps) { for (var i = 0; i < tourSteps.length; i++) { - var spanToAdd = '' + (i + 1).toString() + '/' + tourSteps.length.toString() + '' + var spanToAdd = + '' + (i + 1).toString() + '/' + tourSteps.length.toString() + '' tourSteps[i].popover.title += spanToAdd - }; - }; + } + } // Get the currently selected anchor element if its a dropdown - function getDropdownElement () { + function getDropdownElement() { var dropdownID = window.location.hash if (!dropdownID) { return false - }; + } var dropdownElement = document.getElementById(dropdownID.substring(1)) - if ((!dropdownElement) || (!dropdownElement.classList.contains(dropdownClassName))) { + if (!dropdownElement || !dropdownElement.classList.contains(dropdownClassName)) { return false - }; + } return dropdownElement - }; + } // Scroll to the specified element, with an offset for the navbar - function scrollToElement (theElement) { + function scrollToElement(theElement) { if (theElement) { theElement.scrollIntoView(true) window.scrollBy(0, -100) - }; - }; + } + } /* Main functions */ var driver = null // Event handler to start tour - function startTour () { + function startTour() { driver.start() - }; + } // Interactive tour of Spyder for Quickstart using Driver - function setupTourDriver (driverOptions, tourSteps) { + function setupTourDriver(driverOptions, tourSteps) { driverOptions.onHighlightStarted = setActiveTourImage driver = new Driver(driverOptions) // eslint-disable-line no-undef @@ -198,31 +213,31 @@ driver.defineSteps(tourSteps) document.getElementById('quickstart-tour-start').onclick = startTour return driver - }; + } // Handle version selector - function setupVersionSelector () { + function setupVersionSelector() { document.querySelectorAll('#select-versions').forEach(function (ele) { ele.onchange = function () { if (this.value) { window.location.href = this.value - }; + } } }) - }; + } // Set up ids and direct links to dropdowns in FAQ - function setupDropdownLinks () { + 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++) { if (dropdowns[i].classList[j].startsWith('dropdown-id-')) { dropdowns[i].id = dropdowns[i].classList[j].replace('dropdown-id-', '') - }; - }; + } + } if (!dropdowns[i].id) { dropdowns[i].id = 'dropdown-' + (i + 1) - }; + } var aTag = document.createElement('a') aTag.setAttribute('href', '#' + dropdowns[i].id) @@ -232,11 +247,11 @@ var summaryElement = dropdowns[i].getElementsByClassName('summary-title')[0] summaryElement.insertBefore(aTag, summaryElement.getElementsByClassName('docutils')[0]) - }; - }; + } + } // Open the specified dropdown, wait for images to load then scroll to it - function scrollToDropdown () { + function scrollToDropdown() { var dropdownElement = getDropdownElement() if (dropdownElement) { if (dropdownElement.open) { @@ -244,19 +259,19 @@ } else { dropdownElement.open = true setTimeout(scrollToElement, 500, dropdownElement) - }; - }; - }; + } + } + } // Open all dropdowns that have highlighted words - function openHighlightedDropdowns () { + function openHighlightedDropdowns() { var dropdowns = document.getElementsByClassName(dropdownClassName) for (var idx = 0; idx < dropdowns.length; idx++) { if (dropdowns[idx].getElementsByClassName('highlighted').length) { dropdowns[idx].open = true - }; - }; - }; + } + } + } /* Fire events */ @@ -265,18 +280,18 @@ // Set up the tour if (document.getElementsByClassName('interactive-tour-container').length) { driver = setupTourDriver(quickstartDriverOptions, quickstartTourSteps) - }; + } // Set up the version dropdown if (document.getElementById('select-versions')) { setupVersionSelector() - }; + } // Set up the dropdown direct links if (document.getElementsByClassName(dropdownClassName).length) { setupDropdownLinks() window.onhashchange = scrollToDropdown - }; + } }) // Asset load complete @@ -284,16 +299,16 @@ // Start the tour if (document.getElementsByClassName('interactive-tour-container').length) { startTour() - }; + } // Open any dropdowns with highlighted words if (document.getElementsByClassName(dropdownClassName).length) { openHighlightedDropdowns() - }; + } // Scroll to and open the dropdown direct links if (getDropdownElement()) { scrollToDropdown() - }; + } } -}()) +})() From eb42dd1fe657ec0f1b79a647ddcbc76e246e6eff Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Thu, 26 Oct 2023 23:53:59 -0500 Subject: [PATCH 06/13] Apply standard strict Prettier config --- .prettierrc.yaml | 11 +- doc/_static/js/custom_scripts.js | 272 ++++++++++++++++--------------- 2 files changed, 147 insertions(+), 136 deletions(-) diff --git a/.prettierrc.yaml b/.prettierrc.yaml index e7b88611d..3a613f332 100644 --- a/.prettierrc.yaml +++ b/.prettierrc.yaml @@ -1,10 +1,11 @@ # Configuration file for Prettier -printWidth: 120 +printWidth: 80 tabWidth: 2 useTabs: false -semi: false -trailingComma: 'none' +semi: true +singleQuote: false +trailingComma: 'es5' bracketSpacing: false arrowParens: 'always' proseWrap: 'preserve' @@ -15,7 +16,3 @@ overrides: - files: '*.css' options: printWidth: 120 - singleQuote: false -- files: '*.js' - options: - singleQuote: true diff --git a/doc/_static/js/custom_scripts.js b/doc/_static/js/custom_scripts.js index 5c7cc99c2..3c76b1d88 100644 --- a/doc/_static/js/custom_scripts.js +++ b/doc/_static/js/custom_scripts.js @@ -1,12 +1,12 @@ // Custom scripts for the Spyder docs site -;(function () { - 'use strict' +(function () { + "use strict"; /* Top-level variables */ // Name of the dropdown class to check for - const dropdownClassName = 'dropdown' + const dropdownClassName = "dropdown"; // Interactive tour driver options var quickstartDriverOptions = { @@ -14,261 +14,275 @@ opacity: 0.1, padding: 0, allowClose: false, - nextBtnText: 'Next', - prevBtnText: 'Previous' - } + nextBtnText: "Next", + prevBtnText: "Previous", + }; // Step definitions for the quickstart tour var quickstartTourSteps = [ { - element: '#introduction-rect', + element: "#introduction-rect", popover: { - title: 'Spyder', + title: "Spyder", description: - 'Spyder is a powerful scientific IDE for Python. Here, we will guide you through some of its most important features.', - position: 'bottom' - } + "Spyder is a powerful scientific IDE for Python. Here, we will guide you through some of its most important features.", + position: "bottom", + }, }, { - element: '#toolbar-rect', + element: "#toolbar-rect", popover: { - title: 'Toolbar', + title: "Toolbar", description: - 'The toolbar allows you to quickly access some of the most common commands in Spyder, such as run, save and debug files.', - position: 'bottom' - } + "The toolbar allows you to quickly access some of the most common commands in Spyder, such as run, save and debug files.", + position: "bottom", + }, }, { - element: '#statusbar-rect', + element: "#statusbar-rect", popover: { - title: 'Status Bar', + title: "Status Bar", description: - 'The status bar shows your current Python environment, git branch, memory usage and various attributes of the currently active file.', - position: 'top' - } + "The status bar shows your current Python environment, git branch, memory usage and various attributes of the currently active file.", + position: "top", + }, }, { - element: '#options-menu-rect', + element: "#options-menu-rect", popover: { - title: 'Options Menu', + title: "Options Menu", description: 'You can display each pane\'s options menu by clicking the "hamburger" icon at the top right. It contains useful settings and actions relevant to the pane.', - position: 'right' - } + position: "right", + }, }, { - element: '#context-menu-rect', + element: "#context-menu-rect", popover: { - title: 'Context Menu', + title: "Context Menu", description: - 'To display the context menu for a pane, right-click anywhere over it. The menu shows actions relevant to the element under your cursor.', - position: 'right' - } + "To display the context menu for a pane, right-click anywhere over it. The menu shows actions relevant to the element under your cursor.", + position: "right", + }, }, { - element: '#editor-rect', + element: "#editor-rect", popover: { - title: 'Editor', + title: "Editor", description: 'The Editor is the pane where you can create, open and edit files. It contains useful features like autocompletion, real-time analysis and syntax highlighting.', - position: 'right' - } + position: "right", + }, }, { - element: '#console-rect', + element: "#console-rect", popover: { - title: 'IPython Console', + title: "IPython Console", description: 'The Console allows you to run your code from the Editor or interactively. You can also use it to control Spyder’s debugger.', - position: 'left' - } + position: "left", + }, }, { - element: '#help-rect', + element: "#help-rect", popover: { - title: 'Help', + title: "Help", description: 'The Help pane displays documentation for the objects you are using in the Editor or the IPython Console. To trigger Help, press Ctrl-I (Cmd-I on macOS) with your cursor over an object, or type its name in the Object field.', - position: 'left' - } + position: "left", + }, }, { - element: '#variable-explorer-rect', + element: "#variable-explorer-rect", popover: { - title: 'Variable Explorer', + title: "Variable Explorer", description: 'The Variable Explorer allows you to browse and interact with the objects generated when running your code. Double-clicking a variable will open a specialized viewer, allowing you to inspect its contents.', - position: 'left' - } + position: "left", + }, }, { - element: '#plots-rect', + element: "#plots-rect", popover: { - title: 'Plots', + title: "Plots", description: 'The Plots pane shows the figures and images created during your code execution. It allows you to browse, zoom, copy, and save the generated plots.', - position: 'left' - } + position: "left", + }, }, { - element: '#files-rect', + element: "#files-rect", popover: { - title: 'Files', + title: "Files", description: 'The Files pane lets you browse the directories on your computer, open files in the Editor, and perform a variety of other operations.', - position: 'left' - } + position: "left", + }, }, { - element: '#find-rect', + element: "#find-rect", popover: { - title: 'Find', + title: "Find", description: 'The Find pane allows you to search for text in a given directory and navigate through all the found occurrences.', - position: 'left' - } + position: "left", + }, }, { - element: '#profiler-rect', + element: "#profiler-rect", popover: { - title: 'Profiler', + title: "Profiler", description: 'The Profiler helps you optimize your code by determining the run time and number of calls for every function and method used in a file. It also allows you to save and compare your results between runs.', - position: 'left' - } + position: "left", + }, }, { - element: '#code-analysis-rect', + element: "#code-analysis-rect", popover: { - title: 'Code Analysis', + title: "Code Analysis", description: 'The Code Analysis helps you improve the quality of your programs by detecting style issues, bad practices and potential bugs.', - position: 'left' - } - } - ] + position: "left", + }, + }, + ]; /* Helper functions */ // 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(' ') + 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]) - if (imageToActivate) break + var imageToActivate = document.getElementById(classNames[i]); + if (imageToActivate) break; } - var imageToDeactivate = document.getElementsByClassName(activeClass)[0] - imageToDeactivate.classList.remove(activeClass) - imageToActivate.classList.add(activeClass) + var 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 = - '' + (i + 1).toString() + '/' + tourSteps.length.toString() + '' - tourSteps[i].popover.title += spanToAdd + '' + + (i + 1).toString() + + "/" + + tourSteps.length.toString() + + ""; + tourSteps[i].popover.title += spanToAdd; } } // Get the currently selected anchor element if its a dropdown function getDropdownElement() { - var dropdownID = window.location.hash + var dropdownID = window.location.hash; if (!dropdownID) { - return false + return false; } - var dropdownElement = document.getElementById(dropdownID.substring(1)) - if (!dropdownElement || !dropdownElement.classList.contains(dropdownClassName)) { - return false + var dropdownElement = document.getElementById(dropdownID.substring(1)); + if ( + !dropdownElement || + !dropdownElement.classList.contains(dropdownClassName) + ) { + return false; } - return dropdownElement + return dropdownElement; } // Scroll to the specified element, with an offset for the navbar function scrollToElement(theElement) { if (theElement) { - theElement.scrollIntoView(true) - window.scrollBy(0, -100) + theElement.scrollIntoView(true); + window.scrollBy(0, -100); } } /* Main functions */ - var driver = null + var driver = null; // Event handler to start tour function startTour() { - driver.start() + driver.start(); } // Interactive tour of Spyder for Quickstart using Driver function setupTourDriver(driverOptions, tourSteps) { - driverOptions.onHighlightStarted = setActiveTourImage - driver = new Driver(driverOptions) // eslint-disable-line no-undef + driverOptions.onHighlightStarted = setActiveTourImage; + driver = new Driver(driverOptions); // eslint-disable-line no-undef - addProgressSpan(tourSteps) - driver.defineSteps(tourSteps) - document.getElementById('quickstart-tour-start').onclick = startTour - return driver + addProgressSpan(tourSteps); + driver.defineSteps(tourSteps); + document.getElementById("quickstart-tour-start").onclick = startTour; + return driver; } // Handle version selector function setupVersionSelector() { - document.querySelectorAll('#select-versions').forEach(function (ele) { + document.querySelectorAll("#select-versions").forEach(function (ele) { ele.onchange = function () { if (this.value) { - window.location.href = this.value + window.location.href = this.value; } - } - }) + }; + }); } // Set up ids and direct links to dropdowns in FAQ function setupDropdownLinks() { - var dropdowns = document.getElementsByClassName(dropdownClassName) + var dropdowns = document.getElementsByClassName(dropdownClassName); for (var i = 0; i < dropdowns.length; i++) { for (var 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-', '') + if (dropdowns[i].classList[j].startsWith("dropdown-id-")) { + dropdowns[i].id = dropdowns[i].classList[j].replace( + "dropdown-id-", + "" + ); } } if (!dropdowns[i].id) { - dropdowns[i].id = 'dropdown-' + (i + 1) + dropdowns[i].id = "dropdown-" + (i + 1); } - var 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 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 = dropdowns[i].getElementsByClassName('summary-title')[0] - summaryElement.insertBefore(aTag, summaryElement.getElementsByClassName('docutils')[0]) + var summaryElement = + dropdowns[i].getElementsByClassName("summary-title")[0]; + summaryElement.insertBefore( + aTag, + summaryElement.getElementsByClassName("docutils")[0] + ); } } // Open the specified dropdown, wait for images to load then scroll to it function scrollToDropdown() { - var dropdownElement = getDropdownElement() + var dropdownElement = getDropdownElement(); if (dropdownElement) { if (dropdownElement.open) { - scrollToElement(dropdownElement) + scrollToElement(dropdownElement); } else { - dropdownElement.open = true - setTimeout(scrollToElement, 500, dropdownElement) + dropdownElement.open = true; + setTimeout(scrollToElement, 500, dropdownElement); } } } // Open all dropdowns that have highlighted words function openHighlightedDropdowns() { - var dropdowns = document.getElementsByClassName(dropdownClassName) + var dropdowns = document.getElementsByClassName(dropdownClassName); for (var idx = 0; idx < dropdowns.length; idx++) { - if (dropdowns[idx].getElementsByClassName('highlighted').length) { - dropdowns[idx].open = true + if (dropdowns[idx].getElementsByClassName("highlighted").length) { + dropdowns[idx].open = true; } } } @@ -276,39 +290,39 @@ /* Fire events */ // Initial DOM ready - document.addEventListener('DOMContentLoaded', function () { + document.addEventListener("DOMContentLoaded", function () { // Set up the tour - if (document.getElementsByClassName('interactive-tour-container').length) { - driver = setupTourDriver(quickstartDriverOptions, quickstartTourSteps) + if (document.getElementsByClassName("interactive-tour-container").length) { + driver = setupTourDriver(quickstartDriverOptions, quickstartTourSteps); } // Set up the version dropdown - if (document.getElementById('select-versions')) { - setupVersionSelector() + if (document.getElementById("select-versions")) { + setupVersionSelector(); } // Set up the dropdown direct links if (document.getElementsByClassName(dropdownClassName).length) { - setupDropdownLinks() - window.onhashchange = scrollToDropdown + setupDropdownLinks(); + window.onhashchange = scrollToDropdown; } - }) + }); // Asset load complete window.onload = function () { // Start the tour - if (document.getElementsByClassName('interactive-tour-container').length) { - startTour() + if (document.getElementsByClassName("interactive-tour-container").length) { + startTour(); } // Open any dropdowns with highlighted words if (document.getElementsByClassName(dropdownClassName).length) { - openHighlightedDropdowns() + openHighlightedDropdowns(); } // Scroll to and open the dropdown direct links if (getDropdownElement()) { - scrollToDropdown() + scrollToDropdown(); } - } -})() + }; +})(); From 81b10f8da897930024ccebc2814a003c028d66c9 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Fri, 3 Nov 2023 18:06:00 -0500 Subject: [PATCH 07/13] Remove no-longer-needed Netlify runtime.txt to ease upgrades --- netlify.toml | 6 +++--- runtime.txt | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 runtime.txt diff --git a/netlify.toml b/netlify.toml index 1b4750c40..606e906a4 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,11 +5,11 @@ # This is where we will look for package.json/.nvmrc/etc. # base = "project/" - # Default build command. - command = "ci/install.sh && ci/build.sh" - # Directory that contains the deploy-ready HTML files and assets generated by # the build. This is relative to the base directory if one has been set, or the # root directory if a base has not been set. This sample publishes the # directory located at the absolute path "root/project/build-output" publish = "doc/_build/html/" + + # Default build command. + command = "ci/install.sh && ci/build.sh" diff --git a/runtime.txt b/runtime.txt deleted file mode 100644 index cc1923a40..000000000 --- a/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -3.8 From 5ac038d646676768200d12ba95236daaaee268c9 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Sat, 4 Nov 2023 14:53:06 -0500 Subject: [PATCH 08/13] Update CI workflows and config, and sync with website --- .github/workflows/build.yaml | 16 ++++++---- .github/workflows/check.yaml | 3 +- .github/workflows/deploy.yaml | 38 ------------------------ .github/workflows/lint.yaml | 10 ++----- CONTRIBUTING.md | 4 +-- ci/install.sh | 2 +- requirements-conda.txt | 2 +- requirements-dev.txt => requirements.txt | 2 +- 8 files changed, 18 insertions(+), 59 deletions(-) delete mode 100644 .github/workflows/deploy.yaml rename requirements-dev.txt => requirements.txt (89%) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c4e5a8010..d366e83d8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,6 +1,4 @@ -# Build the docs to test that they work correctly -# Based on https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - +# Build the site and deploy it to GitHub pages name: Build on: # yamllint disable-line rule:truthy @@ -19,13 +17,13 @@ on: # yamllint disable-line rule:truthy jobs: build: - name: Build Docs + name: Build and Deploy runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python @@ -38,6 +36,12 @@ jobs: - name: List dependencies shell: bash run: pip list - - name: Build with Sphinx + - name: Build site shell: bash run: ./ci/build.sh + - name: Deploy to GitHub Pages + if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4 + with: + FOLDER: ./doc/_build/html + CLEAN: true # Remove deleted files from the deploy branch diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 0530997cd..78cf0eb53 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -1,5 +1,4 @@ # Build the docs and run checks on them -# Based on https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: Check @@ -25,7 +24,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml deleted file mode 100644 index a5da27af9..000000000 --- a/.github/workflows/deploy.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# Build the docs and deploy them to the GitHub pages docs site -name: Deploy - -on: # yamllint disable-line rule:truthy - push: - branches: - - master - - main - -jobs: - deploy: - name: Build and Deploy Docs - - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - name: Install dependencies - shell: bash - run: ./ci/install.sh - - name: List dependencies - shell: bash - run: pip list - - name: Build with Sphinx - shell: bash - run: ./ci/build.sh - - name: Deploy to GitHub Pages - uses: JamesIves/github-pages-deploy-action@v4 - with: - FOLDER: ./doc/_build/html # The folder the action should deploy - CLEAN: true # Automatically remove deleted files from the deploy branch diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index a7a4ce3b0..51174f70b 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -23,16 +23,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.9' - - name: Install dependencies - shell: bash - run: ./ci/install.sh - - name: List dependencies - shell: bash - run: pip list - - name: Run Pre-Commit hooks + - name: Run pre-commit hooks uses: pre-commit/action@v3.0.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b85f1bf36..042f118cd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -122,13 +122,13 @@ You can install them into your current Conda environment with: ```shell conda install -c conda-forge --file requirements-conda.txt -python -m pip install -r requirements-dev.txt +python -m pip install -r requirements.txt ``` Or, if using ``pip``, you can grab them with just: ```shell -python -m pip install -r requirements-dev.txt +python -m pip install -r requirements.txt ``` diff --git a/ci/install.sh b/ci/install.sh index 3069067a2..f35d601cc 100755 --- a/ci/install.sh +++ b/ci/install.sh @@ -1,7 +1,7 @@ #!/bin/bash -ex python3 -m pip install --upgrade pip setuptools wheel -python3 -m pip install --upgrade -r requirements-dev.txt +python3 -m pip install --upgrade -r requirements.txt # You can uncomment the command below to use a different version of the theme (but return it to the correct one before merging) # python3 -m pip install --upgrade --force-reinstall --no-deps git+https://github.com/spyder-ide/spyder-docs-sphinx-theme.git@develop_spyder diff --git a/requirements-conda.txt b/requirements-conda.txt index 5bc7ce613..f7f9a4aad 100644 --- a/requirements-conda.txt +++ b/requirements-conda.txt @@ -1,4 +1,4 @@ jinja2>=2,<3 # Sphinx <4 is not compatible with Jinja >=3 MarkupSafe>=1,<2 # Sphinx <4 is not compatible with MarkupSafe >=2 -pre-commit>=2.10.0,<3 # For pre-commit hooks +pre-commit>=2.10.0,<4 # For pre-commit hooks sphinx>=3,<4 # Sphinx-Multiversion is not compatible with Sphinx 4 diff --git a/requirements-dev.txt b/requirements.txt similarity index 89% rename from requirements-dev.txt rename to requirements.txt index dd824ac93..c8a6deaba 100644 --- a/requirements-dev.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ git+https://github.com/spyder-ide/spyder-docs-sphinx-theme.git@develop_spyder jinja2>=2,<3 # Sphinx <4 is not compatible with Jinja >=3 MarkupSafe>=1,<2 # Sphinx <4 is not compatible with MarkupSafe >=2 -pre-commit>=2.10.0,<3 # For pre-commit hooks +pre-commit>=2.10.0,<4 # For pre-commit hooks sphinx>=3,<4 # Sphinx-Multiversion is not compatible with Sphinx 4 sphinx-multiversion # For version selector support sphinx-panels # For dropdowns and other fancy UI elements From bbf20cf51aae381ae712235b624a1b82f615e812 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Mon, 6 Nov 2023 18:01:39 -0600 Subject: [PATCH 09/13] Add flaky OpenSUSE URL to linkcheck ignore list --- doc/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/conf.py b/doc/conf.py index 92a4b6562..0e248a4c1 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -382,6 +382,7 @@ linkcheck_ignore = [ r"https://(www\.)?github\.com/.+/compare/.+#diff-.+", r"https://(www\.)?packages\.gentoo\.org.*", + r"https://(www\.)?software\.opensuse\.org.*", ] From 38420fede3d25730e08a83d11925daa698558254 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Mon, 6 Nov 2023 19:07:48 -0600 Subject: [PATCH 10/13] Update meta-files and sync with other repos --- AUTHORS.txt | 5 +++-- README.md | 6 ------ SECURITY.md | 11 +++++++++++ 3 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 SECURITY.md diff --git a/AUTHORS.txt b/AUTHORS.txt index e49ad94f9..6422679db 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,7 +1,8 @@ The Spyder Doc Contributors are composed of: -* Pierre Raybaut (Original Spyder author). -* Carlos Cordoba (Current Spyder maintainer). +* Pierre Raybaut (Original Spyder author) +* Carlos Cordoba (Current Spyder maintainer) +* C.A.M. Gerlach (Current docs maintainer) * All other developers who have committed to the spyder-docs repository: and contributors to the original documentation in the main spyder repository: diff --git a/README.md b/README.md index 776373980..b6f768eb1 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,9 @@ [![Build](https://github.com/spyder-ide/spyder-docs/actions/workflows/build.yaml/badge.svg)](https://github.com/spyder-ide/spyder-docs/actions/workflows/build.yaml) [![Check](https://github.com/spyder-ide/spyder-docs/actions/workflows/check.yaml/badge.svg)](https://github.com/spyder-ide/spyder-docs/actions/workflows/check.yaml) [![Lint](https://github.com/spyder-ide/spyder-docs/actions/workflows/lint.yaml/badge.svg)](https://github.com/spyder-ide/spyder-docs/actions/workflows/lint.yaml) -[![Deploy](https://github.com/spyder-ide/spyder-docs/actions/workflows/deploy.yaml/badge.svg)](https://github.com/spyder-ide/spyder-docs/actions/workflows/deploy.yaml) [![Netlify Status](https://api.netlify.com/api/v1/badges/06f113a8-c699-4171-afc6-db3a3c77d93b/deploy-status)](https://app.netlify.com/sites/spyder-docs-preview/deploys) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) [![OpenCollective Backers](https://opencollective.com/spyder/backers/badge.svg?color=blue)](https://opencollective.com/spyder) -[![Join the chat at https://gitter.im/spyder-ide/public](https://badges.gitter.im/spyder-ide/spyder.svg)](https://gitter.im/spyder-ide/public) ![Screenshot of documentation index page](./doc/_static/images/index-docs.gif) @@ -58,8 +56,6 @@ Thanks for your interest in Spyder and its documentation, and we appreciate your [Main Website](https://www.spyder-ide.org/) -[Download Spyder (with Anaconda)](https://www.anaconda.com/download/) - [Online Documentation](https://docs.spyder-ide.org/) [Spyder Github](https://github.com/spyder-ide/spyder) @@ -69,8 +65,6 @@ https://github.com/spyder-ide/spyder/wiki/Troubleshooting-Guide-and-FAQ) [Development Wiki](https://github.com/spyder-ide/spyder/wiki/Dev:-Index) -[Gitter Chatroom](https://gitter.im/spyder-ide/public) - [Google Group](https://groups.google.com/group/spyderlib) [@Spyder_IDE on Twitter](https://twitter.com/spyder_ide) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..2084032af --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,11 @@ +# 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 . +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. +Once its patched, we'll send a followup email letting you know, and are happy to update you on its status should you further inquire. +While this is a volunteer project and we don't have financial compensation to offer, we can certainly publicly thank you for your help if you would like, on the project and on the site. +Thanks! From 09a94f05720fd14813de6d1daa36b92fbbf1c123 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Mon, 29 Jan 2024 12:27:27 -0600 Subject: [PATCH 11/13] Update docs-specific hooks and config as of 2024-01-29 --- .flake8 | 2 ++ .pre-commit-config.yaml | 15 +++++++++------ .pylintrc | 6 +++--- .rstcheck.cfg | 3 --- 4 files changed, 14 insertions(+), 12 deletions(-) delete mode 100644 .rstcheck.cfg diff --git a/.flake8 b/.flake8 index 2a29a3f29..8a6ca4600 100644 --- a/.flake8 +++ b/.flake8 @@ -1,4 +1,6 @@ [flake8] +count = True ignore = E123, W504 max-doc-length = 79 max-complexity = 15 +jobs = 1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 21ba06a0d..b89bacf51 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,10 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks -# Hooks and config updated 2023-11-01 +# 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 minimum_pre_commit_version: '2.10.0' @@ -148,21 +151,21 @@ repos: # Check Python - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.5.0 hooks: - id: check-ast name: Check Python AST # Lint Python - repo: https://github.com/pycqa/flake8 - rev: '4.0.1' + rev: '7.0.0' hooks: - id: flake8 name: Lint Python with Flake8 exclude: '\bworkshops\b' - repo: https://github.com/pycqa/pylint - rev: v2.14.5 + rev: v3.0.3 hooks: - id: pylint name: Lint Python with Pylint @@ -179,7 +182,7 @@ repos: # Check RST - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 + rev: v1.10.0 hooks: - id: rst-backticks name: Check RST backticks @@ -190,7 +193,7 @@ repos: # Lint RST - repo: https://github.com/sphinx-contrib/sphinx-lint - rev: v0.8.1 + rev: v0.9.1 hooks: - id: sphinx-lint name: Lint RST diff --git a/.pylintrc b/.pylintrc index 17e8e682e..761737196 100644 --- a/.pylintrc +++ b/.pylintrc @@ -49,14 +49,14 @@ load-plugins = pylint.extensions.bad_builtin, pylint.extensions.broad_try_clause, pylint.extensions.check_elif, pylint.extensions.code_style, - pylint.extensions.comparetozero, pylint.extensions.comparison_placement, pylint.extensions.confusing_elif, pylint.extensions.consider_ternary_expression, + pylint.extensions.dict_init_mutate, pylint.extensions.docparams, pylint.extensions.docstyle, + pylint.extensions.dunder, pylint.extensions.empty_comment, - pylint.extensions.emptystring, pylint.extensions.for_any_all, pylint.extensions.no_self_use, pylint.extensions.overlapping_exceptions, @@ -547,4 +547,4 @@ preferred-modules = # Exceptions that will emit a warning when being caught. Defaults to # "BaseException, Exception". -overgeneral-exceptions = BaseException, +overgeneral-exceptions = builtins.BaseException, diff --git a/.rstcheck.cfg b/.rstcheck.cfg deleted file mode 100644 index ff5b9d3c9..000000000 --- a/.rstcheck.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[rstcheck] -ignore_directives = dropdown,panels,rst-class,youtube -ignore_messages = (Hyperlink target ".+" is not referenced\.$) From 0d5d2fd9d57af5c8be975f989d649fa6fcdf56f2 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Mon, 29 Jan 2024 13:09:36 -0600 Subject: [PATCH 12/13] Add upper caps to fix sphinxcontrib deps dropping Sphinx<5 compat --- requirements-conda.txt | 6 ++++++ requirements.txt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/requirements-conda.txt b/requirements-conda.txt index f7f9a4aad..adfedf1f1 100644 --- a/requirements-conda.txt +++ b/requirements-conda.txt @@ -2,3 +2,9 @@ jinja2>=2,<3 # Sphinx <4 is not compatible with Jinja >=3 MarkupSafe>=1,<2 # Sphinx <4 is not compatible with MarkupSafe >=2 pre-commit>=2.10.0,<4 # For pre-commit hooks sphinx>=3,<4 # Sphinx-Multiversion is not compatible with Sphinx 4 +sphinxcontrib-applehelp<1.0.5 # Version 1.0.5 drops support for Sphinx <5 +sphinxcontrib-devhelp<1.0.3 # Version 1.0.3 drops support for Sphinx <5 +sphinxcontrib-jsmath<1.0.2 # Version 1.0.2 drops support for Sphinx <5 +sphinxcontrib-htmlhelp<2.0.2 # Version 2.0.2 drops support for Sphinx <5 +sphinxcontrib-serializinghtml<1.1.6 # Version 1.1.6 drops support for Sphinx <5 +sphinxcontrib-qthelp<1.0.4 # Version 1.0.4 drops support for Sphinx <5 diff --git a/requirements.txt b/requirements.txt index c8a6deaba..4a5a68bb3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,11 @@ jinja2>=2,<3 # Sphinx <4 is not compatible with Jinja >=3 MarkupSafe>=1,<2 # Sphinx <4 is not compatible with MarkupSafe >=2 pre-commit>=2.10.0,<4 # For pre-commit hooks sphinx>=3,<4 # Sphinx-Multiversion is not compatible with Sphinx 4 +sphinxcontrib-applehelp<1.0.5 # Version 1.0.5 drops support for Sphinx <5 +sphinxcontrib-devhelp<1.0.3 # Version 1.0.3 drops support for Sphinx <5 +sphinxcontrib-jsmath<1.0.2 # Version 1.0.2 drops support for Sphinx <5 +sphinxcontrib-htmlhelp<2.0.2 # Version 2.0.2 drops support for Sphinx <5 +sphinxcontrib-serializinghtml<1.1.6 # Version 1.1.6 drops support for Sphinx <5 +sphinxcontrib-qthelp<1.0.4 # Version 1.0.4 drops support for Sphinx <5 sphinx-multiversion # For version selector support sphinx-panels # For dropdowns and other fancy UI elements From 1a7520e05a30e21a604e91dfb3aef1e9a954011e Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Mon, 29 Jan 2024 13:23:43 -0600 Subject: [PATCH 13/13] Fix additional broken links in docs as of 2024-01-29 --- doc/conf.py | 7 ++++--- doc/workshops/plugin-development.rst | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 0e248a4c1..37060988d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -380,9 +380,10 @@ # -- Options for Linkcheck -------------------------------------------------- linkcheck_ignore = [ - r"https://(www\.)?github\.com/.+/compare/.+#diff-.+", - r"https://(www\.)?packages\.gentoo\.org.*", - r"https://(www\.)?software\.opensuse\.org.*", + r"https://(www\.)?github\.com/.+/compare/.+#diff-.+", # Virtual ids + r"https://(www\.)?packages\.gentoo\.org/?.*", # Flaky + r"https://(www\.)?software\.opensuse\.org/?.*", # Flaky + r"https://(www\.)?reddit\.com/?.*", # Blocks GitHub ] diff --git a/doc/workshops/plugin-development.rst b/doc/workshops/plugin-development.rst index eb47c7b6f..5f9498cab 100644 --- a/doc/workshops/plugin-development.rst +++ b/doc/workshops/plugin-development.rst @@ -161,7 +161,7 @@ steps: 5. If you have less than 3 checkmarks take a short break (by default, 5 minutes), and return to step 2. 6. When you have completed four Pomodoro cycles, you deserve a longer break (our default is 15 minutes). Checkmarks are reset to zero, go back to step 1. -.. _Pomodoro Technique: https://francescocirillo.com/pages/pomodoro-technique +.. _Pomodoro Technique: https://www.pomodorotechnique.com/ Steps