Skip to content

protostyle - protolint plugin for lint your team style

License

Notifications You must be signed in to change notification settings

ci-space/protostyle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

protostyle

license

protostyle - protolint plugin for lint team style

Usage

GitHub Actions

Use protolint-action, contained protostyle

jobs:
  protolint:
    name: protolint
    runs-on: ubuntu-latest
    steps:
      - name: Check out code
        uses: actions/checkout@v3

      - name: Run linter
        uses: ci-space/protolint-action@master

Locally

Download

🐧 Linux AMD64

Download archive and extract protostyle

curl -L https://github.com/ci-space/protostyle/releases/download/v0.1.0/protostyle-linux-amd64.zip -o protostyle.zip && \
  unzip protostyle.zip protostyle
🐧 Linux ARM64

Download archive and extract protostyle

curl -L https://github.com/ci-space/protostyle/releases/download/v0.1.0/protostyle-linux-arm64.zip -o protostyle.zip && \
  unzip protostyle.zip protostyle
🍏 Apple

Download archive and extract protostyle

curl -L https://github.com/ci-space/protostyle/releases/download/v0.1.0/protostyle-darwin-amd64.zip -o protostyle.zip && \
  unzip protostyle.zip protostyle
🍏 Apple M*

Download archive and extract protostyle

curl -L https://github.com/ci-space/protostyle/releases/download/v0.1.0/protostyle-darwin-arm64.zip -o protostyle.zip && \
  unzip protostyle.zip protostyle

Run

Run protolint with protostyle:

protolint lint -plugin ./protostyle .

Rules

Rule Fixable Description
PROTOSTYLE_LIST_MESSAGES_RESOURCE_NAME_PLURALIZED List request/response must have pluralized resource name
PROTOSTYLE_RPC_WITH_HTTP - Method must have http option
PROTOSTYLE_RPC_WITHOUT_RESOURCE_NAME Method must not contain resource name
PROTOSTYLE_FIELD_WITH_BEHAVIOR - Field must have behavior option (google.api.field_behavior)
PROTOSTYLE_ENUM_IN_FILE_END - Enum must be in file end
PROTOSTYLE_COMMENT_ENDS_DOT The comment must end with a dot