From 75aa145aab1cf4872d1b92f13668fc35e3830479 Mon Sep 17 00:00:00 2001 From: Xiwen Cheng Date: Sun, 8 Sep 2024 16:05:18 +0200 Subject: [PATCH 1/3] gh-pages publish --- .github/workflows/release.yml | 17 ++++++ .gitignore | 1 + Makefile | 5 +- docs/CNAME | 1 + docs/README.md | 3 + ...ts-the-object-it-self-with-events.markdown | 0 ...ith-only-blank-xpath-access-rules.markdown | 0 ...ributes-with-database-interaction.markdown | 0 .../38-Delete-behaviour-in-place.markdown | 0 .../39-Avoid-using-validation-rules.markdown | 0 ...tributes-within-one-domain-object.markdown | 0 ...true-while-using-DateTime-as-date.markdown | 0 ...hen-using-DateTime-as-Date-+-time.markdown | 0 ...g-system-storage-objects-directly.markdown | 0 ...aintainance-and-super-user-rights.markdown | 0 ...enerate-related-objects-in-events.markdown | 0 ...ake-use-of-SaveObjectX-microflows.markdown | 0 ...ays-commit-with-events-or-comment.markdown | 0 ...d-dataview-in-custom-save-buttons.markdown | 0 ...ity-on-datamodel-instead-of-forms.markdown | 0 .../57-Don't-make-MxAdmin-super-user.markdown | 0 ...-overlapping-module-role-security.markdown | 0 ...that-violates-naming-conventions].markdown | 0 .../Datamodel/7-Multiple-inheritane.markdown | 0 ...nother-module-(check-per-module!).markdown | 0 .../12-Use-of-tables-within-dataview.markdown | 0 ...use-one-of-the-convention-layouts.markdown | 0 ...asource-microflow-within-one-form.markdown | 0 ...with-same-retrieve-by-association.markdown | 0 ...rid-widths-not-conform-convention.markdown | 0 ...taview-with-only-child-=-dataview.markdown | 0 ...Button-uses-image-instead-of-icon.markdown | 0 ...ence-selector-with-editable-Never.markdown | 0 ...on't-save-for-UI-on-change-events.markdown | 0 ...-Use-listviews-over-templategrids.markdown | 0 ...Use-layout-containers-over-tables.markdown | 0 ...se-nested-layout-(no-duplication).markdown | 0 ...system.Filedocument,-system.Image.markdown | 0 ...t-of-retrieve-only-used-in-filter.markdown | 0 ...aggregates-but-not-used-elsewhere.markdown | 0 ...342\200\231t-equal-a-log-message.markdown" | 0 ...ned-with-check-on-object-!=-empty.markdown | 0 .../27-Bigger-than-50-activities.markdown | 0 .../29-Commit-actions-with-a-loop.markdown | 0 .../30-Generate-document-used.markdown | 0 .../Microflows/32-Complex-check.markdown | 0 ...-instead-of-list-for-empty-checks.markdown | 0 ...-feedback-within-event-microflows.markdown | 0 ...batches-for-large-list-processing.markdown | 0 .../33-Entity-x-misses-folder.markdown | 0 ...der-missing-concention-subfolders.markdown | 0 ...-root-that-are-not-of-type-folder.markdown | 0 .../37-App-store-module-changed.markdown | 0 docs/mendix-best-practices/README.md | 58 ------------------- mkdocs.yaml | 52 +++++++++++++++++ requirements.txt | 33 +++++++++++ 56 files changed, 111 insertions(+), 59 deletions(-) create mode 100644 docs/CNAME rename docs/{mendix-best-practices => TODO}/Datamodel/10-Before-and-after-commit-actions-that-commits-the-object-it-self-with-events.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/11-Entities-with-only-blank-xpath-access-rules.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/3-Microflow-attributes-with-database-interaction.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/38-Delete-behaviour-in-place.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/39-Avoid-using-validation-rules.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/4-More-than-2-microflow-attributes-within-one-domain-object.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/40-Localize-set-to-true-while-using-DateTime-as-date.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/41-Localize-set-to-false-when-using-DateTime-as-Date-+-time.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/42-Avoid-using-system-storage-objects-directly.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/43-Seperate-maintainance-and-super-user-rights.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/45-Don't-generate-related-objects-in-events.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/50-Make-use-of-SaveObjectX-microflows.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/52-Always-commit-with-events-or-comment.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/53-Also-commit-nested-dataview-in-custom-save-buttons.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/55-Apply-security-on-datamodel-instead-of-forms.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/57-Don't-make-MxAdmin-super-user.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/59-Avoid-overlapping-module-role-security.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/6-Entity-associatons-that-violates-naming-conventions].markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/7-Multiple-inheritane.markdown (100%) rename docs/{mendix-best-practices => TODO}/Datamodel/9-Amount-of-cross-module-associations-_-3-to-another-module-(check-per-module!).markdown (100%) rename docs/{mendix-best-practices => TODO}/Forms/12-Use-of-tables-within-dataview.markdown (100%) rename docs/{mendix-best-practices => TODO}/Forms/15-Form-x-doensn't-use-one-of-the-convention-layouts.markdown (100%) rename docs/{mendix-best-practices => TODO}/Forms/16-Multiple-dataviews-with-same-datasource-microflow-within-one-form.markdown (100%) rename docs/{mendix-best-practices => TODO}/Forms/17-Multiple-nested-dataview-with-same-retrieve-by-association.markdown (100%) rename docs/{mendix-best-practices => TODO}/Forms/18-4-column-layout-grid-widths-not-conform-convention.markdown (100%) rename docs/{mendix-best-practices => TODO}/Forms/19-Dataview-with-only-child-=-dataview.markdown (100%) rename docs/{mendix-best-practices => TODO}/Forms/20-Button-uses-image-instead-of-icon.markdown (100%) rename docs/{mendix-best-practices => TODO}/Forms/21-Reference-selector-with-editable-Never.markdown (100%) rename docs/{mendix-best-practices => TODO}/Forms/51-Don't-save-for-UI-on-change-events.markdown (100%) rename docs/{mendix-best-practices => TODO}/Forms/65-Use-listviews-over-templategrids.markdown (100%) rename docs/{mendix-best-practices => TODO}/Layout/63-Use-layout-containers-over-tables.markdown (100%) rename docs/{mendix-best-practices => TODO}/Layout/64-Use-nested-layout-(no-duplication).markdown (100%) rename docs/{mendix-best-practices => TODO}/Microflows/22-Create-actions-of-system.Filedocument,-system.Image.markdown (100%) rename docs/{mendix-best-practices => TODO}/Microflows/23-Result-of-retrieve-only-used-in-filter.markdown (100%) rename docs/{mendix-best-practices => TODO}/Microflows/24-Result-of-a-retrieve-multiple-times-used-in-aggregates-but-not-used-elsewhere.markdown (100%) rename "docs/mendix-best-practices/Microflows/25-Error-handling-where-the-first-action-doesn\342\200\231t-equal-a-log-message.markdown" => "docs/TODO/Microflows/25-Error-handling-where-the-first-action-doesn\342\200\231t-equal-a-log-message.markdown" (100%) rename docs/{mendix-best-practices => TODO}/Microflows/26-Retrieve-by-association-combined-with-check-on-object-!=-empty.markdown (100%) rename docs/{mendix-best-practices => TODO}/Microflows/27-Bigger-than-50-activities.markdown (100%) rename docs/{mendix-best-practices => TODO}/Microflows/29-Commit-actions-with-a-loop.markdown (100%) rename docs/{mendix-best-practices => TODO}/Microflows/30-Generate-document-used.markdown (100%) rename docs/{mendix-best-practices => TODO}/Microflows/32-Complex-check.markdown (100%) rename docs/{mendix-best-practices => TODO}/Microflows/46-Retrieve-first-instead-of-list-for-empty-checks.markdown (100%) rename docs/{mendix-best-practices => TODO}/Microflows/48-Don't-use-validation-feedback-within-event-microflows.markdown (100%) rename docs/{mendix-best-practices => TODO}/Microflows/54-Use-batches-for-large-list-processing.markdown (100%) rename docs/{mendix-best-practices => TODO}/Modules/33-Entity-x-misses-folder.markdown (100%) rename docs/{mendix-best-practices => TODO}/Modules/34-Entity-x's-folder-missing-concention-subfolders.markdown (100%) rename docs/{mendix-best-practices => TODO}/Modules/36-Documents-within-module-root-that-are-not-of-type-folder.markdown (100%) rename docs/{mendix-best-practices => TODO}/Modules/37-App-store-module-changed.markdown (100%) delete mode 100644 docs/mendix-best-practices/README.md create mode 100644 mkdocs.yaml create mode 100644 requirements.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d84146..8b56214 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,4 +63,21 @@ jobs: asset_path: ./policies.tar.gz asset_name: policies-${{ steps.get_release.outputs.tag_name}}.tar.gz asset_content_type: application/gzip + release-docs: + name: Release Docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build + run: | + git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY -b gh-pages public + pip install -r requirements.txt + mkdocs build --verbose --clean + - name: Publish + run: | + git config --global user.name 'Robot' + git config --global user.email 'robot@cinaq.com' + rsync -av --delete site/ public/ + cd public && git add . && git commit -m "Publish" && git push origin gh-pages diff --git a/.gitignore b/.gitignore index 892c8bd..2e12925 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ go.mod # Visual Studio Code .vscode/ +site diff --git a/Makefile b/Makefile index 4ad77e1..d830156 100644 --- a/Makefile +++ b/Makefile @@ -47,4 +47,7 @@ deps: @echo "Fetching dependencies" @go mod tidy -.PHONY: all build-macos build-windows clean test deps +docs: + mkdocs build + +.PHONY: all build-macos build-windows clean test deps docs diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..508fcec --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +mxlint.cinaq.com \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index e69de29..fc7d099 100644 --- a/docs/README.md +++ b/docs/README.md @@ -0,0 +1,3 @@ +# MxLint Documentation + +MxLint (Formerly Mendix-CLI) is a set of tools to help you build high quality Mendix apps. diff --git a/docs/mendix-best-practices/Datamodel/10-Before-and-after-commit-actions-that-commits-the-object-it-self-with-events.markdown b/docs/TODO/Datamodel/10-Before-and-after-commit-actions-that-commits-the-object-it-self-with-events.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/10-Before-and-after-commit-actions-that-commits-the-object-it-self-with-events.markdown rename to docs/TODO/Datamodel/10-Before-and-after-commit-actions-that-commits-the-object-it-self-with-events.markdown diff --git a/docs/mendix-best-practices/Datamodel/11-Entities-with-only-blank-xpath-access-rules.markdown b/docs/TODO/Datamodel/11-Entities-with-only-blank-xpath-access-rules.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/11-Entities-with-only-blank-xpath-access-rules.markdown rename to docs/TODO/Datamodel/11-Entities-with-only-blank-xpath-access-rules.markdown diff --git a/docs/mendix-best-practices/Datamodel/3-Microflow-attributes-with-database-interaction.markdown b/docs/TODO/Datamodel/3-Microflow-attributes-with-database-interaction.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/3-Microflow-attributes-with-database-interaction.markdown rename to docs/TODO/Datamodel/3-Microflow-attributes-with-database-interaction.markdown diff --git a/docs/mendix-best-practices/Datamodel/38-Delete-behaviour-in-place.markdown b/docs/TODO/Datamodel/38-Delete-behaviour-in-place.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/38-Delete-behaviour-in-place.markdown rename to docs/TODO/Datamodel/38-Delete-behaviour-in-place.markdown diff --git a/docs/mendix-best-practices/Datamodel/39-Avoid-using-validation-rules.markdown b/docs/TODO/Datamodel/39-Avoid-using-validation-rules.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/39-Avoid-using-validation-rules.markdown rename to docs/TODO/Datamodel/39-Avoid-using-validation-rules.markdown diff --git a/docs/mendix-best-practices/Datamodel/4-More-than-2-microflow-attributes-within-one-domain-object.markdown b/docs/TODO/Datamodel/4-More-than-2-microflow-attributes-within-one-domain-object.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/4-More-than-2-microflow-attributes-within-one-domain-object.markdown rename to docs/TODO/Datamodel/4-More-than-2-microflow-attributes-within-one-domain-object.markdown diff --git a/docs/mendix-best-practices/Datamodel/40-Localize-set-to-true-while-using-DateTime-as-date.markdown b/docs/TODO/Datamodel/40-Localize-set-to-true-while-using-DateTime-as-date.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/40-Localize-set-to-true-while-using-DateTime-as-date.markdown rename to docs/TODO/Datamodel/40-Localize-set-to-true-while-using-DateTime-as-date.markdown diff --git a/docs/mendix-best-practices/Datamodel/41-Localize-set-to-false-when-using-DateTime-as-Date-+-time.markdown b/docs/TODO/Datamodel/41-Localize-set-to-false-when-using-DateTime-as-Date-+-time.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/41-Localize-set-to-false-when-using-DateTime-as-Date-+-time.markdown rename to docs/TODO/Datamodel/41-Localize-set-to-false-when-using-DateTime-as-Date-+-time.markdown diff --git a/docs/mendix-best-practices/Datamodel/42-Avoid-using-system-storage-objects-directly.markdown b/docs/TODO/Datamodel/42-Avoid-using-system-storage-objects-directly.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/42-Avoid-using-system-storage-objects-directly.markdown rename to docs/TODO/Datamodel/42-Avoid-using-system-storage-objects-directly.markdown diff --git a/docs/mendix-best-practices/Datamodel/43-Seperate-maintainance-and-super-user-rights.markdown b/docs/TODO/Datamodel/43-Seperate-maintainance-and-super-user-rights.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/43-Seperate-maintainance-and-super-user-rights.markdown rename to docs/TODO/Datamodel/43-Seperate-maintainance-and-super-user-rights.markdown diff --git a/docs/mendix-best-practices/Datamodel/45-Don't-generate-related-objects-in-events.markdown b/docs/TODO/Datamodel/45-Don't-generate-related-objects-in-events.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/45-Don't-generate-related-objects-in-events.markdown rename to docs/TODO/Datamodel/45-Don't-generate-related-objects-in-events.markdown diff --git a/docs/mendix-best-practices/Datamodel/50-Make-use-of-SaveObjectX-microflows.markdown b/docs/TODO/Datamodel/50-Make-use-of-SaveObjectX-microflows.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/50-Make-use-of-SaveObjectX-microflows.markdown rename to docs/TODO/Datamodel/50-Make-use-of-SaveObjectX-microflows.markdown diff --git a/docs/mendix-best-practices/Datamodel/52-Always-commit-with-events-or-comment.markdown b/docs/TODO/Datamodel/52-Always-commit-with-events-or-comment.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/52-Always-commit-with-events-or-comment.markdown rename to docs/TODO/Datamodel/52-Always-commit-with-events-or-comment.markdown diff --git a/docs/mendix-best-practices/Datamodel/53-Also-commit-nested-dataview-in-custom-save-buttons.markdown b/docs/TODO/Datamodel/53-Also-commit-nested-dataview-in-custom-save-buttons.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/53-Also-commit-nested-dataview-in-custom-save-buttons.markdown rename to docs/TODO/Datamodel/53-Also-commit-nested-dataview-in-custom-save-buttons.markdown diff --git a/docs/mendix-best-practices/Datamodel/55-Apply-security-on-datamodel-instead-of-forms.markdown b/docs/TODO/Datamodel/55-Apply-security-on-datamodel-instead-of-forms.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/55-Apply-security-on-datamodel-instead-of-forms.markdown rename to docs/TODO/Datamodel/55-Apply-security-on-datamodel-instead-of-forms.markdown diff --git a/docs/mendix-best-practices/Datamodel/57-Don't-make-MxAdmin-super-user.markdown b/docs/TODO/Datamodel/57-Don't-make-MxAdmin-super-user.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/57-Don't-make-MxAdmin-super-user.markdown rename to docs/TODO/Datamodel/57-Don't-make-MxAdmin-super-user.markdown diff --git a/docs/mendix-best-practices/Datamodel/59-Avoid-overlapping-module-role-security.markdown b/docs/TODO/Datamodel/59-Avoid-overlapping-module-role-security.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/59-Avoid-overlapping-module-role-security.markdown rename to docs/TODO/Datamodel/59-Avoid-overlapping-module-role-security.markdown diff --git a/docs/mendix-best-practices/Datamodel/6-Entity-associatons-that-violates-naming-conventions].markdown b/docs/TODO/Datamodel/6-Entity-associatons-that-violates-naming-conventions].markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/6-Entity-associatons-that-violates-naming-conventions].markdown rename to docs/TODO/Datamodel/6-Entity-associatons-that-violates-naming-conventions].markdown diff --git a/docs/mendix-best-practices/Datamodel/7-Multiple-inheritane.markdown b/docs/TODO/Datamodel/7-Multiple-inheritane.markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/7-Multiple-inheritane.markdown rename to docs/TODO/Datamodel/7-Multiple-inheritane.markdown diff --git a/docs/mendix-best-practices/Datamodel/9-Amount-of-cross-module-associations-_-3-to-another-module-(check-per-module!).markdown b/docs/TODO/Datamodel/9-Amount-of-cross-module-associations-_-3-to-another-module-(check-per-module!).markdown similarity index 100% rename from docs/mendix-best-practices/Datamodel/9-Amount-of-cross-module-associations-_-3-to-another-module-(check-per-module!).markdown rename to docs/TODO/Datamodel/9-Amount-of-cross-module-associations-_-3-to-another-module-(check-per-module!).markdown diff --git a/docs/mendix-best-practices/Forms/12-Use-of-tables-within-dataview.markdown b/docs/TODO/Forms/12-Use-of-tables-within-dataview.markdown similarity index 100% rename from docs/mendix-best-practices/Forms/12-Use-of-tables-within-dataview.markdown rename to docs/TODO/Forms/12-Use-of-tables-within-dataview.markdown diff --git a/docs/mendix-best-practices/Forms/15-Form-x-doensn't-use-one-of-the-convention-layouts.markdown b/docs/TODO/Forms/15-Form-x-doensn't-use-one-of-the-convention-layouts.markdown similarity index 100% rename from docs/mendix-best-practices/Forms/15-Form-x-doensn't-use-one-of-the-convention-layouts.markdown rename to docs/TODO/Forms/15-Form-x-doensn't-use-one-of-the-convention-layouts.markdown diff --git a/docs/mendix-best-practices/Forms/16-Multiple-dataviews-with-same-datasource-microflow-within-one-form.markdown b/docs/TODO/Forms/16-Multiple-dataviews-with-same-datasource-microflow-within-one-form.markdown similarity index 100% rename from docs/mendix-best-practices/Forms/16-Multiple-dataviews-with-same-datasource-microflow-within-one-form.markdown rename to docs/TODO/Forms/16-Multiple-dataviews-with-same-datasource-microflow-within-one-form.markdown diff --git a/docs/mendix-best-practices/Forms/17-Multiple-nested-dataview-with-same-retrieve-by-association.markdown b/docs/TODO/Forms/17-Multiple-nested-dataview-with-same-retrieve-by-association.markdown similarity index 100% rename from docs/mendix-best-practices/Forms/17-Multiple-nested-dataview-with-same-retrieve-by-association.markdown rename to docs/TODO/Forms/17-Multiple-nested-dataview-with-same-retrieve-by-association.markdown diff --git a/docs/mendix-best-practices/Forms/18-4-column-layout-grid-widths-not-conform-convention.markdown b/docs/TODO/Forms/18-4-column-layout-grid-widths-not-conform-convention.markdown similarity index 100% rename from docs/mendix-best-practices/Forms/18-4-column-layout-grid-widths-not-conform-convention.markdown rename to docs/TODO/Forms/18-4-column-layout-grid-widths-not-conform-convention.markdown diff --git a/docs/mendix-best-practices/Forms/19-Dataview-with-only-child-=-dataview.markdown b/docs/TODO/Forms/19-Dataview-with-only-child-=-dataview.markdown similarity index 100% rename from docs/mendix-best-practices/Forms/19-Dataview-with-only-child-=-dataview.markdown rename to docs/TODO/Forms/19-Dataview-with-only-child-=-dataview.markdown diff --git a/docs/mendix-best-practices/Forms/20-Button-uses-image-instead-of-icon.markdown b/docs/TODO/Forms/20-Button-uses-image-instead-of-icon.markdown similarity index 100% rename from docs/mendix-best-practices/Forms/20-Button-uses-image-instead-of-icon.markdown rename to docs/TODO/Forms/20-Button-uses-image-instead-of-icon.markdown diff --git a/docs/mendix-best-practices/Forms/21-Reference-selector-with-editable-Never.markdown b/docs/TODO/Forms/21-Reference-selector-with-editable-Never.markdown similarity index 100% rename from docs/mendix-best-practices/Forms/21-Reference-selector-with-editable-Never.markdown rename to docs/TODO/Forms/21-Reference-selector-with-editable-Never.markdown diff --git a/docs/mendix-best-practices/Forms/51-Don't-save-for-UI-on-change-events.markdown b/docs/TODO/Forms/51-Don't-save-for-UI-on-change-events.markdown similarity index 100% rename from docs/mendix-best-practices/Forms/51-Don't-save-for-UI-on-change-events.markdown rename to docs/TODO/Forms/51-Don't-save-for-UI-on-change-events.markdown diff --git a/docs/mendix-best-practices/Forms/65-Use-listviews-over-templategrids.markdown b/docs/TODO/Forms/65-Use-listviews-over-templategrids.markdown similarity index 100% rename from docs/mendix-best-practices/Forms/65-Use-listviews-over-templategrids.markdown rename to docs/TODO/Forms/65-Use-listviews-over-templategrids.markdown diff --git a/docs/mendix-best-practices/Layout/63-Use-layout-containers-over-tables.markdown b/docs/TODO/Layout/63-Use-layout-containers-over-tables.markdown similarity index 100% rename from docs/mendix-best-practices/Layout/63-Use-layout-containers-over-tables.markdown rename to docs/TODO/Layout/63-Use-layout-containers-over-tables.markdown diff --git a/docs/mendix-best-practices/Layout/64-Use-nested-layout-(no-duplication).markdown b/docs/TODO/Layout/64-Use-nested-layout-(no-duplication).markdown similarity index 100% rename from docs/mendix-best-practices/Layout/64-Use-nested-layout-(no-duplication).markdown rename to docs/TODO/Layout/64-Use-nested-layout-(no-duplication).markdown diff --git a/docs/mendix-best-practices/Microflows/22-Create-actions-of-system.Filedocument,-system.Image.markdown b/docs/TODO/Microflows/22-Create-actions-of-system.Filedocument,-system.Image.markdown similarity index 100% rename from docs/mendix-best-practices/Microflows/22-Create-actions-of-system.Filedocument,-system.Image.markdown rename to docs/TODO/Microflows/22-Create-actions-of-system.Filedocument,-system.Image.markdown diff --git a/docs/mendix-best-practices/Microflows/23-Result-of-retrieve-only-used-in-filter.markdown b/docs/TODO/Microflows/23-Result-of-retrieve-only-used-in-filter.markdown similarity index 100% rename from docs/mendix-best-practices/Microflows/23-Result-of-retrieve-only-used-in-filter.markdown rename to docs/TODO/Microflows/23-Result-of-retrieve-only-used-in-filter.markdown diff --git a/docs/mendix-best-practices/Microflows/24-Result-of-a-retrieve-multiple-times-used-in-aggregates-but-not-used-elsewhere.markdown b/docs/TODO/Microflows/24-Result-of-a-retrieve-multiple-times-used-in-aggregates-but-not-used-elsewhere.markdown similarity index 100% rename from docs/mendix-best-practices/Microflows/24-Result-of-a-retrieve-multiple-times-used-in-aggregates-but-not-used-elsewhere.markdown rename to docs/TODO/Microflows/24-Result-of-a-retrieve-multiple-times-used-in-aggregates-but-not-used-elsewhere.markdown diff --git "a/docs/mendix-best-practices/Microflows/25-Error-handling-where-the-first-action-doesn\342\200\231t-equal-a-log-message.markdown" "b/docs/TODO/Microflows/25-Error-handling-where-the-first-action-doesn\342\200\231t-equal-a-log-message.markdown" similarity index 100% rename from "docs/mendix-best-practices/Microflows/25-Error-handling-where-the-first-action-doesn\342\200\231t-equal-a-log-message.markdown" rename to "docs/TODO/Microflows/25-Error-handling-where-the-first-action-doesn\342\200\231t-equal-a-log-message.markdown" diff --git a/docs/mendix-best-practices/Microflows/26-Retrieve-by-association-combined-with-check-on-object-!=-empty.markdown b/docs/TODO/Microflows/26-Retrieve-by-association-combined-with-check-on-object-!=-empty.markdown similarity index 100% rename from docs/mendix-best-practices/Microflows/26-Retrieve-by-association-combined-with-check-on-object-!=-empty.markdown rename to docs/TODO/Microflows/26-Retrieve-by-association-combined-with-check-on-object-!=-empty.markdown diff --git a/docs/mendix-best-practices/Microflows/27-Bigger-than-50-activities.markdown b/docs/TODO/Microflows/27-Bigger-than-50-activities.markdown similarity index 100% rename from docs/mendix-best-practices/Microflows/27-Bigger-than-50-activities.markdown rename to docs/TODO/Microflows/27-Bigger-than-50-activities.markdown diff --git a/docs/mendix-best-practices/Microflows/29-Commit-actions-with-a-loop.markdown b/docs/TODO/Microflows/29-Commit-actions-with-a-loop.markdown similarity index 100% rename from docs/mendix-best-practices/Microflows/29-Commit-actions-with-a-loop.markdown rename to docs/TODO/Microflows/29-Commit-actions-with-a-loop.markdown diff --git a/docs/mendix-best-practices/Microflows/30-Generate-document-used.markdown b/docs/TODO/Microflows/30-Generate-document-used.markdown similarity index 100% rename from docs/mendix-best-practices/Microflows/30-Generate-document-used.markdown rename to docs/TODO/Microflows/30-Generate-document-used.markdown diff --git a/docs/mendix-best-practices/Microflows/32-Complex-check.markdown b/docs/TODO/Microflows/32-Complex-check.markdown similarity index 100% rename from docs/mendix-best-practices/Microflows/32-Complex-check.markdown rename to docs/TODO/Microflows/32-Complex-check.markdown diff --git a/docs/mendix-best-practices/Microflows/46-Retrieve-first-instead-of-list-for-empty-checks.markdown b/docs/TODO/Microflows/46-Retrieve-first-instead-of-list-for-empty-checks.markdown similarity index 100% rename from docs/mendix-best-practices/Microflows/46-Retrieve-first-instead-of-list-for-empty-checks.markdown rename to docs/TODO/Microflows/46-Retrieve-first-instead-of-list-for-empty-checks.markdown diff --git a/docs/mendix-best-practices/Microflows/48-Don't-use-validation-feedback-within-event-microflows.markdown b/docs/TODO/Microflows/48-Don't-use-validation-feedback-within-event-microflows.markdown similarity index 100% rename from docs/mendix-best-practices/Microflows/48-Don't-use-validation-feedback-within-event-microflows.markdown rename to docs/TODO/Microflows/48-Don't-use-validation-feedback-within-event-microflows.markdown diff --git a/docs/mendix-best-practices/Microflows/54-Use-batches-for-large-list-processing.markdown b/docs/TODO/Microflows/54-Use-batches-for-large-list-processing.markdown similarity index 100% rename from docs/mendix-best-practices/Microflows/54-Use-batches-for-large-list-processing.markdown rename to docs/TODO/Microflows/54-Use-batches-for-large-list-processing.markdown diff --git a/docs/mendix-best-practices/Modules/33-Entity-x-misses-folder.markdown b/docs/TODO/Modules/33-Entity-x-misses-folder.markdown similarity index 100% rename from docs/mendix-best-practices/Modules/33-Entity-x-misses-folder.markdown rename to docs/TODO/Modules/33-Entity-x-misses-folder.markdown diff --git a/docs/mendix-best-practices/Modules/34-Entity-x's-folder-missing-concention-subfolders.markdown b/docs/TODO/Modules/34-Entity-x's-folder-missing-concention-subfolders.markdown similarity index 100% rename from docs/mendix-best-practices/Modules/34-Entity-x's-folder-missing-concention-subfolders.markdown rename to docs/TODO/Modules/34-Entity-x's-folder-missing-concention-subfolders.markdown diff --git a/docs/mendix-best-practices/Modules/36-Documents-within-module-root-that-are-not-of-type-folder.markdown b/docs/TODO/Modules/36-Documents-within-module-root-that-are-not-of-type-folder.markdown similarity index 100% rename from docs/mendix-best-practices/Modules/36-Documents-within-module-root-that-are-not-of-type-folder.markdown rename to docs/TODO/Modules/36-Documents-within-module-root-that-are-not-of-type-folder.markdown diff --git a/docs/mendix-best-practices/Modules/37-App-store-module-changed.markdown b/docs/TODO/Modules/37-App-store-module-changed.markdown similarity index 100% rename from docs/mendix-best-practices/Modules/37-App-store-module-changed.markdown rename to docs/TODO/Modules/37-App-store-module-changed.markdown diff --git a/docs/mendix-best-practices/README.md b/docs/mendix-best-practices/README.md deleted file mode 100644 index b797e3e..0000000 --- a/docs/mendix-best-practices/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# Omnext Fit Test 4 Mendix - Best Practices - -This Github repository is to open source the Mendix best practices used by Omnext to check your Mendix model. You can fork this repository, make changes, add new rules and then create a pull request. You can also add issues. - -## Run the site locally - -To set up your environment to develop this theme follow the installation instructions on [Jekyll](https://jekyllrb.com/docs/installation/) -and run in the directory you cloned to `bundle exec jekyll serve` and open your browser at `http://localhost:4000/`. This starts a Jekyll server using your theme and the contents of the `_best_practice/` directory. As you make modifications to the site, the site will regenerate and you should see the changes in the browser after a refresh. - -# What is the Omnext Fit Test? - -## Analyse - -Our source code analysis: the Omnext Fit Test 4 Mendix is an objective and fully automated baseline measurement of your Mendix source code. Where are the problem areas as well, where are the opportunities? The test is based on Mendix Standards & Guidelines that have been completed in the system with our own expertise to put in the context of your business as equal results. As you want it. Outcome of source code analysis intelligent information to improve the business: in one upload. -The different options are a Fit Test or a Stay Fit program with several Fit tests are conducted sequentially. Learn what the differences are. - -## Fit Test - -Want to know how fit is your Mendix application? Whether you’re ready for the future and whether your software is safe? Our solution is our source code analysis: the Omnext Fit Test. We implement and the results remain available for one year. You can also opt for the Fit Test Plus, you get additional independent expert review by one of our specialists. We measure the different areas: Maintainability, Safety, Performance and Conventions. All based on Standards & Guidelines which have been drawn up by the most experienced Mendix developers. Automatic and integrated in the source code analysis. - -##Stay Fit Program - -The added value of software testing is hidden in the continuous measurement and improvement. A single test does give you insights, reusable test gives comparison. The right basis for continuous improvement. Stay Fit program, like the one-time source code analysis: Omnext Fit Test, built entirely on the basis of Standards & Guidelines and your own business rules. We measure what is standard, but also some specific to your situation. This in order to achieve relevant and objective results that you and your team can get to work. Optionally you can purchase a Stay Fit Plus program in which an independent expert review shall be attached to one of our experts four times a year. - - -##Specifications - -The OMNEXT STAY FIT Program for Mendix: -- Fully automated testing of dozens of Best Practices (Standards & Guidelines) for the Mendix MDD. -- Ready to use cloud based analysis anywhere and anytime you need. -- The Stay Fit test prevents you from making (recurring) ‘starters mistakes”. -- Not just a report about abstract meta-data but revealing details for business engineers to actually work with. -- Automated Peer Review to improve the knowledge and quality of your developers. - -**Categories of Standards & Guidelines** -- Performance: Checks on common problems which slow down or paralyse apps. -- Security: checks completeness of security model (access rules) and on known leaks. -- Maintainability: checks best practices regarding data model, modularity. -- Conventions: checks model on complying folder and naming conventions. - -**Typical usage scenario** -Any organisation where the quality of their applications and developers is key. - -**Features and limitations** -- Dashboard overview with all the key metrics for the quality of all your applications. -- Quality review of the application based on ISO 25010 -- Review your application versus the Mendix Best Practices – Standards & Guidelines - - Performance - - Security - - Maintainability - - Conventions -- Trend Analysis -- Visual dependencies analysis (application & module level) -- Identify clones in your application -- Annotations analysis - -**Requires** -Mendix version 6.5 or higher \ No newline at end of file diff --git a/mkdocs.yaml b/mkdocs.yaml new file mode 100644 index 0000000..4f195a4 --- /dev/null +++ b/mkdocs.yaml @@ -0,0 +1,52 @@ +site_name: MxLint +theme: + name: 'material' + logo: assets/logo.png +# custom_dir: overrides + palette: + # Palette toggle for automatic mode + - media: "(prefers-color-scheme)" + toggle: + icon: material/brightness-auto + name: Switch to light mode + + # Palette toggle for light mode + - media: "(prefers-color-scheme: light)" + primary: blue + accent: blue grey + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + # Palette toggle for dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: blue grey + toggle: + icon: material/brightness-4 + name: Switch to system preference + features: + - search.suggest + - search.highlight + - search.share + - navigation.footer + - navigation.instant + - navigation.instant.prefetch + - navigation.instant.progress + - navigation.tracking + # - navigation.sections + # - navigation.expand + # - toc.integrate + - header.autohide +extra: + homepage: / +plugins: + - search + - awesome-pages +copyright: Copyright © 2022 - 2024 CINAQ.com +markdown_extensions: + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5e4de64 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,33 @@ +Babel==2.14.0 +bracex==2.4 +certifi==2023.11.17 +charset-normalizer==3.3.2 +click==8.1.7 +colorama==0.4.6 +ghp-import==2.1.0 +idna==3.6 +Jinja2==3.1.2 +Markdown==3.5.1 +MarkupSafe==2.1.3 +mergedeep==1.3.4 +mkdocs==1.5.3 +mkdocs-awesome-pages-plugin==2.9.3 +mkdocs-get-deps==0.2.0 +mkdocs-material==9.5.3 +mkdocs-material-extensions==1.3.1 +natsort==8.4.0 +packaging==23.2 +paginate==0.5.6 +pathspec==0.12.1 +platformdirs==4.1.0 +Pygments==2.17.2 +pymdown-extensions==10.7 +python-dateutil==2.8.2 +PyYAML==6.0.1 +pyyaml_env_tag==0.1 +regex==2023.12.25 +requests==2.31.0 +six==1.16.0 +urllib3==2.1.0 +watchdog==3.0.0 +wcmatch==8.5.2 From 8826adb4ae3ea53aabe2a30f854fd328b09251fc Mon Sep 17 00:00:00 2001 From: Xiwen Cheng Date: Sun, 8 Sep 2024 17:02:14 +0200 Subject: [PATCH 2/3] Auto generate policy docs --- .github/workflows/release.yml | 3 +- .gitignore | 4 + scripts/generate-policies-docs.py | 105 ++++++++++++++++++ get-opa.sh => scripts/get-opa.sh | 0 .../update-modelsources.sh | 0 5 files changed, 111 insertions(+), 1 deletion(-) create mode 100755 scripts/generate-policies-docs.py rename get-opa.sh => scripts/get-opa.sh (100%) rename update-modelsources.sh => scripts/update-modelsources.sh (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b56214..6440813 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,7 +42,7 @@ jobs: id: get_release uses: bruceadams/get-release@v1.3.2 env: - GITHUB_TOKEN: ${{ github.token }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload Release Asset (ZIP) uses: actions/upload-release-asset@v1 @@ -73,6 +73,7 @@ jobs: run: | git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY -b gh-pages public pip install -r requirements.txt + python scripts/generate-policies-docs.py mkdocs build --verbose --clean - name: Publish diff --git a/.gitignore b/.gitignore index 2e12925..4c471a4 100644 --- a/.gitignore +++ b/.gitignore @@ -50,4 +50,8 @@ go.mod # Visual Studio Code .vscode/ + +# ignore generated files site +docs/policies + diff --git a/scripts/generate-policies-docs.py b/scripts/generate-policies-docs.py new file mode 100755 index 0000000..dc159f4 --- /dev/null +++ b/scripts/generate-policies-docs.py @@ -0,0 +1,105 @@ +#! /usr/bin/env python3 + +import json +import os +import sys +import argparse +import yaml + +""" +# METADATA +# scope: package +# title: No more than 15 persistent entities within one domain model +# description: The bigger the domain models, the harder they will be to maintain. It adds complexity to your security model as well. The smaller the modules, the easier to reuse. +# authors: +# - Xiwen Cheng +# custom: +# category: Maintainability +# rulename: NumberOfEntities +# severity: MEDIUM +# rulenumber: 002_0001 +# remediation: Split domain model into multiple modules. +# input: "*/DomainModels$DomainModel.yaml" +""" + +def parse(policy_file: str): + """ + Parse the policy. + """ + metadata_lines = [] + + with open(policy_file, "r") as f: + for line in f.readlines(): + if line.startswith("# METADATA"): + continue + clean_line = line.replace("# ", "", 1).strip() + if line.startswith("#"): + metadata_lines.append(clean_line) + else: + break + raw_yaml = "\n".join(metadata_lines) + metadata = yaml.load(raw_yaml, Loader=yaml.SafeLoader) + return metadata + +def generate_policies_docs(policies_dir: str, output_dir: str): + """ + Generate the policies documentation from the policies directory. + """ + for policy in os.listdir(policies_dir): + out_dir = os.path.join(output_dir, policy) + in_dir = os.path.join(policies_dir, policy) + os.makedirs(out_dir, exist_ok=True) + + if os.path.isdir(in_dir): + for file in os.listdir(in_dir): + if file.endswith(".rego") and not file.endswith("_test.rego"): + in_file = os.path.join(in_dir, file) + out_file = os.path.join(out_dir, file.replace(".rego", ".md")) + generate_policy_docs(in_file, out_file) + +def get_test_file(policy_file: str): + """ + Get the test file for the policy. + """ + test_file = policy_file.replace(".rego", "_test.rego") + if not os.path.exists(test_file): + return "# No test file found" + + with open(test_file, "r") as f: + body = f.read() + return body + +def generate_policy_docs(policy_file: str, output_file: str): + policy = parse(policy_file) + + title = policy.get("title", "Untitled") + description = policy.get("description", "No description provided") + remediation = policy.get("remediation", "No remediation provided") + del policy["title"] + del policy["description"] + del policy["remediation"] + + with open(output_file, "w") as f: + f.write(f"# {title}\n") + f.write(f"## Description\n") + f.write(f"{description}\n") + f.write(f"## Remediation\n") + f.write(f"{remediation}\n") + f.write(f"## Metadata\n") + f.write(f"```yaml\n") + f.write(f"{yaml.dump(policy)}\n") + f.write(f"```\n") + f.write(f"## Test script\n") + f.write(f"```rego\n") + f.write(f"{get_test_file(policy_file)}\n") + f.write(f"```\n") + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("-p", "--policies", type=str, default="policies", help="The directory containing the policy definitions") + parser.add_argument("-o", "--output", type=str, default="docs/policies", help="The directory to output the policies documentation") + args = parser.parse_args() + + generate_policies_docs(args.policies, args.output) + diff --git a/get-opa.sh b/scripts/get-opa.sh similarity index 100% rename from get-opa.sh rename to scripts/get-opa.sh diff --git a/update-modelsources.sh b/scripts/update-modelsources.sh similarity index 100% rename from update-modelsources.sh rename to scripts/update-modelsources.sh From b4c50c4bfa270d368d3dbfa76ef3e365c2ba3de0 Mon Sep 17 00:00:00 2001 From: Xiwen Cheng Date: Sun, 8 Sep 2024 17:09:57 +0200 Subject: [PATCH 3/3] Split gh-pages publish to own workflow --- .github/workflows/publish.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 19 ------------------- 2 files changed, 28 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..240c56f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish + +on: + push: + branches: + - main + - master + +jobs: + publish-docs: + name: Release Docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build + run: | + git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY -b gh-pages public + pip install -r requirements.txt + python scripts/generate-policies-docs.py + mkdocs build --verbose --clean + + - name: Publish + run: | + git config --global user.name 'Robot' + git config --global user.email 'robot@cinaq.com' + rsync -av --delete site/ public/ + cd public && git add . && git commit -m "Publish" && git push origin gh-pages diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6440813..5f2eae6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,22 +63,3 @@ jobs: asset_path: ./policies.tar.gz asset_name: policies-${{ steps.get_release.outputs.tag_name}}.tar.gz asset_content_type: application/gzip - release-docs: - name: Release Docs - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Build - run: | - git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY -b gh-pages public - pip install -r requirements.txt - python scripts/generate-policies-docs.py - mkdocs build --verbose --clean - - - name: Publish - run: | - git config --global user.name 'Robot' - git config --global user.email 'robot@cinaq.com' - rsync -av --delete site/ public/ - cd public && git add . && git commit -m "Publish" && git push origin gh-pages