Loading .gitlab-ci.yml +3 −6 Changes for .gitlab-ci.yml: 3 added lines, 6 removed lines. Original line number Diff line number Diff line include: - local: templates/commits.yml - component: gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commits@2.0.0 inputs: stage: prepare stages: - development Loading Loading @@ -155,11 +157,6 @@ codestyle: - if: $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "web" || $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH when: on_success commits: stage: prepare extends: - .commits lint: stage: prepare image: registry.gitlab.com/radiandevcore/tools/gitlab-projects-settings/gitlab-projects-settings:codestyle Loading templates/commits.ymldeleted 100644 → 0 +0 −73 Changes for templates/commits.yml: 0 added lines, 73 removed lines. Original line number Diff line number Diff line .commits: image: registry.gitlab.com/radiandevcore/tools/gitlab-projects-settings/gitlab-projects-settings:codestyle needs: [] before_script: # Check system context - git cz version -r # Show commits documentation - | ( set +x echo ' ' for hint in 'example:33' 'info:36' 'schema:32'; do command="${hint%%:*}" color="${hint##*:}" echo '---' echo "git cz ${command}:" echo -e "\033[1;${color}m" git cz "${command}" | sed 's#^$# #g' echo -e '\033[0m ' done echo '---' ) script: # Detect commits range - set +x - remote=$(git remote -v | grep '(fetch)' | awk '{print $1}' | head -n1) - none_sha='0000000000000000000000000000000000000000' - head_sha=$(git rev-parse "${CI_COMMIT_SHA:-HEAD}") - | if [ ! -z "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-}" ]; then git fetch "${remote}" "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}" || true base_sha=$(git rev-parse "${remote}/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}") base_branch=$(git rev-parse --abbrev-ref "${remote}/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}") elif [ ! -z "${CI_LOCAL:-}" ]; then base_sha=$(git rev-parse "${remote}/HEAD") base_branch=$(git rev-parse --abbrev-ref "${remote}/HEAD") elif [ ! "${CI_COMMIT_BEFORE_SHA:-${none_sha}}" = "${none_sha}" ] && git cat-file -e "${CI_COMMIT_BEFORE_SHA}" 2>/dev/null; then base_sha="${CI_COMMIT_BEFORE_SHA}" base_branch="${CI_COMMIT_REF_NAME:-}" else base_sha=$(git rev-parse 'HEAD~1') base_branch=$(git rev-parse --abbrev-ref 'HEAD') fi # Validate commits range - | set +x echo ' ' echo '---' echo -e "\033[0m\033[1mINFO: Commitizen checks from \033[1m'\033[1;36m${base_sha:0:8}\033[0m\033[1m' (\033[1;33m${base_branch}\033[0m\033[1m) to '\033[1;36m${head_sha:0:8}\033[0m\033[1m' (\033[1;33mHEAD\033[0m\033[1m)\033[0m" echo ' ' git log --pretty=oneline --abbrev-commit "${base_sha}..${head_sha}" | sed "s#^\([^ ]*\) #$(printf '\033[1;33m')\1$(printf '\033[0m') #g" echo ' ' set -x git cz --no-raise 3 check --rev-range "${base_sha}..${head_sha}" # Validate pre-commit checks - | set +x echo '' skip=$(grep 'id: local-gcil-' .pre-commit-config.yaml | sed 's/.* id: //g' | tr '\n' ',' | sed 's/,$//g') set -x pre-commit install --install-hooks SKIP="${skip}" pre-commit run --all-files --show-diff-on-failure # Validate WIP commits - | set +x if git log --pretty='%s' "${base_sha}..${head_sha}" | grep -i '^WIP'; then echo ' ' echo " [ERROR] Detected WIP commits in range '${base_sha}..${head_sha}'" echo ' ' false fi rules: - when: always Loading
.gitlab-ci.yml +3 −6 Changes for .gitlab-ci.yml: 3 added lines, 6 removed lines. Original line number Diff line number Diff line include: - local: templates/commits.yml - component: gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commits@2.0.0 inputs: stage: prepare stages: - development Loading Loading @@ -155,11 +157,6 @@ codestyle: - if: $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "web" || $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH when: on_success commits: stage: prepare extends: - .commits lint: stage: prepare image: registry.gitlab.com/radiandevcore/tools/gitlab-projects-settings/gitlab-projects-settings:codestyle Loading
templates/commits.ymldeleted 100644 → 0 +0 −73 Changes for templates/commits.yml: 0 added lines, 73 removed lines. Original line number Diff line number Diff line .commits: image: registry.gitlab.com/radiandevcore/tools/gitlab-projects-settings/gitlab-projects-settings:codestyle needs: [] before_script: # Check system context - git cz version -r # Show commits documentation - | ( set +x echo ' ' for hint in 'example:33' 'info:36' 'schema:32'; do command="${hint%%:*}" color="${hint##*:}" echo '---' echo "git cz ${command}:" echo -e "\033[1;${color}m" git cz "${command}" | sed 's#^$# #g' echo -e '\033[0m ' done echo '---' ) script: # Detect commits range - set +x - remote=$(git remote -v | grep '(fetch)' | awk '{print $1}' | head -n1) - none_sha='0000000000000000000000000000000000000000' - head_sha=$(git rev-parse "${CI_COMMIT_SHA:-HEAD}") - | if [ ! -z "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-}" ]; then git fetch "${remote}" "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}" || true base_sha=$(git rev-parse "${remote}/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}") base_branch=$(git rev-parse --abbrev-ref "${remote}/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}") elif [ ! -z "${CI_LOCAL:-}" ]; then base_sha=$(git rev-parse "${remote}/HEAD") base_branch=$(git rev-parse --abbrev-ref "${remote}/HEAD") elif [ ! "${CI_COMMIT_BEFORE_SHA:-${none_sha}}" = "${none_sha}" ] && git cat-file -e "${CI_COMMIT_BEFORE_SHA}" 2>/dev/null; then base_sha="${CI_COMMIT_BEFORE_SHA}" base_branch="${CI_COMMIT_REF_NAME:-}" else base_sha=$(git rev-parse 'HEAD~1') base_branch=$(git rev-parse --abbrev-ref 'HEAD') fi # Validate commits range - | set +x echo ' ' echo '---' echo -e "\033[0m\033[1mINFO: Commitizen checks from \033[1m'\033[1;36m${base_sha:0:8}\033[0m\033[1m' (\033[1;33m${base_branch}\033[0m\033[1m) to '\033[1;36m${head_sha:0:8}\033[0m\033[1m' (\033[1;33mHEAD\033[0m\033[1m)\033[0m" echo ' ' git log --pretty=oneline --abbrev-commit "${base_sha}..${head_sha}" | sed "s#^\([^ ]*\) #$(printf '\033[1;33m')\1$(printf '\033[0m') #g" echo ' ' set -x git cz --no-raise 3 check --rev-range "${base_sha}..${head_sha}" # Validate pre-commit checks - | set +x echo '' skip=$(grep 'id: local-gcil-' .pre-commit-config.yaml | sed 's/.* id: //g' | tr '\n' ',' | sed 's/,$//g') set -x pre-commit install --install-hooks SKIP="${skip}" pre-commit run --all-files --show-diff-on-failure # Validate WIP commits - | set +x if git log --pretty='%s' "${base_sha}..${head_sha}" | grep -i '^WIP'; then echo ' ' echo " [ERROR] Detected WIP commits in range '${base_sha}..${head_sha}'" echo ' ' false fi rules: - when: always