From 065bcbf51717e6a29205ced8859a053a2915acd7 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 22 May 2023 13:24:18 +0930 Subject: [PATCH] chore(lint): correct lint errors !25 --- .gitlab-ci.yml | 1 - lint/markdown.gitlab-ci.yaml | 1 - pages/projects/gitlab-ci/ansible_roles.md | 10 +++--- .../gitlab-ci/conventional_commits.md | 8 ++--- pages/projects/gitlab-ci/docker_container.md | 2 +- pages/projects/gitlab-ci/git_mirror.md | 6 ++-- pages/projects/gitlab-ci/gitlab_release.md | 31 ++++++++++--------- pages/projects/gitlab-ci/markdown_lint.md | 8 +++++ pages/projects/gitlab-ci/mkdocs-build.md | 2 ++ pages/projects/gitlab-ci/python.md | 13 +++++--- pages/projects/gitlab-ci/yaml_lint.md | 11 ++++--- template/website.gitlab-ci.yaml | 2 +- 12 files changed, 59 insertions(+), 36 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dc79cc9..4c62319 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -120,7 +120,6 @@ gilab-ci.yml Lint (python 3.11): image: python:3.11-slim - Gitlab Release: variables: MY_COMMAND: ./sub-folder_changlog.sh diff --git a/lint/markdown.gitlab-ci.yaml b/lint/markdown.gitlab-ci.yaml index 1aa7c90..fafed23 100644 --- a/lint/markdown.gitlab-ci.yaml +++ b/lint/markdown.gitlab-ci.yaml @@ -36,7 +36,6 @@ - when: never - .Lint_Markdown_Pages: variables: MDLINT_PATHS: "pages/*.md pages/**/*.md pages/**/**/*.md pages/**/**/**/*.md pages/**/**/**/**/**/*.md #CHANGELOG.md !gitlab-ci !website-template" diff --git a/pages/projects/gitlab-ci/ansible_roles.md b/pages/projects/gitlab-ci/ansible_roles.md index 9cff509..64f0832 100644 --- a/pages/projects/gitlab-ci/ansible_roles.md +++ b/pages/projects/gitlab-ci/ansible_roles.md @@ -52,14 +52,16 @@ Ansible Lint (python 3.6): ## Job Workflow - - This job will lint any yml file in the specified directory using ansible rules. +- This job will lint any yml file in the specified directory using ansible rules. ## Artifacts - - `$CI_PROJECT_DIR/artifacts` - Root artifact directory - - `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$PYTHON_VERSION-ansible-lint.junit.xml` - JUnit Test report - - `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-ansible-lint.log` - Linter log +- `$CI_PROJECT_DIR/artifacts` - Root artifact directory + +- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$PYTHON_VERSION-ansible-lint.junit.xml` - JUnit Test report + +- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-ansible-lint.log` - Linter log ## License diff --git a/pages/projects/gitlab-ci/conventional_commits.md b/pages/projects/gitlab-ci/conventional_commits.md index 9e65401..4447ee1 100644 --- a/pages/projects/gitlab-ci/conventional_commits.md +++ b/pages/projects/gitlab-ci/conventional_commits.md @@ -28,20 +28,20 @@ Ensure that the merge request title is in the [conventional message](https://www ### Commit Messages -All commit messages that form part of your merge request must be in [conventional message](https://www.conventionalcommits.org/en/v1.0.0/) format. +All commit messages that form part of your merge request must be in [conventional message](https://www.conventionalcommits.org/en/v1.0.0/) format. To fix them go back and edit your commit messages. #### fixing commit messages (suggestion) -If only the last commit is the commit with an error just use `git commit --amend` and edit your commit message to be in the correct format and save. now push your changes. +If only the last commit is the commit with an error just use `git commit --amend` and edit your commit message to be in the correct format and save. now push your changes. You will require the following information if the commit message with the error is further down the commit tree: - - Commit message SHA1 of your first commit message to the branch `{original_commit}` +- Commit message SHA1 of your first commit message to the branch `{original_commit}` - - Commit message SHA1 prior to your first commit `{source_commit}` +- Commit message SHA1 prior to your first commit `{source_commit}` Run these commands once you have the information above. diff --git a/pages/projects/gitlab-ci/docker_container.md b/pages/projects/gitlab-ci/docker_container.md index b0dbda0..1d4593e 100644 --- a/pages/projects/gitlab-ci/docker_container.md +++ b/pages/projects/gitlab-ci/docker_container.md @@ -29,4 +29,4 @@ about: https://gitlab.com/nofusscomputing/projects/gitlab-ci # GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/config.git" # Must be defined for job to run # JOB_STOP_GITLAB_RELEASE: 'any value' -``` \ No newline at end of file +``` diff --git a/pages/projects/gitlab-ci/git_mirror.md b/pages/projects/gitlab-ci/git_mirror.md index 8dd883b..5501d89 100644 --- a/pages/projects/gitlab-ci/git_mirror.md +++ b/pages/projects/gitlab-ci/git_mirror.md @@ -13,6 +13,7 @@ This job provides the following badge: - None + ## Dependencies - None @@ -48,7 +49,7 @@ Github (Push --mirror): ## Job Workflow - - This job is designed to run on successful completion of the validation tasks and only on the `development` and `master` branches. You can safely override the `rules` when creating the job with your own. i.e. +- This job is designed to run on successful completion of the validation tasks and only on the `development` and `master` branches. You can safely override the `rules` when creating the job with your own. i.e. ``` yaml @@ -70,7 +71,8 @@ This will cause the job to only run on the `development` branch. ## Artifacts - - None +- None + ## License diff --git a/pages/projects/gitlab-ci/gitlab_release.md b/pages/projects/gitlab-ci/gitlab_release.md index c7d5d5d..e7b2320 100644 --- a/pages/projects/gitlab-ci/gitlab_release.md +++ b/pages/projects/gitlab-ci/gitlab_release.md @@ -7,21 +7,21 @@ about: https://gitlab.com/nofusscomputing/projects/gitlab-ci --- -# User Manual +## User Manual All commit messages must be in [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/) and have a footer with a gitlab reference. The reference **must** be either a merge request or a gitlab issue. (format i.e. `!1` or `#2` *using the correct reference number*). -## fixing commit messages (suggestion) +### fixing commit messages (suggestion) -If only the last commit is the commit with an error just use `git commit --amend` and edit your commit message to be in the correct format and save. now push your changes. +If only the last commit is the commit with an error just use `git commit --amend` and edit your commit message to be in the correct format and save. now push your changes. You will require the following information if the commit message with the error is further down the commit tree: - - Commit message SHA1 of your first commit message to the branch `{original_commit}` +- Commit message SHA1 of your first commit message to the branch `{original_commit}` - - Commit message SHA1 prior to your first commit `{source_commit}` +- Commit message SHA1 prior to your first commit `{source_commit}` Run these commands once you have the information above. @@ -52,9 +52,9 @@ Now push your changes upstream. | *Ensure that all of your commits were exported prior to reseting the branch and when re-applying, that all of your commits were applied correctly* | -# Gitlab Release - Developer Manual +## Gitlab Release - Developer Manual -This job bumps the version, updates the changelog, creates a git tag and creates a gitlab release. The git tag and release title use [semantic versioning](https://semver.org/). for this job to function correctly a `.cz.yaml` is required in the root of the repository. this file contains the [commitizen](https://github.com/commitizen-tools/commitizen) config and the version details. +This job bumps the version, updates the changelog, creates a git tag and creates a gitlab release. The git tag and release title use [semantic versioning](https://semver.org/). for this job to function correctly a `.cz.yaml` is required in the root of the repository. this file contains the [commitizen](https://github.com/commitizen-tools/commitizen) config and the version details. This job has the following workflow: @@ -73,11 +73,13 @@ This job provides the following badge: - None -## Dependencies + +### Dependencies - None -## your .gitlab-ci.yml changes + +### your .gitlab-ci.yml changes To use this job add the following to your `.gitlab-ci.yml` file @@ -103,7 +105,7 @@ Gitlab Release: > if you wish to run any commands you can add them to variable `MY_COMMAND`. The custom command will run under shell `/bin/sh`. This command is set to run before the version bump commit is conducted so any changes you wish to add as part of the version bump, you can do here as long as you `git add {changed file name}`. -## CI/CD Variables required +### CI/CD Variables required | var name | Description | |:----:|:----| @@ -111,7 +113,7 @@ Gitlab Release: | CHANGELOG_FOOTER_REFERENCES | ***Optional** If set to `False` the changelog will not output gitlab references for each entry of the changelog. If this variable is set globally, it will also prevent the creation of the CI job to validate a users commits as having gitlab references.* | -## Job Workflow +### Job Workflow This CI job's workflow is: @@ -119,7 +121,7 @@ This CI job's workflow is: 1. commit the changelog to git -1. adds a `git tag` to the changelog commit. +1. adds a `git tag` to the changelog commit. 1. pushes the change back to the repo @@ -130,7 +132,7 @@ This CI job's workflow is: | *If the user has forked the branch, they must keep the development brnach synced with the main repo. If they **don't** the CI job 'commit footer refs' will fail as it will not be able to fetch the parent (`development`) hash of the branch.* | -## Artifacts +### Artifacts - `ci commit footer` > $CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$CI_JOB_NAME.junit.xml @@ -138,7 +140,8 @@ This CI job's workflow is: - `Gitlab Release` > None -## License + +### License To view the license for this folder and any sub-folders, refer [here](https://gitlab.com/nofusscomputing/projects/gitlab-ci) diff --git a/pages/projects/gitlab-ci/markdown_lint.md b/pages/projects/gitlab-ci/markdown_lint.md index ba0750e..f136852 100644 --- a/pages/projects/gitlab-ci/markdown_lint.md +++ b/pages/projects/gitlab-ci/markdown_lint.md @@ -14,11 +14,14 @@ This job provides the following badge: - _None_ + ## Dependencies - **Optional** file `.markdownlint.json` in repository root with any rules you wish to specify + ## your .gitlab-ci.yml changes + To use this job add the following to your `.gitlab-ci.yml` file ``` yaml @@ -35,6 +38,7 @@ Markdown Linting: ``` + ## CI/CD Variables required | var name | Description | @@ -43,15 +47,19 @@ Markdown Linting: | MDLINT_EXCLUDE_PATHS | **optional** Specifies the paths to exclude from linting. Defaults to `"!gitlab-ci"` | | MD_LINT_CONFIG-PATH | **Optional** Specifies a path whenre the lint config file is. defaults to none. this variable enables you to specify a config that will be copied to the project root folder. ***Note:** if specified, the file will be deleted at the end of the linting job.* + ## Job Workflow 1. installs the required job dependencies 1. Lints any markdow file found in `$MDLINT_PATH`, excluding paths `$MDLINT_EXCLUDE_PATHS` + ## Artifacts - JUnit test report located at `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml` + ## License + To view the license for this folder and any sub-folders, refer [here](https://gitlab.com/nofusscomputing/projects/gitlab-ci) diff --git a/pages/projects/gitlab-ci/mkdocs-build.md b/pages/projects/gitlab-ci/mkdocs-build.md index b895877..98f8402 100644 --- a/pages/projects/gitlab-ci/mkdocs-build.md +++ b/pages/projects/gitlab-ci/mkdocs-build.md @@ -45,6 +45,7 @@ MKDocs build: | MKDOCS_INCLUDE_SOURCE | **Optional** Include the build source files in the artifacts. Default is Not set. Any value in this variable, will include the source files. | | MKDOCS_SOURCE_PATH | **Optional, if source files are not to be included** Set to the path where mkdocs uses to build the static html. | + ## Job Workflow 1. install mkdocs @@ -64,6 +65,7 @@ MKDocs build: - files in `"$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"` + ## License To view the license for this folder and any sub-folders, refer [here](https://gitlab.com/nofusscomputing/projects/gitlab-ci) diff --git a/pages/projects/gitlab-ci/python.md b/pages/projects/gitlab-ci/python.md index 5999ab1..e7593df 100644 --- a/pages/projects/gitlab-ci/python.md +++ b/pages/projects/gitlab-ci/python.md @@ -60,7 +60,9 @@ artifacts/validation/tests/gl-code-quality-report.html - None + ## your .gitlab-ci.yml changes + To add the `PyLint` job, add the following to your `.gitlab-ci.yml` file ``` yaml @@ -92,14 +94,17 @@ PyLint: ## Job Workflow - - This job will lint any yaml file in the specified directory using the specified rules. +- This job will lint any yaml file in the specified directory using the specified rules. ## Artifacts - - `$CI_PROJECT_DIR/artifacts` - Root artifact directory - - `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/gl-code-quality-report.json` - Gitlab code quality report (displays in merge request) - - `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/gl-code-quality-report.html` - html code quality report +- `$CI_PROJECT_DIR/artifacts` - Root artifact directory + +- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/gl-code-quality-report.json` - Gitlab code quality report (displays in merge request) + +- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/gl-code-quality-report.html` - html code quality report + ## License diff --git a/pages/projects/gitlab-ci/yaml_lint.md b/pages/projects/gitlab-ci/yaml_lint.md index 07cca96..6b87f63 100644 --- a/pages/projects/gitlab-ci/yaml_lint.md +++ b/pages/projects/gitlab-ci/yaml_lint.md @@ -12,6 +12,7 @@ This job provides the following badge: - None + ## Dependencies - None @@ -52,14 +53,16 @@ Yaml Lint (python 3.6): ## Job Workflow - - This job will lint any yaml file in the specified directory using the specified rules. +- This job will lint any yaml file in the specified directory using the specified rules. ## Artifacts - - `$CI_PROJECT_DIR/artifacts` - Root artifact directory - - `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$PYTHON_VERSION-yaml-lint.junit.xml` - JUnit Test report - - `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-yaml-lint.log` - Linter log +- `$CI_PROJECT_DIR/artifacts` - Root artifact directory + +- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$PYTHON_VERSION-yaml-lint.junit.xml` - JUnit Test report + +- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-yaml-lint.log` - Linter log ## License diff --git a/template/website.gitlab-ci.yaml b/template/website.gitlab-ci.yaml index 872741c..d497f36 100644 --- a/template/website.gitlab-ci.yaml +++ b/template/website.gitlab-ci.yaml @@ -28,7 +28,7 @@ pages: url: $CI_PAGES_URL/projects/gitlab-ci/ artifacts: paths: - - public + - public rules: - if: '$JOB_STOP_GITLAB_PAGES' when: never