最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Astyle --recursive option doesn't work in some cases - Stack Overflow

programmeradmin1浏览0评论

When running Astyle version 3.1 and latest version 3.6.6 with --recursive option and wildcards like this:

astyle --recursive "*.cpp" "*.c" "*.h" --style=allman --indent=spaces=4 --max-continuation-indent=120 --indent-switches --suffix=none --indent-modifiers --keep-one-line-blocks --align-pointer=name --pad-comma --pad-oper --break-one-line-headers --attach-closing-while --verbose --options="%curpath%\AStyleOptionsFile_%MainProjectFolder%" --ignore-exclude-errors

I get this failed output:

Executing Astistic-Style Bash Script via Windows Batch Script...
TWK_GEN2
C:\Users\Novodes12\Documents\TWK_GEN2
Artistic Style 3.1                                 1/29/2025
Default option file  C:\Users\Novodes12\Documents\TWK_GEN2\AStyleOptionsFile_TWK_GEN2
------------------------------------------------------------
Directory  C:\Users\Novodes12\Documents\TWK_GEN2\*.cpp
Exclude (unmatched)  PNG_RTX_FUSA_RTOS
Exclude (unmatched)  PNG_3RD_Middlewares
Exclude (unmatched)  PNG_STM32WBxx_HAL_Drivers
Exclude (unmatched)  CpuHwInit
Exclude (unmatched)  RTE
Exclude (unmatched)  GoogleTest
No file to process *.cpp
Artistic Style has terminated
--------------------------------------------------------------------

It seems that it is not going recursively through all the folders. Even though the folders and files exist and are there and even the one to be excluded are there!

I am part of a team of five and we all run Astyle on the same repository with the same script. For all four of them it works fine and for me it doesn't. For comparison, here is a successful output with the same command on the same project in the same folder but on my colleague's PC:

Executing Astistic-Style Bash Script via Windows Batch Script...
TWK_GEN2
C:\Users\gerbe\Documents\TWK_GEN2
Artistic Style 3.1                                29/01/2025
Default option file  C:\Users\gerbe\Documents\TWK_GEN2\AStyleOptionsFile_TWK_GEN2
------------------------------------------------------------
Directory  C:\Users\gerbe\Documents\TWK_GEN2\*.cpp
Exclude  PNG_3RD_Middlewares
Exclude  PNG_RTX_FUSA_RTOS
Exclude  PNG_STM32WBxx_HAL_Drivers
Exclude  PNG_ND_Middleware\UnitTests_App\GoogleTest
Exclude  Project\CpuHwInit
Exclude  Project\Application\RTE
Exclude  Project\BootLoader\RTE
Exclude  Project\VisualGDB\App_Twk2_STM32WB5MMGH6TR\RTE
Exclude  Project\VisualGDB\App_Twk2_STM32WB5MMGH6TR\VisualGDB\Debug\RTE
Exclude  Project\VisualGDB\App_Twk2_STM32WB5MMGH6TR\VisualGDB\Debug\_2_\CpuHwInit
Exclude  Project\VisualGDB\App_Twk2_STM32WB5MMGH6TR\VisualGDB\Debug\_3_\PNG_3RD_Middlewares
Exclude  Project\VisualGDB\App_Twk2_STM32WB5MMGH6TR\VisualGDB\Debug\_3_\PNG_RTX_FUSA_RTOS
Exclude  Project\VisualGDB\App_Twk2_STM32WB5MMGH6TR\VisualGDB\Debug\_3_\PNG_STM32WBxx_HAL_Drivers
------------------------------------------------------------
Unchanged  EmbeddedSW-UnitTests\Ate\Src\AdcAte.cpp
Unchanged  EmbeddedSW-UnitTests\Ate\Src\AesAte.cpp
Unchanged  EmbeddedSW-UnitTests\Ate\Src\AlarmsAte.cpp
Unchanged  EmbeddedSW-UnitTests\Ate\Src\BleAte.cpp
Unchanged  EmbeddedSW-UnitTests\Ate\Src\BuzzerAte.cpp
Unchanged  EmbeddedSW-UnitTests\Ate\Src\I2cAte.cpp
Unchanged  EmbeddedSW-UnitTests\Ate\Src\LedsAte.cpp 

and it goes on and on for hundreds of files of types cpp, c and h and multiple folders.

I have Windows 11 and so do my colleagues. I tried running the command from cmd, bash, and git-bash to no avail. I even tried running it from cmd as an administrator to no avail. In all cases I had the same unsuccessful run of Astyle as I wrote in the beginning.

Any help would be appreciated.

发布评论

评论列表(0)

  1. 暂无评论