Skip to content

Commit

Permalink
feat(c): add cpplint (#21816)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongbo-miao authored Dec 22, 2024
1 parent ff0783c commit 4313757
Show file tree
Hide file tree
Showing 26 changed files with 312 additions and 237 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trim_trailing_whitespace = true
indent_size = 4
indent_style = space

[{*.c,*.cpp,*.h,*.ino}]
[{*.c,*.cpp,*.cu,*.cuh,*.h,*.hpp,*.ino}]
indent_size = 2
indent_style = space

Expand Down
47 changes: 38 additions & 9 deletions .github/workflows/.lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ jobs:
- '**/*.c'
- '**/*.cpp'
- '**/*.cu'
- '**/*.cuh'
- '**/*.h'
- '**/*.hpp'
- '**/*.ino'
cmake:
- '.github/workflows/.lint.yml'
Expand Down Expand Up @@ -136,10 +138,13 @@ jobs:
- '**/*.cpp'
- '**/*.cs'
- '**/*.csproj'
- '**/*.cu'
- '**/*.cuh'
- '**/*.dbc'
- '**/*.go'
- '**/*.gradle'
- '**/*.h'
- '**/*.hpp'
- '**/*.ino'
- '**/*.ipynb'
- '**/*.java'
Expand Down Expand Up @@ -315,7 +320,7 @@ jobs:
- name: Install uv
uses: astral-sh/[email protected]
with:
version: 0.5.9
version: 0.5.11
enable-cache: true
cache-dependency-glob: uv.lock
- name: Set up Python
Expand Down Expand Up @@ -377,13 +382,37 @@ jobs:
steps:
- name: Checkout
uses: actions/[email protected]
- name: Lint C, C++
- name: Lint C, C++ (ClangFormat)
uses: DoozyX/[email protected]
with:
source: .
extensions: c,cpp,cu,h,ino
extensions: c,cpp,cu,cuh,h,hpp,ino
clangFormatVersion: 18
style: file
- name: Install uv
uses: astral-sh/[email protected]
with:
version: 0.5.11
enable-cache: true
cache-dependency-glob: uv.lock
- name: Set up Python
uses: actions/[email protected]
with:
python-version-file: pyproject.toml
- name: Install dependencies
run: |
uv sync --dev
- name: Lint C, C++ (cpplint)
run: |
uv run poe lint-c-cpp-cpplint --repository=asterios/led-blinker --extensions=c,h --recursive asterios/led-blinker
uv run poe lint-c-cpp-cpplint --repository=embedded/freertos --extensions=ino --recursive embedded/freertos
uv run poe lint-c-cpp-cpplint --repository=hm-kafka/kafka-client/kafka-c/avro-producer --extensions=c,h --recursive hm-kafka/kafka-client/kafka-c/avro-producer
uv run poe lint-c-cpp-cpplint --repository=matlab/call-c-function-in-matlab --extensions=c,h --recursive matlab/call-c-function-in-matlab
uv run poe lint-c-cpp-cpplint --repository=matlab/call-c-function-in-matlab --extensions=c,h --recursive matlab/call-c-function-in-matlab
uv run poe lint-c-cpp-cpplint --repository=parallel-computing/cuda --extensions=cu,cuh --recursive parallel-computing/cuda
uv run poe lint-c-cpp-cpplint --repository=reverse-engineering/hello-c --extensions=c,h --recursive reverse-engineering/hello-c
uv run poe lint-c-cpp-cpplint --repository=reverse-engineering/hello-cpp --extensions=cpp,hpp --recursive reverse-engineering/hello-cpp
uv run poe lint-c-cpp-cpplint --repository=robotics/robot-operating-system/src/hm_cpp_package --extensions=cpp,hpp --recursive robotics/robot-operating-system
lint-cmake:
name: CMake
Expand All @@ -398,7 +427,7 @@ jobs:
- name: Install uv
uses: astral-sh/[email protected]
with:
version: 0.5.9
version: 0.5.11
enable-cache: true
cache-dependency-glob: uv.lock
- name: Set up Python
Expand Down Expand Up @@ -764,7 +793,7 @@ jobs:
- name: Install uv
uses: astral-sh/[email protected]
with:
version: 0.5.9
version: 0.5.11
enable-cache: true
cache-dependency-glob: uv.lock
- name: Set up Python
Expand Down Expand Up @@ -834,7 +863,7 @@ jobs:
- name: Install uv
uses: astral-sh/[email protected]
with:
version: 0.5.9
version: 0.5.11
enable-cache: true
cache-dependency-glob: uv.lock
- name: Set up Python
Expand Down Expand Up @@ -1347,7 +1376,7 @@ jobs:
- name: Install uv
uses: astral-sh/[email protected]
with:
version: 0.5.9
version: 0.5.11
enable-cache: true
cache-dependency-glob: uv.lock
- name: Set up Python
Expand Down Expand Up @@ -1425,7 +1454,7 @@ jobs:
- name: Install uv
uses: astral-sh/[email protected]
with:
version: 0.5.9
version: 0.5.11
enable-cache: true
cache-dependency-glob: uv.lock
- name: Set up Python
Expand Down Expand Up @@ -1475,7 +1504,7 @@ jobs:
- name: Install uv
uses: astral-sh/[email protected]
with:
version: 0.5.9
version: 0.5.11
enable-cache: true
cache-dependency-glob: uv.lock
- name: Set up Python
Expand Down
Loading

0 comments on commit 4313757

Please sign in to comment.