linter-dryer

Highlight repetition in Atom to help you stay DRY

Chris Swithinbank

335

2

0.4.1

GPL-3.0

GitHub

This package provides the following services:

linter-dryer

apm Build Status Greenkeeper badge

Highlight repetition in Atom to help you stay DRY 🌂

Installation

apm install linter-dryer

Or install it from within Atom by going to SettingsInstall and searching for linter-dryer.

Usage

This package provides “copy–paste detection” for files and projects in Atom, using jscpd. It will highlight code in the text editor that is repeated elsewhere. You may need to adjust the settings to get results that work well for your specific project.

jscpd supports a wide range of languages and a full list is available in the jscpd README.

Settings

Minimum repeating lines

Set how many lines must repeat before they are flagged as a repetition by linter-dryer.

Minimum repeating code tokens

Code is processed and tokenized by jscpd in order to find repetitions that are similar but not identical. This sets how many tokens need to match to qualify as a repetition. Values that are too low may produce meaningless output, while values that are too high may not return any results.

Scope to search for repetitions

Set whether the linter should look for repetitions only in the current file, or throughout the current project.

.ignore files

Specify files like .gitignore or .npmignore to use in deciding which files linter-dryer should ignore.

Additional ignore patterns

Files that match any of the patterns set here will be ignored when looking for repetition. (See minimatch for globbing documentation.) These patterns are applied in addition to rules found in any files set in the .ignore files option.

Repetition severity

Sets how the linter UI highlights repetitions in Atom. By default, a blue “info” level is set, but users can choose to have repetitions highlighted as warnings (orange) or errors (red).

Contributing

All contributions to this package — no matter how small — are welcome! Please see the contribution guidelines for notes on opening issues and submitting pull requests and the code of conduct for rules about how to treat other developers with kindness and respect.