diff --git a/.checkpatch.conf b/.checkpatch.conf new file mode 100644 index 0000000..d5fe098 --- /dev/null +++ b/.checkpatch.conf @@ -0,0 +1,5 @@ +--no-tree +--ignore FILE_PATH_CHANGES +--ignore GERRIT_CHANGE_ID +--ignore GIT_COMMIT_ID +--ignore SPDX_LICENSE_TAG diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e966104..c5426b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,15 @@ jobs: name: checkpatch review runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Info + run: | + echo "Repository: $GITHUB_REPOSITORY" + echo "Workspace: $GITHUB_WORKSPACE" + pwd + ls -la `pwd` - name: Run checkpatch review uses: webispy/checkpatch-action@master env: diff --git a/README.md b/README.md index 57bb1c4..6df33be 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,11 @@ jobs: name: checkpatch review runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Run checkpatch review - uses: webispy/checkpatch-action@master + uses: webispy/checkpatch-action@v9 ``` For using a custom checkpatch script, pass the `CHECKPATCH_COMMAND` environment @@ -46,15 +48,18 @@ jobs: name: checkpatch review runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Run DPDK checkpatches.sh review - uses: webispy/checkpatch-action@master + uses: webispy/checkpatch-action@v9 env: DPDK_CHECKPATCH_PATH: /usr/bin/checkpatch.pl CHECKPATCH_COMMAND: ./devtools/checkpatches.sh ``` **Note:** For **private repositories** this action needs access to the `GITHUB_TOKEN`. It needs read access to `contents` and `pull-requests` as minimum permissions. For example: + ```yml name: checkpatch review on: [pull_request] @@ -66,9 +71,11 @@ jobs: contents: read pull-requests: read steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Run checkpatch review - uses: webispy/checkpatch-action@master + uses: webispy/checkpatch-action@v9 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} ``` @@ -77,11 +84,11 @@ jobs: The `checkpatch.pl` tool supports a configuration file for setting options. Just create a `.checkpatch.conf` file in the top-level directory of your project and specify options in it. -https://docs.kernel.org/dev-tools/checkpatch.html#type-descriptions + #### Example for `.checkpatch.conf` file -``` +```text # This isn't actually a Linux kernel tree --no-tree @@ -104,8 +111,8 @@ https://docs.kernel.org/dev-tools/checkpatch.html#type-descriptions Following files are used to this project. -- https://raw.githubusercontent.com/torvalds/linux/master/scripts/checkpatch.pl -- https://raw.githubusercontent.com/torvalds/linux/master/scripts/spelling.txt +- +- ### Patch @@ -113,11 +120,11 @@ Following files are used to this project. From [zephyr](https://github.com/zephyrproject-rtos/zephyr) project: -- https://github.com/zephyrproject-rtos/zephyr/commit/92a12a19ae5ac5fdf441c690c48eed0052df326d +- #### Disable warning for "No structs that should be const ..." -- https://github.com/nugulinux/docker-devenv/blob/bionic/patches/0002-ignore_const_struct_warning.patch +- ### Docker image diff --git a/entrypoint.sh b/entrypoint.sh index 9e2ffe1..c41524f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,7 +13,7 @@ echo "REF: $GITHUB_REF" echo "HEAD-REF: $GITHUB_HEAD_REF" echo "BASE-REF: $GITHUB_BASE_REF" pwd -ls -l `pwd` +ls -la `pwd` id # Add safe directory option for github workspace to disable fatal error diff --git a/review.sh b/review.sh index f4c13d1..adbdb0d 100755 --- a/review.sh +++ b/review.sh @@ -57,7 +57,7 @@ do # The row is started with "#" if [[ "$row" =~ ^\# ]]; then - # Split the string using ':' seperator + # Split the string using ':' separator IFS=':' read -r -a list <<< "$row" # Get file-name after removing spaces.