Skip to content

Commit

Permalink
Fix Uncrustify bot command (#46)
Browse files Browse the repository at this point in the history
* Uncrustify bot command fix (#816)

* fix uncrustify run command

* test uncrustify

* Revert "test uncrustify"

This reverts commit f660ab435fa741f8767f8a2849829f02a92ecca6.

* Fix uncrustify bot command - disable install prompt (#819)

* fix uncrustify run command

* test uncrustify

* Revert "test uncrustify"

This reverts commit f660ab435fa741f8767f8a2849829f02a92ecca6.

* removing apt-get prompt while installing git

* Removing deprecated set-output command from uncrustify bot run yml (#820)

* fix uncrustify run command

* test uncrustify

* Revert "test uncrustify"

This reverts commit f660ab435fa741f8767f8a2849829f02a92ecca6.

* removing apt-get prompt while installing git

* removing the deprecated set-output command from uncrustify bot run yml, use latest git

* Update changes

* Fix uncrustify

---------

Co-authored-by: Tony Josi <[email protected]>
  • Loading branch information
moninom1 and tony-josi-aws authored May 11, 2023
1 parent 1bc8947 commit cee2654
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ jobs:

formatting:
runs-on: ubuntu-20.04
container: ubuntu:18.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Uncrustify
run: sudo apt-get install uncrustify=0.69.0+dfsg1-1build1
run: apt-get update && apt-get install uncrustify
- name: Run Uncrustify
run: |
uncrustify --version
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/uncrustify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,48 @@ jobs:
Uncrustify:
name: Run_Uncrustify
if: ${{ github.event.issue.pull_request && github.event.comment.body == '/bot run uncrustify' }}
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
container: ubuntu:18.04
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Install Utils
run: |
apt-get update && apt-get --assume-yes install software-properties-common curl jq sed
add-apt-repository ppa:git-core/ppa
apt-get update && apt-get --assume-yes install git
git --version
- name: get pullrequest url
run: |
echo ${{ github.event.issue.pull_request.url }}
- name: get upstream repo
id: upstreamrepo
run: |
echo "::set-output name=RemoteRepo::$(curl -H "Accept: application/vnd.github.sailor-v-preview+json" --url ${{ github.event.issue.pull_request.url }} | jq '.head.repo.full_name' | sed 's/\"//g')"
echo "RemoteRepo=$(curl -H "Accept: application/vnd.github.sailor-v-preview+json" --url ${{ github.event.issue.pull_request.url }} | jq '.head.repo.full_name' | sed 's/\"//g')" >> $GITHUB_OUTPUT
- name: get upstream branch
id: upstreambranch
run: |
echo "::set-output name=branchname::$(curl -H "Accept: application/vnd.github.sailor-v-preview+json" --url ${{ github.event.issue.pull_request.url }} | jq '.head.ref' | sed 's/\"//g')"
echo "branchname=$(curl -H "Accept: application/vnd.github.sailor-v-preview+json" --url ${{ github.event.issue.pull_request.url }} | jq '.head.ref' | sed 's/\"//g')" >> $GITHUB_OUTPUT
- name: echo upstream repo:branch
run: |
echo ${{ steps.upstreamrepo.outputs.RemoteRepo }}:${{ steps.upstreambranch.outputs.branchname }}
- name: Checkout upstream repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT }}
repository: ${{ steps.upstreamrepo.outputs.RemoteRepo }}
ref: ${{ steps.upstreambranch.outputs.branchname }}
- name: Install Uncrustify
run: sudo apt-get install uncrustify
run: apt-get update && apt-get --assume-yes install uncrustify
- name: Run Uncrustify
run: |
uncrustify --version
find . -iname "*.[hc]" -exec uncrustify -c tools/uncrustify.cfg --no-backup --replace {} +
find . -iname "*.[hc]" -exec uncrustify -c tools/uncrustify.cfg --no-backup --replace {} +
- name: Push changes to upstream repository
run: |
git config --global --add safe.directory '*'
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git add -A
Expand Down
4 changes: 2 additions & 2 deletions ff_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2499,7 +2499,7 @@ int32_t FF_PutC( FF_FILE * pxFile,
FF_Error_t xResult;

if( pxFile == NULL )
{ /* Ensure we don't have a Null file pointer on a Public interface. */
{ /* Ensure we don't have a Null file pointer on a Public interface. */
xResult = FF_ERR_NULL_POINTER | FF_PUTC;
}
else if( ( pxFile->ucMode & FF_MODE_WRITE ) == 0 )
Expand Down Expand Up @@ -3163,7 +3163,7 @@ FF_Error_t FF_Close( FF_FILE * pxFile )

/* Handle Linked list! */
FF_PendSemaphore( pxFile->pxIOManager->pvSemaphore );
{ /* Semaphore is required, or linked list could become corrupted. */
{ /* Semaphore is required, or linked list could become corrupted. */
pxFileChain = ( FF_FILE * ) pxFile->pxIOManager->FirstFile;

if( pxFileChain == pxFile )
Expand Down
4 changes: 2 additions & 2 deletions ff_ioman.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ int32_t FF_BlockWrite( FF_IOManager_t * pxIOManager,
if( ( slRetVal == 0ul ) && ( pxIOManager->xBlkDevice.fnpWriteBlocks != NULL ) )
{
do
{ /* Make sure we don't execute a NULL. */
{ /* Make sure we don't execute a NULL. */
if( ( xSemLocked == pdFALSE ) &&
( ( pxIOManager->ucFlags & FF_IOMAN_BLOCK_DEVICE_IS_REENTRANT ) == pdFALSE ) )
{
Expand Down Expand Up @@ -1518,7 +1518,7 @@ FF_Error_t FF_Mount( FF_Disk_t * pxDisk,
}

if( pxPartition->ulSectorsPerFAT == 0 )
{ /* FAT32 */
{ /* FAT32 */
pxPartition->ulSectorsPerFAT = FF_getLong( pxBuffer->pucBuffer, FF_FAT_32_SECTORS_PER_FAT );
pxPartition->ulRootDirCluster = FF_getLong( pxBuffer->pucBuffer, FF_FAT_ROOT_DIR_CLUSTER );
memcpy( pxPartition->pcVolumeLabel, pxBuffer->pucBuffer + FF_FAT_32_VOL_LABEL, sizeof( pxPartition->pcVolumeLabel ) - 1 );
Expand Down

0 comments on commit cee2654

Please sign in to comment.