Giter VIP home page Giter VIP logo

linter-dryer's Introduction

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

  • type: 'integer'
  • default: 3

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

Minimum repeating code tokens

  • type: 'integer'
  • default: 25

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

  • 'file' OR 'project'
  • default: 'file'

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

.ignore files

  • type: 'array' of strings
  • default: ['.gitignore']

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

Additional ignore patterns

  • type: 'array' of strings
  • default: ['**/*.min.*']

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

  • 'info', 'warning' OR 'error'
  • default: 'info'

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.

linter-dryer's People

Contributors

delucis avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

kelvinninja1

linter-dryer's Issues

path.dirname is deprecated.

Argument to path.dirname must be a string

path.dirname (C:\Users\USER\AppData\Local\atom\app-1.43.0\resources\app.asar\src\electron-shims.js:9:10)
<unknown> (C:\Users\USER\.atom\packages\linter-dryer\lib\cpd.js:20:80)
Generator.next (null:null:null)
step (C:\Users\USER\.atom\packages\linter-dryer\lib\cpd.js:99:273)
<unknown> (C:\Users\USER\.atom\packages\linter-dryer\lib\cpd.js:99:443)
Promise (null:null:null)

path.basename is deprecated.

Arguments to path.basename must be strings

path.basename (C:\Users\USER\AppData\Local\atom\app-1.43.0\resources\app.asar\src\electron-shims.js:34:10)
<unknown> (C:\Users\USER\.atom\packages\linter-dryer\lib\cpd.js:21:99)
Generator.next (null:null:null)
step (C:\Users\USER\.atom\packages\linter-dryer\lib\cpd.js:99:273)
<unknown> (C:\Users\USER\.atom\packages\linter-dryer\lib\cpd.js:99:443)
Promise (null:null:null)

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

feat: Allow project-level config

It would be useful if linter-dryer’s settings could be overridden on a per-project basis.

For example, a project could provide a .dryer.yml config file that could look like the following:

# .dryer.yml duplicating current defaults
minimumLines: 3
minimumTokens: 25
linterScope: file
ignoreFiles:
  - .gitignore
exclude:
  - "**/*.min.*"
severity: info

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.