Comments (6)
@bochengyang We already have a disable comment feature. So you can append // protolint:disable:this MAX_LINE_LENGTH
at the end of the target line to skip the check.
from protolint.
@sulume Thank you for your feature request!
It makes sense a lot overall. I understand the need to accept some exceptions.
Do you have any good ideas or references to a specific implementation for that?
I think protolint should conservatively handle the exceptions because it already allows end-users to disable the rule by a line.
At first glance, at least an exception for import paths would be right without any nasty surprises.
[memo] Here is a current implementation.
protolint/internal/addon/rules/maxLineLengthRule.go
Lines 94 to 110 in c99b4b9
from protolint.
Thank you for your quick response.
I think protolint should conservatively handle the exceptions because it already allows end-users to disable the rule by a line.
I'm not really sure how the consistency is maintained, but I think one way is to add another rule option alongside max_chars
and tab_chars
so that users have options on its behavior and existing users would see it working the same by default.
For example,
- a boolean rule option to ignore import lines, and another for URLs
- Separate options may have different default values.
- There would be no single general criteria to decide if a line of URL is not splittable, so it might need a heuristic rule, e.g. a comment line with only a single URL.
- a string rule option to specify a regexp pattern to match lines to ignore their lengths
- This way leaves users some extensibility for arbitrary long ID strings.
from protolint.
so that users have options on its behavior and existing users would see it working the same by default.
That sounds great. Thank you for providing nice examples.
Thanks to those, it's time to implement each exception incrementally.
[memo] I'm thinking of working on them when I finish existing priority issues.
If you need them (asap) before I will assign myself, PRs are always welcome.
from protolint.
Since we can extract each line individually, can we have a regex for extracting annotation, e.g., #protolint:ignore: MAX_LINE_LENGTH
at the end of the original protobuf definition? Once a rule is specified to be ignored, the line length is not a problem.
from protolint.
Great! It saves my day :)
Thanks
from protolint.
Related Issues (20)
- [Reporters] Add ability to use multiple reporters HOT 4
- [Distribution] Add support for C#/VB/F# (.NET Toolchain) HOT 2
- [Distribution] Add support for Python HOT 3
- [Distribution] Add support for Typescript / Javascript
- FILE_NAMES_LOWER_SNAKE_CASE: an issue with dot separated filenames HOT 2
- Bug: Enum Field Prefix check HOT 3
- Minor problem disabling warnings. HOT 3
- Exclude directories via pattern HOT 4
- `INDENT` rule: incorrectly works with multiline comments HOT 1
- Bug: Enum field prefix naming rule HOT 3
- Stray double semi-colon cause erratic results
- protolint npm package isn't available HOT 3
- Error thrown when installing protolint through yarn HOT 1
- Can't read Unix domain socket as a file
- FILE_NAMES_LOWER_SNAKE_CASE fails to convert kebab case to snake case HOT 2
- RPC_NAMES_UPPER_CAMEL_CASE disable is ignored HOT 1
- Some rules do not support auto-disable HOT 5
- Allow exclusion list of field names for `FIELDS_HAVE_COMMENT` HOT 1
- ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH failing even with `allow_alias = true` HOT 1
- CVEs in the latest version HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protolint.