-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.protolint.yaml
156 lines (137 loc) · 5.24 KB
/
.protolint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
---
# Lint directives.
lint:
# Linter rules.
# Run `protolint list` to see all available rules.
rules:
# Set the default to all linters. This option works the other way around as no_default does.
# If you want to enable this option, delete the comment out below and no_default.
all_default: true
# # The specific linters to add.
# add:
# - FIELD_NAMES_LOWER_SNAKE_CASE
# - MESSAGE_NAMES_UPPER_CAMEL_CASE
# - MAX_LINE_LENGTH
# - INDENT
# - SERVICE_NAMES_END_WITH
# - FIELD_NAMES_EXCLUDE_PREPOSITIONS
# - MESSAGE_NAMES_EXCLUDE_PREPOSITIONS
# - FILE_NAMES_LOWER_SNAKE_CASE
# - IMPORTS_SORTED
# - PACKAGE_NAME_LOWER_CASE
# - ORDER
# - MESSAGES_HAVE_COMMENT
# - SERVICES_HAVE_COMMENT
# - RPCS_HAVE_COMMENT
# - FIELDS_HAVE_COMMENT
# - PROTO3_FIELDS_AVOID_REQUIRED
# - PROTO3_GROUPS_AVOID
# - REPEATED_FIELD_NAMES_PLURALIZED
# - ENUMS_HAVE_COMMENT
# - ENUM_FIELDS_HAVE_COMMENT
# - SYNTAX_CONSISTENT
# - RPC_NAMES_CASE
# - FILE_HAS_COMMENT
# - QUOTE_CONSISTENT
# # The specific linters to remove.
remove:
- RPC_REQUEST_RESPONSE_UNIQUE
# We should probably turn this back on at some point, but pretty annoying RN
- FIELDS_HAVE_COMMENT
# I never want to turn this back on. Enums values should be self-explanatory
- ENUMS_HAVE_COMMENT
- ENUM_FIELDS_HAVE_COMMENT
# This one doesn't like single word RPCs, which I have no problem with
- RPC_NAMES_CASE
# In practice this creates a lot of meaningless comments, we can trust
# authors to determine when comments will be useful or not
- MESSAGES_HAVE_COMMENT
- RPCS_HAVE_COMMENT
- SERVICES_HAVE_COMMENT
# Linter rules option.
rules_option:
# MAX_LINE_LENGTH rule option.
max_line_length:
# Enforces a maximum line length
max_chars: 150
# Specifies the character count for tab characters
tab_chars: 2
# INDENT rule option.
indent:
# Available styles are 4(4-spaces), 2(2-spaces) or tab.
style: 2
# Specifies if it should stop considering and inserting new lines at the appropriate positions
# when the inner elements are on the same line. Default is false.
not_insert_newline: true
# FILE_NAMES_LOWER_SNAKE_CASE rule option.
file_names_lower_snake_case:
excludes:
- ../proto/invalidFileName.proto
# QUOTE_CONSISTENT rule option.
quote_consistent:
# Available quote are "double" or "single".
quote: double
# ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH rule option.
enum_field_names_zero_value_end_with:
suffix: UNSPECIFIED
# SERVICE_NAMES_END_WITH rule option.
service_names_end_with:
text: Api
# FIELD_NAMES_EXCLUDE_PREPOSITIONS rule option.
field_names_exclude_prepositions:
# The specific prepositions to determine if the field name includes.
prepositions:
- for
- at
- of
# The specific keywords including prepositions to ignore. E.g. end_of_support is a term you would like to use, and skip checking.
excludes:
- end_of_support
# REPEATED_FIELD_NAMES_PLURALIZED rule option.
## The spec for each rules follows the implementation of https://github.com/gertd/go-pluralize.
## Plus, you can refer to this rule's test code.
# repeated_field_names_pluralized:
# uncountable_rules:
# - paper
# irregular_rules:
# Irregular: Regular
# MESSAGE_NAMES_EXCLUDE_PREPOSITIONS rule option.
message_names_exclude_prepositions:
# The specific prepositions to determine if the message name includes.
prepositions:
- With
- For
- Of
# RPC_NAMES_CASE rule option.
rpc_names_case:
# The specific convention the name should conforms to.
## Available conventions are "lower_camel_case", "upper_snake_case", or "lower_snake_case".
convention: upper_snake_case
# MESSAGES_HAVE_COMMENT rule option.
messages_have_comment:
# Comments need to begin with the name of the thing being described. default is false.
should_follow_golang_style: false
# SERVICES_HAVE_COMMENT rule option.
services_have_comment:
# Comments need to begin with the name of the thing being described. default is false.
should_follow_golang_style: false
# RPCS_HAVE_COMMENT rule option.
rpcs_have_comment:
# Comments need to begin with the name of the thing being described. default is false.
should_follow_golang_style: false
# FIELDS_HAVE_COMMENT rule option.
fields_have_comment:
# Comments need to begin with the name of the thing being described. default is false.
should_follow_golang_style: false
# ENUMS_HAVE_COMMENT rule option.
enums_have_comment:
# Comments need to begin with the name of the thing being described. default is false.
should_follow_golang_style: false
# ENUM_FIELDS_HAVE_COMMENT rule option.
enum_fields_have_comment:
# Comments need to begin with the name of the thing being described. default is false.
should_follow_golang_style: false
# SYNTAX_CONSISTENT rule option.
syntax_consistent:
# Default is proto3.
version: proto3