Giter VIP home page Giter VIP logo

atom-lint's Introduction

Build Status

Atom-Lint

Generic code linting support for Atom.

Screenshot

Supported Linters

More linters will be supported in the future.

Features

  • Seamless integration with Atom as if it's a built-in package.
  • Code highlighting โ€“ you don't need to move your eyes from the code to see the violations.
  • Clean UI โ€“ it honors the colors of your favorite Atom theme.

Installation

$ apm install atom-lint

Usage

Your source will be linted on open and on save automatically, and the detected violations will be displayed as arrows in the editor. You can see the detail of the violation by moving the cursor to it.

Keymaps

  • Ctrl-Alt-L: Global toggle
  • Ctrl-Alt-[: Move to Previous Violation
  • Ctrl-Alt-]: Move to Next Violation

Also you can customize keymaps by editing ~/.atom/keymap.cson (choose Open Your Keymap in Atom menu):

'.workspace':
  'ctrl-alt-l': 'lint:toggle'
'.editor':
  'ctrl-alt-[': 'lint:move-to-previous-violation'
  'ctrl-alt-]': 'lint:move-to-next-violation'

See Customizing Atom for more details.

Configuration

You can configure Atom-Lint by editing ~/.atom/config.cson (choose Open Your Config in Atom menu):

# Some other settings...
'atom-lint':
  'ignoredNames': [
    'tmp/**'
  ]
  'clang':
    'path': '/path/to/bin/clang'
    'headerSearchPaths': ['/path/to/include','/path2/to/include']
    'mergeAtomLintConfigIntoAutoDiscoveredFlags': true # If you want to add defaults to discovered project-specific clang flags
  'coffeelint':
    'path': '/path/to/bin/coffeelint'
  'csslint':
    'path': '/path/to/bin/csslint'
    'rules': # See http://csslint.net/about.html for rules
      'ignore': [
        'adjoining-classes'
      ]
      'errors': []
      'warnings': []
  'erlc':
    'path': '/path/to/bin/erlc'
  'flake8':
    'path': '/path/to/bin/flake8'
  'gc':
    'path': '/path/to/bin/go'
  'hlint':
    'path': '/path/to/bin/hlint'
  'jshint':
    'path': '/path/to/bin/jshint'
  'puppet-lint':
    'path': '/path/to/bin/puppet-lint'
  'rubocop':
    'path': '/path/to/bin/rubocop'
  'rustc':
    'path': '/path/to/bin/rustc'
  'scss-lint':
    'path': '/path/to/bin/scss-lint'
  'shellcheck':
    'path': '/path/to/bin/shellcheck'

Linter Executable Paths

  • atom-lint.LINTER.path

Normally you can omit this setting. By default Atom-Lint automatically refers the environment variable PATH of your login shell if it's bash or zsh, and then invokes the command. Thus, if you're using a language version manager such as rbenv, linters need be installed in the default/global environment of the version manager (i.e. the environment where you opened a new terminal). If you need to use a non-default executable, use this setting.

File Patterns to Ignore

  • atom-lint.ignoredNames (Global)
  • atom-lint.LINTER.ignoredNames (Per Linter)

You can specify lists of file patterns to disable linting. The global patterns and the per linter patterns will be merged on evaluation so that you can make these lists DRY.

'atom-lint':
  'ignoredNames': [
    'tmp/**'
  ]
  'rubocop':
    'ignoredNames': [
      'vendor/**'
      'db/schema.rb'
    ]

With the above example, all of tmp/**, vendor/** and db/schema.db are ignored when RuboCop is active.

The pattern must be relative to the project root directory. The pattern format is basically the same as the shell expansion and .gitignore. See minimatch for more details.

Clang Specific Configuration

Header Search Paths

  • atom-lint.clang.headerSearchPaths

Specify additional header search paths. These paths are passed to clang with -I option.

Project-Specific Flags and Atom-Lint's configuration

  • atom-lint.clang.mergeAtomLintConfigIntoAutoDiscoveredFlags

Atom-Lint automatically picks up your project-specific compiler flags (currenly .clang-complete format is supported) via clang-flags module. By default, if a custom flag file is found, Atom-Lint uses only the flags specified in the file and ignores other configuration (e.g. the headerSearchPaths above). If you want to use both the project-specific flags and Atom-Lint's configuration, set this mergeAtomLintConfigIntoAutoDiscoveredFlags to true.

CSSLint Specific Configuration

Custom Rules

  • atom-lint.csslint.rules.errors
  • atom-lint.csslint.rules.warnings
  • atom-lint.csslint.rules.ignore

These are passed to csslint with --errors, --warnings or --ignore option.

Contributors

Here's a list of all contributors to Atom-Lint.

Changelog

Atom-Lint's changelog is available here.

License

Copyright (c) 2014 Yuji Nakayama

See the LICENSE.txt for details.

atom-lint's People

Contributors

benjohnson avatar bryanhunter avatar danielgtaylor avatar diullei avatar elrolito avatar jonrohan avatar kev avatar moshee avatar pborreli avatar shtirlic avatar skevy avatar wesbland avatar yujinakayama avatar

Watchers

 avatar  avatar  avatar

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.