Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/core/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ var FormatByExtension = map[string][]string{
`\.(?:dita)$`: {".dita", "markup"},
`\.(?:org)$`: {".org", "markup"},
`\.(?:jl)$`: {".jl", "code"},
`\.(?:proto)$`: {".c", "code"},
}

// FormatFromExt takes a file extension and returns its [normExt, format]
Expand Down
9 changes: 9 additions & 0 deletions testdata/features/lint.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ Feature: Lint
test.jl:47:3:vale.Annotations:'XXX' left in text
"""

Scenario: Lint a proto file
When I lint "test.proto"
Then the output should contain exactly:
"""
test.proto:13:6:vale.Annotations:'NOTE' left in text
test.proto:22:4:vale.Annotations:'XXX' left in text
test.proto:31:1:vale.Annotations:'NOTE' left in text
"""

Scenario: Lint an Org file
When I lint "test.org"
Then the output should contain exactly:
Expand Down
41 changes: 41 additions & 0 deletions testdata/fixtures/formats/test.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
syntax = "proto3";

package foo.bar.v1;

import "google/api/annotations.proto";

option java_package = "com.company.foo.bar.v1";
option java_outer_classname = "ApiProtoXXX";


// The foo service
service FooService {
// NOTE: this is a RPC comment
rpc GetBar(GetBarRequest) returns (GetBarResponse) {
option (google.api.http) = {
get: "/v1/{name=bars/*}"
};
option (google.api.method_signature) = "name";
}
}

/* XXX: this is also a comment */
message GetBarRequest {
// Note: Field comment inside a message.
string name = 1;
}

/*
Comment.

NOTE: I am a multilinek comment, so I span
over multiple lines
*/
message GetBarResponse {
string todo = 1;
}

// The following should not get matched
message XXX {

}