Comments (6)
Wow, that's a pretty strange one - I wonder if the npm module parse-diff is struggling with this specific PR shape. We pass the diff from GitHub to that library to generate the list of files:
https://github.com/danger/danger-js/blob/main/source/platforms/git/diffToGitJSONDSL.ts#L1-L25C2
Maybe try use yarn resolves to see if a later version of the dependency fixes it?
from danger-js.
It is a special sequence in a diff: https://patch-diff.githubusercontent.com/raw/reactjs/react.dev/pull/6120.diff
So, yep, parse-diff is really where you want to be looking here IMO
diff --git a/src/components/Layout/Footer.tsx b/src/components/Layout/Footer.tsx
index 4d0b066461f..cd0cf25793c 100644
--- a/src/components/Layout/Footer.tsx
+++ b/src/components/Layout/Footer.tsx
from danger-js.
@eppisapiafsl I could be wrong, but I’m pretty sure eslint-disable-next-line
doesn’t support explanation comments.
/* eslint-disable-next-line no-restricted-imports */
import { useStore } from "react-redux";
Does this still exhibit your issue?
from danger-js.
I think it treats your comment as an eslint rule or plug-in that it needs to dynamically load or something.
possibly that’s even a security hole in eslint!
from danger-js.
@orta tried with latest Danger version, same issue
@fbartho Sorry, forgot to mention in the environment section. I'm using https://github.com/mysticatea/eslint-plugin-eslint-comments to force comments when disable a lint rule.
The error only happen when the file is modified, If I create a new file it works as expected
danger.git.created_files
doesn't take the comment as a new file
danger.git.modified_files
take the comment as a new file
from danger-js.
I'm using https://github.com/mysticatea/eslint-plugin-eslint-comments to force comments when disable a lint rule.
@eppisapiafsl That’s interesting! — I wish they could push their changes upstream to eslint. That eslint-plugin hasn’t seen any releases at all since 2019!! — Knowing what we do about the JS ecosystem, I would be shocked if that plugin didn’t have a ton of dependencies that need to be updated, and deprecated eslint
APIs to change, and potentially its own security holes.
re: the npm-parse-diff created-vs-modified issue, your comment included the double-hyphen --
I think this is often a special sequence when passed to CLI/Shell commands (I know yarn did stuff with it) — I’m wondering if that sequence is being consumed in an improperly escaped call to a sub-shell. — @orta does that sound plausible or helpful? (Feel free to ignore if I’m trying to feed a red herring to a wild goose)
from danger-js.
Related Issues (20)
- [DEPS] Move from @gitbeaker/node to @gitbeaker/rest HOT 3
- [BUG] process.env - Cannot read properties of undefined (reading 'env') HOT 1
- [BUG] substr is deprecated HOT 2
- [BUG] Danger.js comments removed from Github PR after merge HOT 5
- [BUG] [Gitlab] Can't post multiple inline comments HOT 1
- [BUG] Upgrading to danger `11.3.0` causes `tsc` build errors HOT 4
- [BUG] Include dangerfile.ts in the tsconfig makes tsc run out of memory HOT 2
- [BUG][Spec] GitHubReviewers interface is not described
- [BUG] Danger fails to create inline comments on Gitlab
- [BUG] Danger posting separate comment for each warning on GitHub HOT 2
- GHCR publishing is broken HOT 3
- [BUG] GitHubAPIPR unsupported structure HOT 2
- [BUG] `parent_ids` of GitLab MR commits is always an empty array HOT 2
- [BUG] `message` does not attach to a file and line provided, and instead all comments are in the "main comment" section HOT 1
- [Feature Request] Support ignoring whitespace-only changes HOT 3
- [BUG] prettier.resolveConfig fails due to faulty shouldUseGitHubOverride HOT 8
- [BUG] Can you push updated images to dockerhub? HOT 4
- [BUG] Commit status check associated with the wrong commit in CircleCI + GitHub combination HOT 2
- [Config Issue] GitHub Merge Queue - Danger server stuck in "waiting for status be reported" HOT 4
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 danger-js.