https://github.com/sgammon/codeclimate-protobuf
protoc-gen-lint support for CodeClimate
https://github.com/sgammon/codeclimate-protobuf
codeclimate linter protobuf protoc protocol-buffers
Last synced: 6 months ago
JSON representation
protoc-gen-lint support for CodeClimate
- Host: GitHub
- URL: https://github.com/sgammon/codeclimate-protobuf
- Owner: sgammon
- License: mit
- Created: 2017-09-18T04:03:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-10-17T20:24:01.000Z (about 2 years ago)
- Last Synced: 2025-02-10T15:50:31.426Z (11 months ago)
- Topics: codeclimate, linter, protobuf, protoc, protocol-buffers
- Language: Python
- Size: 24.3 MB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# protolint [](https://circleci.com/gh/sgammon/codeclimate-protobuf/tree/master) [](https://travis-ci.org/sgammon/codeclimate-protobuf) [](https://codeclimate.com/github/sgammon/codeclimate-protobuf) [](https://codeclimate.com/github/sgammon/codeclimate-protobuf/coverage) [](https://codeclimate.com/github/sgammon/codeclimate-protobuf)
## support for `protobuf` in CodeClimate
- Latest Release: `v1.1.4`
- `protoc` Version: `v3.4.1`
This tool wraps `protoc-gen-lint` to generate improvement suggestions for your `.proto`s. It then outputs those items in CodeClimate's JSON format, so it can be used as a [CodeClimate Engine](http://blog.codeclimate.com/blog/2015/07/07/build-your-own-codeclimate-engine/).
### Configuration
There is a custom configuration entry - `protopaths` - that lets you specify `-I`/`--protos_path=` flags to the `protoc` compiler. If your `.proto` files use `import "...";` directives, you probably need this. Here's how you do it:
```yaml
engines:
protolint:
enabled: true
config:
protopaths:
- sources/models/pathone
- sources/models/pathtwo
```
### How it works
It's a Python module called `protolint`, with a module-level run file (`__main__.py`). It can be executed via any of the following methods:
Via the local bash script:
```bash
./protolint.sh
```
Via the virtualenv:
```bash
./activate && protolint
```
After installing globally, you can additionally execute it via:
Global module in Python:
```bash
python -m protolint
```
CLI tool:
```bash
protolint
```
The tool should output messages to `stderr` and JSON-formatted issues to `stdout`.