Comments (5)
I made a pull request, see if it looks good
from protolint.
isn't it better to exit with 0 when there's nothing to lint ?
I understand your point. Can you show me some linters that behave so?
For example, eslint that has immense popularity exits with code 0 when it found no files.
Sorry, I misunderstood the current spec opposite 😓
(But #134 looked good to me regardless of the interpretation, as the first step.)
from protolint.
@jd1378 Thank you for your interesting suggestion.
I understand your point. Can you show me some linters that behave so?
I think it's better to follow the nearly de facto rule if it exists (because many tools depend on this). Then, if it doesn't seem to be the de facto rule, we should support it with a new option.
For example, eslint that has immense popularity exits with code 0 when it found no files.
❯❯❯ ls empty
hoge.txt
❯❯❯ eslint "empty/*"; echo $?
0
[memo] OTOH, it exits with 2 when the glob doesn't match any files. --no-error-on-unmatched-pattern
option can change this behavior.
❯❯❯ rm empty/hoge.txt
remove empty/hoge.txt? y
❯❯❯ eslint "empty/*"; echo $?
Oops! Something went wrong! :(
ESLint: 7.5.0
No files matching the pattern "empty/*" were found.
Please check for typing mistakes in the pattern.
2
❯❯❯ eslint --no-error-on-unmatched-pattern true "empty/*"; echo $?
0
from protolint.
You are right, I wasn't thinking about that
I checked out golangci-lint with golangci-lint run ./...; echo $?
and it also exits with code 5 when it founds no file
I'll try to find more, but it looks like that going with a new option be the best way to do it and it won't be a breaking change if anyone by any chance depending on this
from protolint.
@jd1378 Thank you for your confirmation.
I agree with you.
BTW, I added a commit f45a1c7 to clarify the current spec. In this case, it should return an error message with an exit code 2.
Can you make a PR if you don't mind? Otherwise, it falls under I will get to it someday.
protolint/internal/cmd/subcmds/lint/cmdLint.go
Lines 85 to 96 in f45a1c7
c.protoFiles
.
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.