Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,44 @@ jobs:
echo -e "${lint_results}" >> $GITHUB_STEP_SUMMARY
fi
continue-on-error: true

protobuf-lint:
name: Lint Protobuf
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: ./.github/actions/setup-go-cache
with:
cache-prefix: protobuf-lint

- name: Lint using clang-format 17
uses: jidicula/[email protected]
with:
clang-format-version: "17"
fallback-style: Google
exclude-regex: '^proto\/'
include-regex: '^.*\.proto$'
continue-on-error: true

- name: Lint using protolint
uses: plexsystems/[email protected]
with:
configDirectory: "."
continue-on-error: true

- name: Generating Protobuf lint results as summary
if: ${{ always() }}
run: |
protolint lint . > protolint_results.txt || true
protolint_results=$(cat protolint_results.txt)
echo -e "## 🪧 Protolint Lint Results\n" >> $GITHUB_STEP_SUMMARY
if [ -z "$protolint_results" ]; then
echo -e "### No Lint Issues found.\n" >> $GITHUB_STEP_SUMMARY
else
echo -e "### List of Lint Issues \n" >> $GITHUB_STEP_SUMMARY
echo -e "${protolint_results}" >> $GITHUB_STEP_SUMMARY
fi
continue-on-error: true
8 changes: 8 additions & 0 deletions .protolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
lint:
directories:
exclude:
# This list should match protobufFilesToLintExcludeDirectories in magefiles/linting.go
- proto
rules:
remove:
- MAX_LINE_LENGTH # the Clang formatter enforces the line length where possible
Loading