Code Monkey home page Code Monkey logo

proto-lint-maven-plugin's Introduction

proto-lint-maven-plugin

Travis CI codecov

A maven linter plugin for gRPC .proto files.

This plug-in will check your project's .proto files for violations of Google's Protocol Buffer Style Guide. By using this plug-in you are able to retrieve those compilation errors which are not reported by the protobuf compiler:

  • Message and field names
  • Enums
  • Service and RPC names

Usage

Add a plugin declaration to your project's pom file as follows:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>io.github.dimitrovvlado</groupId>
        <artifactId>proto-lint-maven-plugin</artifactId>
        <version>1.0.2</version>
        <executions>
          <execution>
            <goals>
              <goal>lint</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  ...
</project>

The plugin will search recursively for .proto files in the source folder of the module.

Additionally you can configure the path to your .proto files as follows:

<configuration>
  <protoFiles>
    <protoFile>sample.proto</protoFile>
  </protoFiles>
</configuration>

or to a folder:

<configuration>
  <protoDirectory>src/main/proto/</protoDirectory>
</configuration>

Dependencies

This plug-in depends on the following third-party libraries:

  • com.squareup.wire:wire-schema
  • com.squareup.okio:okio
  • com.google.guava:guava

proto-lint-maven-plugin's People

Contributors

dimitrovvlado avatar

Watchers

 avatar  avatar

Forkers

mgtriffid

proto-lint-maven-plugin's Issues

Linter not verifying nested messages

With the current release (1.0.1), nested messages are not being validated. Consider the following snippet:

message SampleMessage {
    message SampleNestedMessage {
        int32 sampleField = 1;
    }
}

The sampleField field is invalid, because it's not in lower underscore case.

Introduce compatibility checker

Compatibility checker should validate whether a new version of a proto file introduces incompatible changes. A valid approach will probably execute a git diff against each proto file.

This validator should be disabled by default.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.