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.

Ignore lines that match a pattern

See original GitHub issue

For example, I’d like to ignore require statements and module.export statements since those are repetitive by nature.

Example, the following code is duplicated in two of my files, but I think that’s perfectly fine:

var
    _ = require('underscore'),
    Backbone = require('backbone'),
    LayoutView = require('LayoutView'),
    Moment = require('moment'),

    appVent = require('appVent'),
    format = require('format'),
    pluginAPI = require('pluginAPI'),

    personalAccountAppsTemplate = require('personalAccountAppsTemplate'),
    personalAccountAppsListEmptyTemplate = require('personalAccountAppsListEmptyTemplate'),

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:6
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
kucherenkocommented, Sep 6, 2018

Implemented in the alpha version of jscpd

You can install npm i jscpd@1.0.0-alpha.2 -g

And mark ignores blocks in the following style:

// jscpd:ignore-start
you ignored code here 
// jscpd:ignore-end
not ignored code

The comment should use in the style of languages, it can be #, //, /* */, <!-- -->

5reactions
voitaucommented, Jun 10, 2015

+1. What about something like they have in jshint:

/* jshint ignore:start */
// Code here will be ignored by JSHint.
/* jshint ignore:end */
Read more comments on GitHub >

github_iconTop Results From Across the Web

awk - completely ignore lines that start with a specific pattern
To ignore some lines on a line-by-line basis, add /unwanted pattern/ {next} or ! /wanted pattern/ {next} at the beginning of the script....
Read more >
Ignore specific lines when matching with a regex
I'm trying to make a regex that matches a specific pattern, but I want to ignore lines starting with a # . How...
Read more >
How does git diff --ignore-matching-lines work
The --ignore-matching-lines and other similar flags only work when git is actually comparing the content of the files. When passing --name-only ...
Read more >
Ubuntu Manpage: git-grep - Print lines matching a pattern
This is the default. -i, --ignore-case Ignore case differences between the patterns and the files. -I Don't match the pattern in binary files....
Read more >
Exclude lines in less (or journalctl) - Raymii.org
You can exclude certain lines that match one or multiple words (or a regex) with a few keystrokes, once less is open.
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