• This repository has been archived on 08/Apr/2019
  • Stars
    star
    112
  • Rank 312,240 (Top 7 %)
  • Language
    CoffeeScript
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Obsolete: Generic code linting support for Atom

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

If the current Atom has been launched via GUI (e.g. Dock/Finder on OS X), once quit and re-launch it from your shell with the atom command. This is required only once and important to handle the PATH environment variable properly. See Linter Executable Paths for more details.

Usage

Your source will be linted on open and on save automatically. 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
  • Ctrl-Alt-M: Toggle Violation Metadata (toggle configuration atom-lint.showViolationMetadata)

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

'.workspace':
  'ctrl-alt-l': 'lint:toggle'
  'ctrl-alt-m': 'lint:toggle-violation-metadata'
'.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/**'
  ]
  'showViolationMetadata': true
  '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'
    'configPath': '/path/to/your/config' # Passed to flake 8 via --config option
  '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.

There's an issue that environment variables in Atom varies depending on whether it's launched via shell or GUI. If it's launched via GUI, it cannot get the environment variables set in your shell rc files like PATH. To handle this issue, when Atom is launched via shell, Atom-Lint automatically saves the environment variables, and from then on it will use the saved variables on linter invocation even if Atom is launched via GUI.

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

This feature is temporarily disabled now.

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

More Repositories

1

transpec

The RSpec syntax converter
Ruby
1,011
star
2

NAKPlaybackIndicatorView

A UIView that mimics the music playback indicator in the Music.app on iOS 7+
Objective-C
399
star
3

astrolabe

An object-oriented Ruby AST extension for Parser
Ruby
67
star
4

rspec-hue_formatter

Bring RSpec integration into your room with Philips Hue
Ruby
59
star
5

atom-auto-update-packages

Keep your Atom packages up to date.
CoffeeScript
33
star
6

apple-music-node

Node.js Client for Apple Music built with TypeScript
TypeScript
31
star
7

homebridge-switchbot

Homebridge plugin for SwitchBot
JavaScript
29
star
8

rspec-composable_json_matchers

RSpec matchers for JSON strings with the power of built-in matchers and composable matchers
Ruby
18
star
9

safedep

Make your Gemfile safe by adding dependency version specifiers automatically
Ruby
12
star
10

pacman-repo

My personal pacman repository
Perl
6
star
11

cocoapods-check_latest

A CocoaPods plugin that checks if the latest version of a pod is up to date.
Ruby
6
star
12

alfred-itunes-airplay

iTunes AirPlay Control for Alfred
Objective-C
5
star
13

smart-car-dashboard

Smart car dashboard, built for my Subaru Levorg with iPad Pro, ESP32, and Firebase
Swift
5
star
14

repository_merger

A tool for merging existing Git repositories into a monorepo while keeping their commit history
Ruby
4
star
15

dotfiles

My personal dotfiles
Shell
3
star
16

gemologist

A library for rewriting your Gemfile and gemspec
Ruby
1
star
17

japan_etc

Japanese ETC (Electronic Toll Collection System) tollbooth database / ETC料金所番号データベース
Ruby
1
star
18

zsh-completions-osx

Zsh completion scripts for Mac OS X specific tools.
1
star
19

rubygems-xcodeproj_generator

Provides a Rake task for generating an Xcode project for Ruby C extension development.
Ruby
1
star