Comments (6)
Is it possible to simply add a generic warning for a whole file (and warn if the file changes)?
I have a plan to support it, but it's not possible right now.
It might be annoying to post false-positive file comments each time to PR which contains the file changed, so we need to consider when reviewdog should post file comments.
from reviewdog.
One idea is simply that line number 0, or negative line number, applies to the whole file. What do you think of that?
from reviewdog.
@haya14busa Please let me know if you'd be fine with the #92 (comment) approach mentioned above. I could consider submitting a pull request when I find the time if you'd be open to such a solution.
from reviewdog.
It might be annoying to post false-positive file comments each time to PR which contains the file changed, so we need to consider when reviewdog should post file comments.
You have a point. I see this as two different things we need to address:
- Support for lint warning across ranges of lines, possibly also special identifier for "EOF" for generating a lint forwarning for last line in the file. A warning for the whole file could then be expressed as
1-EOF
. - Defining if a warning should be generated for adding line, removing line, or both (that is modification).
Instead of filenumber <= 0 (as in #94), how about
- adding support for line ranges with
EOF
marker inerrorformat
? And - introducing yet another error format identifier, call it
%x
, which would bea
for lines added,r
for lines deleted andar
for lines modified? Obviously%x
means thaterrorformat
would diverge from vim's errorformat, but it might be worth it to support changes.
Example: Given an error format of %f:%l:%x: %m
the linter line
myfile.go:1-EOF:a: A line has been added.
would trigger a comment on the first added file anywhere in myfile.go
. If multiple lines are added only a single (the first) line is commented on.
What do you think of this?
from reviewdog.
I'm so sorry for the late reply.
I don't think it's good idea to add new errorformat identifier.
If you wanna post a comment for whole file, just skipping line number is enough. myfile.go: this file contains blah blah errors
for errorformat side.
And reviewdog can deal with it as line number == 0. No need to support negative line number.
it might be interesting to add range identifier to errorformat, but we don't need this feature to fix the issue.
As for the timing to post file comments, I have 2 option to consider.
- Post file comments for every pull request containing file comment. If the comment is false positive, users can filter them by their own before passing lint result to reviewdog.
- Post file comments only the file is added in the pull request. Unfortunately, it leads false negative.
I don't like both options, but I slightly prefer option 1.
What do you think?
from reviewdog.
Now you can use -filter-mode=file
. https://github.com/reviewdog/reviewdog#filter-mode
from reviewdog.
Related Issues (20)
- reviewdog: failed to get merge-base commit: exit status 1 HOT 2
- Tfsec- parse error: failed to unmarshal rdjson (DiagnosticResult): proto: syntax error (line 1:1): unexpected token HOT 2
- 0.15.0 installation fails on Alpine using `go get` HOT 1
- Support --filter-mode=[file/nofilter] in github-pr-review
- Can I use XO with review dog?
- `action-flake8` is broken due to an update in `astroid` HOT 1
- 'github-pr-review' reporter is not making suggestion for blank line addition
- Support for Vale text linter HOT 2
- Bundle related suggestions together
- [BUG] Sarif format not working HOT 9
- fail to run reviewdog: XML syntax error on line 10: expected attribute name in element HOT 1
- 'reviewdog: .git exist but is not a directory' in submodule
- Add support for Azure Devops
- I want to konw which LLM do you uesd HOT 4
- File filter for github doesn't correctly submit comments HOT 3
- Wrong line number is sent to Bitbucket Server Code Insight Reports HOT 2
- Feature Request: Option to Disable the `"reported by reviewdog 🐶"` Prefix in Review Messages HOT 11
- New GitHub Action: terraform-validate HOT 2
- gitlab-mr-discussion fail to get diff HOT 3
- [BUG] breaks if file path contains parenthesis
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 reviewdog.