mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-12-09 14:39:41 +08:00
add codespell
This commit is contained in:
3
.codespellrc
Normal file
3
.codespellrc
Normal file
@@ -0,0 +1,3 @@
|
||||
[codespell]
|
||||
skip = build,*.drawio,*.svg,*.pdf
|
||||
write-changes = true
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -41,4 +41,6 @@ docs/doxygen_sqlite3.db
|
||||
.settings
|
||||
|
||||
# MacOS directory files
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
|
||||
docs/_build/
|
||||
@@ -1,4 +1,5 @@
|
||||
stages:
|
||||
- check
|
||||
- build
|
||||
- deploy
|
||||
|
||||
@@ -83,6 +84,9 @@ push_master_to_github:
|
||||
# and then pushes that ref to a corresponding github branch
|
||||
- eval $(git for-each-ref --shell bash --format 'if [ $CI_COMMIT_SHA == %(objectname) ]; then git checkout -B %(refname:strip=3); git push --follow-tags github %(refname:strip=3); fi;' $GITHUB_PUSH_REFS)
|
||||
|
||||
include:
|
||||
- local: tools/ci/pre_commit.yml
|
||||
|
||||
build_docs:
|
||||
stage: build
|
||||
image: $ESP_IDF_DOC_ENV_IMAGE
|
||||
|
||||
6
.pre-commit-config.yaml
Normal file
6
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
repos:
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.4.1
|
||||
hooks:
|
||||
- id: codespell
|
||||
args: [--config=.codespellrc]
|
||||
26
tools/ci/pre_commit.yml
Normal file
26
tools/ci/pre_commit.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
.check_pre_commit_template:
|
||||
stage: check # or "pre-check", depending on your pipeline structure
|
||||
image: python:3.8
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" # Run this job only for merge request pipelines.
|
||||
script:
|
||||
- pip install pre-commit
|
||||
- git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME --depth=1 # Fetch target branch latest commit
|
||||
- git fetch origin $CI_COMMIT_REF_NAME --depth=1 # Fetch source branch latest commit
|
||||
- |
|
||||
echo "Target branch: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
|
||||
echo "Source branch: $CI_COMMIT_REF_NAME"
|
||||
|
||||
MODIFIED_FILES=$(git diff --name-only origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME..origin/$CI_COMMIT_REF_NAME)
|
||||
echo "Modified files to check:"
|
||||
echo "$MODIFIED_FILES"
|
||||
|
||||
if [ -n "$MODIFIED_FILES" ]; then
|
||||
CI=true pre-commit run --files $MODIFIED_FILES
|
||||
else
|
||||
echo "No modified files to check."
|
||||
fi
|
||||
|
||||
check_pre_commit:
|
||||
extends:
|
||||
- .check_pre_commit_template # All configured pre-commit hooks will run under this job
|
||||
Reference in New Issue
Block a user