question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

// Removed require comment

See original GitHub issue

Howdy! Today we encountered a fun little comment in our dangerfile.js:

// Removed require

-let { danger, fail, warn, message } = require('danger')
+// Removed require

We were trying to figure out where this comment came from (and why it’s trying to remove code from our project) and couldn’t reproduce it locally what-so-ever. Oddly enough, it only came up in our CI process (we automatically push changes from a certain stage in our CI pipeline and this was in it). We thought it was possibly our eslint plugins so we scoured that source code, we also looked at prettier thinking it added it. For a while we couldn’t figure out where it came from until we thought it was maybe danger itself doing it. Lo-and-behold, we found out it is 😸

Unfortunately, we spent a bit of time doing this. I’m making this issue for two reasons:

  1. Google. We couldn’t find any google results when searching for // Removed require so hopefully find this and get their answers solved faster!
  2. A possible solution:

I think it might be best to change the comment to not just // Removed require, but also add another comment with a link to some sort of document or github issue that mentions why the comment is necessary. If this was there we would have found out a lot sooner and not feel like we accidentally created a sentient AI that removed code and mocked us in the process by leaving a comment 👍

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
ortacommented, Nov 4, 2017

I think this is now fixed with 2.0’s release 👍 (it does everything in-memory instead of editing the existing file )

0reactions
ky1ejscommented, Feb 25, 2019

Cool, thanks for the info. We have a working solution for now which I’ve documented for our team. I think this may trip up others though, especially if they’re setting up a non-JS/TS project and aren’t super familiar with TS/JS.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Commenting code that is removed [closed] - Stack Overflow
Generally, code that is removed should not be commented, precisely because it clutters the codebase (and, why would one comment on something that...
Read more >
Topic: Remove the required fields in the Comment form
Hi! How do i remove the required fields in the comment form? The “Name” and “E-mail” fields are required for the moment but...
Read more >
Removing Comments - DEV Community 👩‍💻👨‍💻
For me, removing comments is about acheiving code that clearly communicates. One could even refactor the code to improve readability. Consider:.
Read more >
Learn about comment settings - YouTube Help - Google Support
Comment settings for videos · Allow all comments · Hold all comments for review · Disable comments · Channel level comment settings ·...
Read more >
[ Removed by Reddit ] Now that reddit is actually removing the ...
I've noticed that usernotes i've taken that link to user comments that get removed by reddit admins do not preserve the comment for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found