From c0087d429dd40f9086dcc4fa2606f9f9203472d6 Mon Sep 17 00:00:00 2001 From: Francis Charette Migneault Date: Fri, 19 Apr 2024 23:14:02 -0400 Subject: [PATCH 1/8] pin remark-lint breaking tables (relates to https://github.com/remarkjs/remark-lint/issues/317) + combine npm configs into a single location --- .dockerignore | 1 + .gitignore | 1 - .remarkrc | 24 ---------------- .stylelintrc.json | 12 -------- Makefile | 4 +-- package.json | 72 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 75 insertions(+), 39 deletions(-) delete mode 100644 .remarkrc delete mode 100644 .stylelintrc.json create mode 100644 package.json diff --git a/.dockerignore b/.dockerignore index 71a7d2156..84f3d026b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -15,6 +15,7 @@ downloads env ## Node +package.json package-lock.json node_modules diff --git a/.gitignore b/.gitignore index 26ab4333f..b92754eec 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ venv environment.yml ## Node -package.json package-lock.json node_modules diff --git a/.remarkrc b/.remarkrc deleted file mode 100644 index c58b1117c..000000000 --- a/.remarkrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "settings": { - "bullet": "-", - "fence": "`", - "fences": "true", - "listItemIndent": "mixed", - "incrementListMarker": "true", - "resourceLink": "true", - "rule": "-" - }, - "plugins": [ - "remark-gfm", - "remark-preset-lint-markdown-style-guide", - "remark-preset-lint-recommended", - "remark-lint-list-item-content-indent", - "remark-lint-checkbox-content-indent", - ["lint-fenced-code-marker", "`"], - ["lint-list-item-indent", "mixed"], - ["lint-maximum-line-length", 120], - ["lint-ordered-list-marker-style", "."], - ["lint-ordered-list-marker-value", "ordered"], - ["lint-unordered-list-marker-style", "consistent"] - ] -} diff --git a/.stylelintrc.json b/.stylelintrc.json deleted file mode 100644 index 70646326a..000000000 --- a/.stylelintrc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "stylelint-config-standard", - "ignoreFiles": ["docs/_build/**", "docs/build/**"], - "rules": { - "block-no-empty": null, - "color-no-invalid-hex": true, - "color-hex-case": "upper", - "color-hex-length": "long", - "indentation": [4], - "no-descending-specificity": null - } -} diff --git a/Makefile b/Makefile index c838ed45e..7a469b535 100644 --- a/Makefile +++ b/Makefile @@ -602,7 +602,7 @@ check-imports-only: mkdir-reports ## check imports ordering and styles check-css-only: mkdir-reports ## check CSS linting @echo "Running CSS style checks..." @npx --no-install stylelint \ - --config "$(APP_ROOT)/.stylelintrc.json" \ + --config "$(APP_ROOT)/package.json" \ --output-file "$(REPORTS_DIR)/check-css.txt" \ "$(APP_ROOT)/**/*.css" @@ -617,7 +617,7 @@ check-md-only: mkdir-reports ## check Markdown linting --inspect --frail \ --silently-ignore \ --stdout --color \ - --rc-path "$(APP_ROOT)/.remarkrc" \ + --rc-path "$(APP_ROOT)/package.json" \ --ignore-path "$(APP_ROOT)/.remarkignore" \ "$(APP_ROOT)" "$(APP_ROOT)/.*/" \ > "$(REPORTS_DIR)/check-md.txt" diff --git a/package.json b/package.json new file mode 100644 index 000000000..fb139f8b4 --- /dev/null +++ b/package.json @@ -0,0 +1,72 @@ +{ + "devDependencies": { + "remark-cli": "^12.0.0", + "remark-gfm": "^4.0.0", + "remark-lint": "^9.1.2", + "remark-lint-checkbox-content-indent": "^4.1.2", + "remark-lint-maximum-line-length": "^3.1.3", + "remark-preset-lint-markdown-style-guide": "^5.1.3", + "remark-preset-lint-recommended": "^6.1.3", + "stylelint": "^15.11.0", + "stylelint-config-standard": "^34.0.0" + }, + "remarkConfig": { + "settings": { + "bullet": "-", + "fence": "`", + "fences": "true", + "listItemIndent": "mixed", + "incrementListMarker": "true", + "resourceLink": "true", + "rule": "-" + }, + "plugins": [ + "remark-gfm", + "remark-preset-lint-markdown-style-guide", + "remark-preset-lint-recommended", + "remark-lint-list-item-content-indent", + "remark-lint-checkbox-content-indent", + [ + "lint-fenced-code-marker", + "`" + ], + [ + "lint-list-item-indent", + "mixed" + ], + [ + "lint-maximum-line-length", + 120 + ], + [ + "lint-ordered-list-marker-style", + "." + ], + [ + "lint-ordered-list-marker-value", + "ordered" + ], + [ + "lint-unordered-list-marker-style", + "consistent" + ] + ] + }, + "stylelint": { + "extends": "stylelint-config-standard", + "ignoreFiles": [ + "docs/_build/**", + "docs/build/**" + ], + "rules": { + "block-no-empty": null, + "color-no-invalid-hex": true, + "color-hex-case": "upper", + "color-hex-length": "long", + "indentation": [ + 4 + ], + "no-descending-specificity": null + } + } +} From 116f922ce1f4a2cac1e69df3f914f9be241808ad Mon Sep 17 00:00:00 2001 From: Francis Charette Migneault Date: Mon, 22 Apr 2024 10:53:12 -0400 Subject: [PATCH 2/8] let package.json define npm versions --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7a469b535..ee5576eca 100644 --- a/Makefile +++ b/Makefile @@ -281,7 +281,7 @@ install-npm: ## install npm package manager and dependencies if they cannot b install-npm-stylelint: install-npm ## install stylelint dependency for 'check-css' target using npm @[ `npm ls 2>/dev/null | grep stylelint-config-standard | wc -l` = 1 ] || ( \ echo "Install required dependencies for CSS checks." && \ - npm install "stylelint@<16" "stylelint-config-standard@<35" --save-dev \ + npm install "stylelint" "stylelint-config-standard" --save-dev \ ) .PHONY: install-npm-remarklint From a896f4afa00413a41cc9717a86c43e7932e2b707 Mon Sep 17 00:00:00 2001 From: Francis Charette Migneault Date: Fri, 26 Apr 2024 22:41:15 -0400 Subject: [PATCH 3/8] add --no-install flag to npmx run --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ee5576eca..92f228aef 100644 --- a/Makefile +++ b/Makefile @@ -692,7 +692,7 @@ fix-fstring-only: mkdir-reports .PHONY: fix-css-only fix-css-only: mkdir-reports ## fix CSS linting problems automatically @echo "Fixing CSS style problems..." - @npx stylelint \ + @npx --no-install stylelint \ --fix \ --config "$(APP_ROOT)/.stylelintrc.json" \ --output-file "$(REPORTS_DIR)/fixed-css.txt" \ From 3a7c24e4961273dda5829791dde170b23e557375 Mon Sep 17 00:00:00 2001 From: Francis Charette Migneault Date: Fri, 26 Apr 2024 23:08:40 -0400 Subject: [PATCH 4/8] fix invalid package references --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 92f228aef..3579e017d 100644 --- a/Makefile +++ b/Makefile @@ -694,7 +694,7 @@ fix-css-only: mkdir-reports ## fix CSS linting problems automatically @echo "Fixing CSS style problems..." @npx --no-install stylelint \ --fix \ - --config "$(APP_ROOT)/.stylelintrc.json" \ + --config "$(APP_ROOT)/package.json" \ --output-file "$(REPORTS_DIR)/fixed-css.txt" \ "$(APP_ROOT)/**/*.css" @@ -708,7 +708,7 @@ fix-md-only: mkdir-reports ## fix Markdown linting problems automatically @npx --no-install remark \ --output --frail \ --silently-ignore \ - --rc-path "$(APP_ROOT)/.remarkrc" \ + --rc-path "$(APP_ROOT)/package.json" \ --ignore-path "$(APP_ROOT)/.remarkignore" \ "$(APP_ROOT)" "$(APP_ROOT)/.*/" \ 2>&1 | tee "$(REPORTS_DIR)/fixed-md.txt" From 900c935ac090c1b7fc9d51dd66b8ed42c3d5c07a Mon Sep 17 00:00:00 2001 From: Francis Charette Migneault Date: Fri, 26 Apr 2024 23:50:03 -0400 Subject: [PATCH 5/8] adjust npm based linters --- .github/workflows/tests.yml | 4 +++- Makefile | 13 +++---------- package.json | 7 ++++++- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5f275fc73..f798c3037 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -116,7 +116,9 @@ jobs: - name: Display Packages # skip python setup if running with docker if: ${{ matrix.test-case != 'test-docker' }} - run: pip freeze + run: | + pip freeze + npm list #- name: Setup Environment Variables # uses: c-py/action-dotenv-to-setenv@v2 # with: diff --git a/Makefile b/Makefile index 3579e017d..a7e983184 100644 --- a/Makefile +++ b/Makefile @@ -279,23 +279,16 @@ install-npm: ## install npm package manager and dependencies if they cannot b .PHONY: install-npm-stylelint install-npm-stylelint: install-npm ## install stylelint dependency for 'check-css' target using npm - @[ `npm ls 2>/dev/null | grep stylelint-config-standard | wc -l` = 1 ] || ( \ + @[ `npm ls 2>/dev/null | grep stylelint-config-standard | grep -v UNMET | wc -l` = 1 ] || ( \ echo "Install required dependencies for CSS checks." && \ - npm install "stylelint" "stylelint-config-standard" --save-dev \ + npm install --save-dev \ ) .PHONY: install-npm-remarklint install-npm-remarklint: install-npm ## install remark-lint dependency for 'check-md' target using npm - @[ `npm ls 2>/dev/null | grep remark-lint | wc -l` = 1 ] || ( \ + @[ `npm ls 2>/dev/null | grep remark-lint | grep -v UNMET | wc -l` = 1 ] || ( \ echo "Install required dependencies for Markdown checks." && \ npm install --save-dev \ - remark-lint \ - remark-gfm \ - remark-cli \ - remark-lint-maximum-line-length \ - remark-lint-checkbox-content-indent \ - remark-preset-lint-recommended \ - remark-preset-lint-markdown-style-guide \ ) ## -- Cleanup targets ----------------------------------------------------------------------------------------------- ## diff --git a/package.json b/package.json index fb139f8b4..f805786a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "devDependencies": { "remark-cli": "^12.0.0", + "remark-frontmatter": "^5.0.0", "remark-gfm": "^4.0.0", "remark-lint": "^9.1.2", "remark-lint-checkbox-content-indent": "^4.1.2", @@ -8,7 +9,9 @@ "remark-preset-lint-markdown-style-guide": "^5.1.3", "remark-preset-lint-recommended": "^6.1.3", "stylelint": "^15.11.0", - "stylelint-config-standard": "^34.0.0" + "stylelint-config-standard": "^34.0.0", + "stylelint-scss": "^5.3.2", + "stylelint-csstree-validator": "^3.0.0" }, "remarkConfig": { "settings": { @@ -22,6 +25,7 @@ }, "plugins": [ "remark-gfm", + "remark-frontmatter", "remark-preset-lint-markdown-style-guide", "remark-preset-lint-recommended", "remark-lint-list-item-content-indent", @@ -66,6 +70,7 @@ "indentation": [ 4 ], + "property-no-vendor-prefix": null, "no-descending-specificity": null } } From 275df4c3328fbf9d399086a5f8428cf7c34640df Mon Sep 17 00:00:00 2001 From: Francis Charette Migneault Date: Fri, 26 Apr 2024 23:54:09 -0400 Subject: [PATCH 6/8] adjust sphinx-autoapi --- requirements-doc.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-doc.txt b/requirements-doc.txt index 8e6380f63..9d64e1bf4 100644 --- a/requirements-doc.txt +++ b/requirements-doc.txt @@ -6,7 +6,7 @@ jinja2 sphinx>=6,<8 sphinx-argparse -sphinx-autoapi>=1.7.0 +sphinx-autoapi>=1.7.0,<3 sphinx-paramlinks>=0.4.1 # adds redoc OpenAPI directly served on readthedocs sphinxcontrib-redoc>=1.6.0 From b7a6dd6b9a5608524e1cb1e0e455ce7963caf5a3 Mon Sep 17 00:00:00 2001 From: Francis Charette Migneault Date: Fri, 26 Apr 2024 23:55:27 -0400 Subject: [PATCH 7/8] revert --- requirements-doc.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-doc.txt b/requirements-doc.txt index 9d64e1bf4..8e6380f63 100644 --- a/requirements-doc.txt +++ b/requirements-doc.txt @@ -6,7 +6,7 @@ jinja2 sphinx>=6,<8 sphinx-argparse -sphinx-autoapi>=1.7.0,<3 +sphinx-autoapi>=1.7.0 sphinx-paramlinks>=0.4.1 # adds redoc OpenAPI directly served on readthedocs sphinxcontrib-redoc>=1.6.0 From a4656da090c3f40d116370c2ff4b40c82cd50806 Mon Sep 17 00:00:00 2001 From: Francis Charette Migneault Date: Mon, 29 Apr 2024 13:38:16 -0400 Subject: [PATCH 8/8] ensure npm packages installed to avoid CI error --- .github/workflows/tests.yml | 3 ++- Makefile | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f798c3037..1823f24ed 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -112,13 +112,14 @@ jobs: if: ${{ matrix.test-case != 'test-docker' }} # install package and dependencies directly, # skip sys/conda setup to use active python - run: make install-sys install-pkg install-pip install-raw install-dev version + run: make install-sys install-pkg install-pip install-raw install-dev install-dev-npm - name: Display Packages # skip python setup if running with docker if: ${{ matrix.test-case != 'test-docker' }} run: | pip freeze npm list + make version #- name: Setup Environment Variables # uses: c-py/action-dotenv-to-setenv@v2 # with: diff --git a/Makefile b/Makefile index a7e983184..cb2f63e6d 100644 --- a/Makefile +++ b/Makefile @@ -271,26 +271,29 @@ install-raw: ## install without any requirements or dependencies (suppose everyt # install locally to ensure they can be found by config extending them .PHONY: install-npm -install-npm: ## install npm package manager and dependencies if they cannot be found +install-npm: ## install npm package manager and dependencies if they cannot be found @[ -f "$(shell which npm)" ] || ( \ echo "Binary package manager npm not found. Attempting to install it."; \ apt-get install npm \ ) .PHONY: install-npm-stylelint -install-npm-stylelint: install-npm ## install stylelint dependency for 'check-css' target using npm +install-npm-stylelint: install-npm ## install stylelint dependency for 'check-css' target using npm @[ `npm ls 2>/dev/null | grep stylelint-config-standard | grep -v UNMET | wc -l` = 1 ] || ( \ echo "Install required dependencies for CSS checks." && \ npm install --save-dev \ ) .PHONY: install-npm-remarklint -install-npm-remarklint: install-npm ## install remark-lint dependency for 'check-md' target using npm +install-npm-remarklint: install-npm ## install remark-lint dependency for 'check-md' target using npm @[ `npm ls 2>/dev/null | grep remark-lint | grep -v UNMET | wc -l` = 1 ] || ( \ echo "Install required dependencies for Markdown checks." && \ npm install --save-dev \ ) +.PHONY: install-dev-npm +install-dev-npm: install-npm install-npm-remarklint install-npm-remarklint ## install all npm development dependencies + ## -- Cleanup targets ----------------------------------------------------------------------------------------------- ## .PHONY: clean