Next: Introduction, Up: (dir) [Index]
Modern on-the-fly syntax checking for GNU Emacs 24.
Copyright © 2014-2016 Sebastian Wiesner
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.
A copy of the license is also available from the Free Software Foundation Web site at http://www.gnu.org/licenses/fdl.html.
Alternatively, you may copy, distribute and/or modify this documentation under the terms of the Creative Commons Attribution-ShareAlike 4.0 International Public License. A copy of the license can be obtained at https://creativecommons.org/licenses/by-sa/4.0/legalcode.
Flycheck is a modern GNU Emacs package that provides on-the-fly syntax checking for buffers. It is intended as replacement for the older Flymake package which is built into Emacs.
See Introduction, for more information about Flycheck. For installations instructions and a quick tutorial, see Installation and Quickstart respectively. See Usage, for a detailed user guide.
With Flycheck installed you can read this manual inside Emacs with M-x flycheck-info. This opens Emacs’ built-in Info reader. See (info)Getting Started, to see how to use this reader.
• Introduction: | An introduction to Flycheck | |
• Installation: | How to install Flycheck | |
• Quickstart: | A quick Flycheck tutorial | |
• Usage: | How to use Flycheck | |
• Syntax checker definitions: | How to add new syntax checkers to Flycheck | |
• Flycheck hooks: | How to hook into Flycheck | |
• Flycheck API: | API documentation | |
• Supported languages: | A list of supported languages | |
• Getting Help: | How to obtain help about Flycheck | |
• GNU Free Documentation License: | How to copy this manual | |
• Main Index: | Index of Flycheck concepts | |
• Key Index: | Index of all keybindings | |
• Function and Variable Index: | Index of commands, options and types |
Next: Installation, Previous: Top, Up: Top [Index]
Flycheck provides modern on-the-fly syntax checking extension for GNU Emacs 24, intended as replacement for the older Flymake extension which is part of GNU Emacs.
Flycheck runs various linting tools and services to automatically check the contents of buffers while you are typing, and reports warnings and errors directly in the buffer, in the mode line and in an optional error list. You can navigate errors and warnings in the current buffer, show the corresponding messages, and copy errors to the kill ring.
Next: Quickstart, Previous: Introduction, Up: Top [Index]
Flycheck needs GNU Emacs 24. Older releases of GNU Emacs or other flavours of Emacs (e.g. XEmacs, Aquamacs, etc.) are not supported.
Flycheck works best on Unix-like operating systems. It is extensively tested on Linux and OS X.
Flycheck does not explicitly support Windows, but tries to maintain Windows compatibility and should generally work fine on Windows, too. However, we can neither answer questions about Windows nor fix bugs that only occur on Windows without the help of active Windows users. Please watch out for known Windows issues!
Flycheck does not check buffers itself. It relies on external programs to check buffers, which need to be installed separately. See Supported languages, for a list of required programs for each language supported by Flycheck.
Most of these programs are available in the package repositories of Linux distributions, or with the standard package managers of specific programming languages (e.g. Rubygems, NPM, Cabal, etc.)
Install Flycheck via Emacs’ built-in package manager, from the MELPA Stable repository:
M-x package-install RET flycheck
Alternatively, you may use the MELPA repository, which hosts the most recent development version. Note that these repositories are not included in GNU Emacs by default.
You need to enable them explicitly, by adding the following to your init file:
(require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) (package-initialize)
If you don’t know where your init file is take a look at the value of
the variable user-init-file
with C-h v user-init-file.
Next: Usage, Previous: Installation, Up: Top [Index]
To get started with Flycheck, enable it by adding the following to your init file:
(add-hook 'after-init-hook #'global-flycheck-mode)
If you don’t know where your init file is take a look at the value of
the variable user-init-file
with C-h v user-init-file.
Next you need to install syntax checking tools for the major modes you are using. For instance, for Python you may want to install Pylint:
$ pip install pylint
For Ruby, you might want to use Rubocop and ruby-lint:
$ gem install rubocop ruby-lint
See Supported languages, for a complete list of all languages that Flycheck supports.
Now switch to a Python or Ruby Mode buffer and run M-x flycheck-verify-setup to check whether Flycheck is correctly setup.
If everything is fine Flycheck will now check syntax using these tools, when you visit a buffer in any of these languages. Syntax checking happens automatically when you save the buffer or make any changes. Flycheck highlights errors and warnings in the buffer, indicates them in the fringe, and reports their numbers in the mode line.
You can also manually check a buffer with C-c ! c
(flycheck-buffer
).
Use C-c ! n (flycheck-next-error
) and C-c ! p
(flycheck-previous-error
) to navigate between error locations.
If you keep the point at an error location, Flycheck will show the error
message in the echo area after a short delay. You can also hover error
locations with the mouse and see the error message in a tooltip.
To get an overview of all errors and warnings in the current buffer,
type C-c ! l (flycheck-list-errors
) to pop up a list of all
errors in your current buffer. The error list updates automatically
when you fix errors or introduce new ones, or when you switch to another
buffer.
All Flycheck commands are available in the Emacs menu at ‘Syntax checking’ in the ‘Tools’ menu.
The same menu is also available by clicking on the mode line lighter of Flycheck.
Next: Syntax checker definitions, Previous: Quickstart, Up: Top [Index]
This chapter explains the usage of Flycheck in-depth.
Note: All commands in this chapter are documented with their
default key prefix C-c !. You can customise this prefix with
flycheck-keymap-prefix
, but remember your custom prefix while
reading this chapter.
• Checking buffers: | How buffers are checked | |
• Syntax checkers: | Tools used to check a buffer | |
• Reporting results: | How results of checks are reported | |
• Navigating errors: | How to navigate to Flycheck errors | |
• Displaying errors: | How to display error messages | |
• Killing errors: | How to put error messages into the kill ring | |
• Listing errors: | How to show a list of all errors | |
• Mode line display: | How to interpret Flycheck’s mode line | |
• Configuring checkers: | How to configure syntax checkers |
Next: Syntax checkers, Up: Usage [Index]
The minor mode flycheck-mode
enables syntax checking in a single
buffer. global-flycheck-mode
automatically enables
flycheck-mode
all buffers whenever possible. You can exclude
specific major modes from global-flycheck-mode
with
flycheck-global-modes
.
Note: global-flycheck-mode
does not enable
flycheck-mode
for remote or encrypted files. The former is flaky
and might be very slow, and the latter would leak confidential data to
temporary directories. You may still check syntax in these buffers by
manually enabling flycheck-mode
with M-x flycheck-mode.
However, this is not recommended for said reasons.
Add the following code to your init file to enable syntax checking permanently:
(add-hook 'after-init-hook #'global-flycheck-mode)
When flycheck-mode
is enabled, Flycheck automatically checks a
buffer whenever
You can customise this behaviour by changing
flycheck-check-syntax-automatically
:
A list of events that trigger a new syntax check in the current buffer:
save
Check the buffer immediately after it was saved.
idle-change
Check the buffer a short time after the last change to the buffer. The
delay is customisable with flycheck-idle-change-delay
.
new-line
Check the buffer immediately after a new line was inserted.
mode-enabled
Check the buffer immediately after Flycheck Mode was enabled.
For instance, with the following code in your init file Flycheck will only check the buffer when it is saved, but never while you are making changes to the buffer:
(setq flycheck-check-syntax-automatically '(mode-enabled save))
In addition to automatic syntax checking you can always check the current buffer manually:
Check syntax in the current buffer.
Note: If syntax checking does not work, please check your setup:
Popup a buffer with information about the Flycheck setup for the current buffer.
Lists the syntax checkers available for the current buffer, together with potential problems in their setup.
During syntax checks Flycheck creates temporary files to feed to
contents of the current buffer to external programs. You can change the
prefix used for the names of these temporary files with
flycheck-temp-prefix
.
Next: Reporting results, Previous: Checking buffers, Up: Usage [Index]
Flycheck does not check buffers by itself, but relies on external
syntax checkers. When checking a buffer Flycheck automatically
selects the best syntax checker from flycheck-checkers
:
A list of all syntax checkers available for syntax checking.
A syntax checker in this list is a registered syntax checker.
Flycheck may apply further syntax checkers to the current buffer, if the
selected syntax checker chains to other syntax checkers. For
instance, the emacs-lisp
syntax checker, which checks Emacs Lisp
with Emacs’ byte compiler, chains to the
emacs-lisp-checkdoc
syntax checker, which checks Emacs Lisp for
violations of documentation conventions, (elisp)Documentation
Tips. In Emacs Lisp buffers, Flycheck will first use
emacs-lisp
, and then emacs-lisp-checkdoc
.
Flycheck ignores chained checkers which are not contained in
flycheck-checkers
.
Like everything else in GNU Emacs, syntax checkers have online
documentation as well. If you are interested what major modes a
particular syntax checker in flycheck-checkers
supports, or what
tool it uses, type C-c ! ?:
Prompt for a syntax checker and show its documentation.
The documentation includes the name of the program or service used by the syntax checker, a list of major modes in which the checker will be used, and a list of its options.
Instead of letting Flycheck select a syntax checker automatically you can also explicitly tell Flycheck which checker to use for the current buffer, by manually selecting a specific syntax checker:
Prompt for a syntax checker and select this syntax checker for the current buffer.
syntax checker selection for the current buffer, and let Flycheck
automatically select a syntax checker from flycheck-checkers
again.
You can also select a syntax checker via the variable
flycheck-checker
. In fact, flycheck-select-checker
just sets this variable accordingly:
A syntax checker to use for the current buffer.
If nil (the default), Flycheck will automatically select the best
checker from flycheck-checkers
.
If set to a syntax checker, Flycheck will use this syntax checker for the current buffer, and never automatically select any other. Flycheck still runs chained checkers, though.
If the syntax checker selected by this variable does not work in the current buffer, Flycheck signals an error.
You can set this variable locally. For instance, if your Python project
mandates Flake8 as a
syntax checker, you can tell Flycheck to only use the corresponding
checker python-flake8
in Python files of your project by setting
flycheck-checker
as a directory-local variable in the top-level
directory of your project with M-x add-dir-local-variable RET
python-mode RET flycheck-checker RET python-flake8. See (emacs)Directory
Variables, for more information about directory variables.
Occasionally you may want to disable specific syntax checkers completely, so that they can never be used at all, neither via automatic nor via manual selection:
Prompt for a syntax checker to disable in the current buffer.
Prompt for a syntax checker to re-enable in the current buffer.
This is particularly useful if you want to disable syntax checkers that
are chained after others. For instance, if you do not care for
documentation conventions of Emacs Lisp you may not need for the
emacs-lisp-checkdoc
checker, so you can disable it for the
current buffer with M-x flycheck-disable-checker RET
emacs-lisp-checkdoc.
flycheck-disable-checker
actually sets the buffer-local value of
the flycheck-disabled-checkers
option:
A list of disabled syntax checkers. Flycheck will never use disabled syntax checkers to check a buffer.
You can customise this variable with M-x customize-variable RET flycheck-disabled-checkers or set its default value in your init file to permanently disable specific checkers. For instance, to permanently disable Clang for all C/C++ buffers:
(setq-default flycheck-disabled-checkers '(c/c++-clang))
You can also disable checkers via local variables. For instance, to
disable emacs-lisp-checkdoc
for your entire project, add it to
flycheck-disabled-checkers
in the .dir-locals.el file of
your project:
((emacs-lisp-mode (flycheck-disabled-checkers emacs-lisp-checkdoc)))
See (emacs)Directory Variables, for more information about directory variables.
Next: Navigating errors, Previous: Syntax checkers, Up: Usage [Index]
When a syntax check in the current buffer has finished, Flycheck reports the results of the syntax checkers used by the check in the current buffer:
flycheck-highlighting-mode
,
flycheck-indication-mode
.
How Flycheck highlights errors and warnings in the buffer:
lines
Highlight the whole line, ignoring any column information.
columns
Highlight the column of the error, if the error has a column, otherwise
behave as lines
.
symbols
Highlight the symbol at the error column, if any, otherwise behave like
columns
. This is default
sexps
Highlight the expression at the error column, if any, otherwise behave
like columns
. Warning: sexps
can be very
slow in some major modes, notably the built-in python-mode
.
nil
Do not highlight errors at all.
Flycheck uses the flycheck-error
, flycheck-warning
and
flycheck-info
faces to highlight errors, warnings and info
messages respectively.
How Flycheck indicates errors and warnings:
left-fringe
right-fringe
Indicate errors in the left or right fringe respectively. See (emacs)Fringes, for more information about fringes.
Flycheck uses the flycheck-fringe-error
,
flycheck-fringe-warning
, and flycheck-fringe-info
faces
for the indicators for the corresponding error levels.
nil
Do not indicate errors and warnings.
To avoid flooding a buffer with excessive reports, Flycheck discards any
reports and disables the corresponding syntax checker
subsequently, if the total number of reported errors of any level
exceeds the value of flycheck-checker-error-threshold
.
You can explicitly clear with the flycheck-clear
command.
Next: Displaying errors, Previous: Reporting results, Up: Usage [Index]
By default, Flycheck integrates into standard error navigation commands
of Emacs: M-g n (next-error
) and M-g p
(previous-error
) will navigate between Flycheck warnings and
errors in the current buffer. See (emacs)Compilation Mode, for more
information about these commands. You can disable this integration by
setting flycheck-standard-error-navigation
to nil, and
re-enabling flycheck-mode
afterwards.
Note: With standard error navigation visible compilation buffers (e.g. from M-x compile, M-x grep, M-x occur, etc.) take precedence over Flycheck errors.
Flycheck provides an independent set of navigation commands which will
always navigate Flycheck errors in the current buffer, regardless of
visible compilation buffers and
flycheck-standard-error-navigation
:
Jump to the next error.
With prefix argument, jump forwards by as many errors as specified by the prefix argument, e.g. M-3 C-c ! n will move to the 3rd error from the current point. With negative prefix argument, move to previous errors instead. Signal an error, if there are no more Flycheck errors.
Jump to the previous Flycheck error.
With prefix argument, jump backwards by as many errors as specified by the prefix argument, e.g. M-3 C-c ! p will move to the 3rd error before the current point. With negative prefix argument, move to next errors instead. Signal an error, if there are no more Flycheck errors.
Jump to the first Flycheck error.
With prefix argument, jump forwards to by as many errors as specified by the prefix argument, e.g. M-3 M-x flycheck-first-error moves to the 3rd error from the beginning of the buffer. With negative prefix argument, move to the last error instead.
By default, these commands consider all errors in the current buffer.
With flycheck-navigation-minimum-level
you can restrict them to
errors above certain levels:
The minimum levels of errors to consider for navigation.
If set to an error level, only navigate to errors whose level is as least as severe as this one. If nil, navigate to all errors.
Next: Killing errors, Previous: Navigating errors, Up: Usage [Index]
When the point moves to an error location Flycheck automatically displays the error at point after a short delay:
The number of seconds to wait before displaying the error at point. Floating point numbers can express fractions of seconds.
You can also display errors at point explicitly with C-c ! h:
Show the error(s) at point.
By default Flycheck shows the error message and the error ID in the echo
area, but you can customise how Flycheck displays errors with
flycheck-display-errors-function
:
A function to display errors. The function is called with a list of Flycheck error objects to display. See Errors, for more information about these objects.
Flycheck provides some built-in display functions:
Show error messages and IDs in the echo area.
Like flycheck-display-error-messages
, but does not show anything
if the error list is visible. See Listing errors, for more
information about the error list.
Alternatively the flycheck-pos-tip extension provides an display function which shows error messages in a graphical popup.
In addition to this display mechanism, Flycheck adds a tooltip to each
error which appears when you hover the error location with the mouse
pointer. You can force Emacs to show the contents of the tooltip in the
echo area with C-h . (display-local-help
).
The contents of this tooltip are created with
flycheck-help-echo-function
:
A function to compute the contents of the error tooltips.
By default Flycheck adds the error message and the error ID of all errors at point to the tooltip contents.
Next: Listing errors, Previous: Displaying errors, Up: Usage [Index]
You can also put error messages into the kill ring:
Copy all Flycheck error messages at point into the kill ring.
Each error message is killed separately, so C-y
(yank
) only yanks a single error message. You can use M-y
(yank-pop
) to cycle between the killed messages after yanking the
first one.
Copy all Flycheck error messages at point, including their IDs.
Copy the IDs of the errors at point.
Next: Mode line display, Previous: Killing errors, Up: Usage [Index]
To get an overview of all errors in the current buffer you can popup an error list:
List all errors in the current buffer.
The error list automatically refreshes itself after a syntax check. It
also follows the current buffer and window, and automatically updates to
show the errors of the new buffer if you switch to another buffer or
window. After each refresh the hook
flycheck-error-list-after-refresh-hook
.
In the error list window the following keybindings are available:
Move to the next error.
Move to the previous error.
Filter the list, showing only errors whose level is above a threshold of your choice.
Remove all filters.
Hide the error list window.
Jump to the location of the error at point.
Refresh the error list, by triggering a new syntax check in the associated buffer.
Sort the error list by the column at point. Press repeatedly to inverse the sorting order.
For instance, you can sort errors by their level by moving the point onto the text of the ‘Level’ column, and then pressing S. You can achieve the same effect by clicking on the column header.
By default, the error list shows all errors in the current buffer. In
addition to filtering manually, you can restrict it to errors
above certain levels with flycheck-error-list-minimum-level
:
The minimum level of errors to display in the error list.
If set to an error level, only displays errors whose error level is at least as severe as this one in the error list. If nil, display all errors.
When you move the point in the current buffer while the error list is
visible, all errors on the current line are highlighted in the error
list with the flycheck-error-list-highlight
face.
Next: Configuring checkers, Previous: Listing errors, Up: Usage [Index]
Flycheck always indicates its current state in the mode line, with one of the following strings:
There are no errors in the current buffer.
Flycheck currently checks the current buffer.
There are three errors and five warnings in the current buffer.
Flycheck did not find any syntax checker for the current buffer. Try
C-c ! v (flycheck-verify-setup
) to find out why.
The syntax check failed. Inspect the ‘*Messages*’ buffer for more information about the failure.
The syntax check had a dubious result. The definition of the syntax checker may be flawed. Inspect the ‘*Messages*’ buffer for details.
This indicator should never appear for built-in syntax checkers. If it does, please consider reporting an issue to the Flycheck developers. See Issues, for more information.
The 3rd party extension flycheck-color-mode-line automatically changes the background colour of the mode line according to the results of the last syntax check.
Previous: Mode line display, Up: Usage [Index]
Flycheck provides a rich interface to configure syntax checkers. There are three different kinds of options for syntax checkers:
Man syntax checkers can be configured via individual options. For
instance, the flycheck-flake8-maximum-line-length
tells the
python-flake8
syntax checker about the maximum number of
characters allowed on a line. Use the command
flycheck-describe-checker
to see what options a syntax checker
provides. Type M-x customize-group RET flycheck-options to get a
list of all available options.
Options are mainly intended to be set per file or per project via file or directory variables. See (emacs)File Variables, and (emacs)Directory Variables respectively, for more information.
For instance, if you the following file variables section at the end of
a Python file, the python-flake8
syntax checker will warn about
lines longer than 100 characters, rather than the default limit of 80
characters:
# Local Variables: # flycheck-flake8-maximum-line-length: 100 # End:
Some syntax checkers also read configuration files. These syntax checkers have an associated configuration file variable which specifies the path to the configuration file. All configuration file variables are customisable via M-x customize-group RET flycheck-config-files.
If the value of a configuration file variable is nil, Flycheck will not use any configuration file for the corresponding syntax checker. If it is a string, however, Flycheck tries to locate an appropriate configuration file, with the following procedure:
default-directory
of the current buffer.
If any of these steps returns an existing file, this file is given to the syntax checker. For instance, assume you edit the file foo/bar/hello.py in the following project layout:
. ├── .pylintrc ├── README.rst ├── foo │ ├── __init__.py │ └── bar │ ├── __init__.py │ └── hello.py └── setup.py
When using the python-pylint
syntax checker, Flycheck would find
the file .pylintrc and pass it to pylint
. This file
could then contain project-wide style settings for your Python code.
You can change the default procedure for locating configuration files by
adding or replacing functions in
flycheck-locate-config-file-functions
:
Functions to locate configuration files.
Each function accepts two arguments value and checker. value is the value of the configuration file variable, and checker is the syntax checker to locate a configuration file for. The function shall either return a string with the absolute path to an existing configuration file, or nil if it could not locate the file.
Flycheck calls the functions in order of appearance, until the first function returns nil. If all functions return nil, no configuration file is given to the syntax checker.
Note: The formats of configuration files are specific to each syntax checker. Please consult the documentation of the corresponding checker tool for information about the configuration file format understood by the tool.
Like syntax checker options (see Syntax checker options) you can set these variables with file or directory variables. See (emacs)File Variables, and (emacs)Directory Variables respectively, for more information.
Occasionally, you need to point Flycheck to a different executable when
running a syntax checker. For instance, you might want to use
gcc-4.9
to check your C code, or use pylint
from a
specific virtualenv.
For these situations, each syntax checker has a buffer-local,
customizable variable named flycheck-checker-executable
,
where checker is the name of the syntax checker. The value of
this variable is either nil, or a string. In the former case, Flycheck
uses the default executable from the syntax checker definition when
executing the syntax checker. In the latter case, it uses the value of
the variable as executable.
You can either set these variables directly in your init file, or change them interactively:
Set the executable of a syntax checker in the current buffer.
Prompt for a syntax checker and an executable file, and set the executable variable of the syntax checker.
Reset the executable of a syntax checker in the current buffer.
Prompt for a syntax checker and reset its executable to the default.
Next: Flycheck hooks, Previous: Usage, Up: Top [Index]
This chapter explains how to add new syntax checkers and how to extend built-in syntax checkers, by example. See Flycheck API, for a detailed reference on the involved types, functions and macros.
If you define a new syntax checker or have an extension to a built-in syntax checker, please report it to Flycheck (see Issues), so that we can consider it for inclusion to make it available to all other users of Flycheck.
• Defining syntax checkers: | How to define new syntax checkers | |
• Finding error patterns: | How to find error patterns for a checker | |
• Trying new checkers: | How to try a new syntax checker | |
• Registering new checkers: | How to register for automatic selection | |
• Parsing structured output: | How to parse structured output like XML | |
• Passing configuration to checkers: | How to make syntax checkers configurable | |
• Controlling use of checkers: | How to control when checkers are used | |
• Applying multiple checkers: | How to use more than one checker per buffer |
Next: Finding error patterns, Up: Syntax checker definitions [Index]
Flycheck provides the macro flycheck-define-checker
to define a
new syntax checker. The following example defines a simple syntax
checker for the popular Rubocop tool for
Ruby:
(flycheck-define-checker ruby-rubocop "A Ruby syntax and style checker using the RuboCop tool. See URL `http://batsov.com/rubocop/'." :command ("rubocop" "--display-cop-names" "--format" "emacs" (config-file "--config" flycheck-rubocoprc) (option-flag "--lint" flycheck-rubocop-lint-only) "--stdin" source-original) :standard-input t :error-patterns ((info line-start (file-name) ":" line ":" column ": C: " (optional (id (one-or-more (not (any ":")))) ": ") (message) line-end) (warning line-start (file-name) ":" line ":" column ": W: " (optional (id (one-or-more (not (any ":")))) ": ") (message) line-end) (error line-start (file-name) ":" line ":" column ": " (or "E" "F") ": " (optional (id (one-or-more (not (any ":")))) ": ") (message) line-end)) :modes (enh-ruby-mode ruby-mode) :next-checkers ((warning . ruby-rubylint)))
The first argument to flycheck-define-checker
is the name
of a syntax checker, by which we can refer to this particular syntax
checker.
Next comes the docstring, which should provide a bit of
information about the syntax checker. It’s a good idea to provide a
link to the homepage of the syntax checker tool here. You can view this
docstring in Emacs with flycheck-describe-checker
at
C-c ! ?, e.g. C-c ! ? ruby-rubocop.
Eventually we specify the properties of the new syntax checker. These properties tell Flycheck when to use your new syntax checker, how to run it, and how to parse its output:
:command
specifies the command Flycheck should run to check
the buffer. It’s a simple list containing the executable and its
arguments.
In the example above we pass a couple of arguments to rubocop
to configure its output format. Next come two options: The special
config-file
cell takes the name of a configuration file from the
given variable, searches it and passes the path—if found—to the syntax
checker. The option-flag
cell passes the given argument to the
syntax checker if the given variable is non-nil.
At last we specify --stdin
to make Rubocop read source code
from standard input. The special source-original
symbol gives
the name of the file being checked to Rubocop; Rubocop uses this name in
its error output.
For a complete list of all special symbols refer to the function
flycheck-substitute-argument
.
:standard-input t
makes Flycheck send the contents of the buffer
via standard input. This is the preferred way to pass buffer contents
to syntax checkers.
For syntax checkers that can’t read from standard input Flycheck
provides the special source
and source-inplace
argument
symbols for the :command
property. These argument symbols create
temporary files in the system temp directory or beneath the original
file respectively and give pass them to the syntax checker upon
invocation.
:error-patterns
tell Flycheck how to parse the output of the
command in order to obtain error locations. Each pattern has a
level, followed by rx
forms which specify a regular
expression to find an error in the output of the command.
Flycheck understands three error levels by default: error
is for
critical errors that absolutely require the user’s attention
(e.g. syntax errors), warning
is for issues that can be ignored,
but should not (e.g. unused variables), and info
is for other
messages that provide information about the buffer, but do not
immediately require action from the user.
flycheck-define-error-level
lets you define custom error levels.
Flycheck provides special rx
forms to extract the relevant
information from each error:
(file-name)
and (message)
forms match a sequence of
any character save new line as file name and message of the error. Both
optionally accept further rx
forms, to specify an alternative
regular expression to match the file name or the message, for instance
to parse multi-line error messages.
line
and column
forms match a sequence of one or more
digits as line and column respectively of the error.
See the docstring of the function rx
, for a list of all standard
rx
forms, and the docstring of the function
flycheck-rx-to-string
for a list of all special Flycheck forms.
:modes
property denotes the major modes in which Flycheck may
use this syntax checker. rubocop
checks Ruby code, so the
:modes
of our example specify ruby-mode
and
enh-ruby-mode
.
Next: Trying new checkers, Previous: Defining syntax checkers, Up: Syntax checker definitions [Index]
Finding the right error patterns is the hardest part of a syntax checker definition. For a first version, you just run the tool on a file, look at its output and write a regular expression to match it. M-x shell comes handy here.
However, as you start to debug and refine your patterns, this quickly
becomes cumbersome. Flycheck provides an easier way to test a syntax
checker: Evaluate the syntax checker definition with C-M-x and run
flycheck-compile
.
Run a syntax checker on the current buffer in a fresh Compilation Mode buffer. Prompt for a syntax checker to run.
This command runs the command like a normal syntax check would do, but instead of highlighting errors within the buffer it shows a new buffer in Compilation Mode, which contains the entire output of the command and highlights everything that matches a pattern. You can then refine the error pattern, and iterate through this process until the error pattern is complete.
The
re-builder
tool can help you to quickly develop patterns for the current output. It lets you interactively develop a regular expression while continously matching the current expression against the buffer contents. Startre-builder
with M-x re-builder, and switch to therx
syntax with C-c TAB. Then type yourrx
expression into the small window at the bottom, and observe how the matching parts of the buffer are highlighted.Note that
re-builder
does not support the special Flycheckrx
forms available in:error-patterns
. As such, you cannot directly type a Flycheck expression intore-builder
.
Sometimes however an output format doesn’t lend itself to error patterns. In this case, you need to write a more sophisticated parser yourself. See Parsing structured output, for more information.
Next: Registering new checkers, Previous: Finding error patterns, Up: Syntax checker definitions [Index]
After evaluating a syntax checker definition you can try whether it works for normal syntax checks by selecting it manually with C-c ! s or M-x flycheck-select-checker. If anything breaks, you can unselect the syntax checker again with C-u C-c ! s and fix the error without further affecting Flycheck.
Once you have confirmed that your new syntax checker works flawlessly, you can make it available for automatic syntax checking by registering it.
Next: Parsing structured output, Previous: Trying new checkers, Up: Syntax checker definitions [Index]
To register a new syntax checker for automatic syntax checking, just add
it to flycheck-checkers
:
(add-to-list 'flycheck-checkers 'python-pylint)
Flycheck will try all syntax checkers in this variable when checking a
buffer automatically, and check the buffer with the first syntax checker
in this list whose :modes
contains the current major mode.
Do not use
flycheck-checker
andflycheck-select-checker
to enable your own syntax checker in Flycheck extensions. They are reserved for user customization.Specifically, please do not provide a hook function which selects the syntax checker explicitly by assigning to
flycheck-checker
or by callingflycheck-select-checker
. In other words, this is bad:(defun enable-my-new-syntax-checker () (setq flycheck-checker 'my-new-syntax-checker) (flycheck-buffer)) (add-hook 'my-major-mode-hook #'enable-my-new-syntax-checker)This circumvents the entire automatic selection of Flycheck, and prevents the user from effectively customizing Flycheck.
Instead, just register your syntax checker in
flycheck-checkers
and let Flycheck automatically pick the best syntax checker. In other words, this is good:(add-to-list 'flycheck-checkers 'my-new-syntax-checker)
Next: Passing configuration to checkers, Previous: Registering new checkers, Up: Syntax checker definitions [Index]
If your syntax checker tool offers some structured output format as
alternative to human-readable free text, you can use an
:error-parser
function instead of writing an error pattern. For
instance, JSHint offers the widely spread
Checkstyle XML output format which Flycheck supports out of the box:
(flycheck-define-checker javascript-jshint "A JavaScript syntax and style checker using jshint. See URL `http://www.jshint.com'." :command ("jshint" "--checkstyle-reporter" source) :error-parser flycheck-parse-checkstyle :modes (js-mode js2-mode js3-mode))
As you can see, there are no patterns in this definition. Instead
Flycheck calls the function flycheck-parse-checkstyle
to parse
the output. This function parses the XML to extract the errors. It’s
built-in into Flycheck, so if your tool supports Checkstyle XML, error
parsing comes for free in Flycheck. See Error parsers,
for more information about error parsers.
Next: Controlling use of checkers, Previous: Parsing structured output, Up: Syntax checker definitions [Index]
Many linting tools provide a rich set of options to configure their analysis. Flycheck makes it easy to define proper Emacs options and map them to options of commands.
For instance, the Rubocop tool checks Ruby for semantic and stylistic issues. Since style is mainly a matter of taste, it has a special linting mode in which all stylistic checks are disabled (error patterns omitted for readability):
(flycheck-define-checker ruby-rubocop "A Ruby syntax and style checker using the RuboCop tool. See URL `http://batsov.com/rubocop/'." :command ("rubocop" "--format" "emacs" (option-flag "--lint" flycheck-rubocop-lint-only) source) :error-patterns ... :modes (ruby-mode))
Note the special option-flag
argument, which splices the value of
the boolean Emacs option flycheck-rubocop-lint-only
into the
command: If the variable is non-nil, Flycheck adds the --lint
option to the final command line, otherwise Flycheck omits the entire
argument.
Flycheck also supports other special option-
arguments for plain
values or lists of values. See Argument Substitution, for a list of
all special arguments.
Flycheck also provides a convenience macro
flycheck-def-option-var
to declare these options:
(flycheck-def-option-var flycheck-rubocop-lint-only nil ruby-rubocop "Whether to only report code issues in Rubocop. When non-nil, only report code issues in Rubocop, via `--lint'. Otherwise report style issues as well." :safe #'booleanp :type 'boolean)
Essentially, this macro is just a wrapper around the built-in
defcustom
, which additionally keeps track of the syntax checker
the option belongs to, and adds the option to the appropriate custom
group. You can pass arbitrary custom keywords to this macro as we did
in this example: :type
marks this option as boolean flag, and
:safe
allows the use as file-local variable, if the value is
boolean. See Syntax checker options, for more information about
syntax checker configuration, and Checker configuration, for the
corresponding API reference.
By a similar mechanism you can also pass paths to configuration files to a syntax checker tool. The aforementioned Pylint reads a configuration file for instance:
(flycheck-define-checker python-pylint "A Python syntax and style checker using Pylint. This syntax checker requires Pylint 1.0 or newer. See URL `http://www.pylint.org/'." ;; -r n disables the scoring report :command ("pylint" "-r" "n" "--msg-template" "{path}:{line}:{column}:{C}:{msg} ({msg_id})" (config-file "--rcfile" flycheck-pylintrc) source) :error-patterns ... :modes python-mode)
The special config-file
argument passes a configuration file from
flycheck-pylintrc
to pylint
, if the value of the
variable is non-nil.
Flycheck provides a sophisticated logic to find an appropriate configuration file. See Syntax checker configuration files, for more information about syntax checker configuration, and Checker configuration, for the corresponding API reference.
Next: Applying multiple checkers, Previous: Passing configuration to checkers, Up: Syntax checker definitions [Index]
If you need more control about when a syntax checker is used for syntax
checking, you can supply a custom :predicate
function. Consider
the following syntax checker for Zsh scripts in Sh Mode:
(flycheck-define-checker sh-zsh "A Zsh syntax checker using the Zsh shell. See URL `http://www.zsh.org/'." :command ("zsh" "-n" "-d" "-f" source) :error-patterns ((error line-start (file-name) ":" line ": " (message) line-end)) :modes sh-mode :predicate (lambda () (eq sh-shell 'zsh)))
Sh Mode also supports Bash and other shells besides Zsh, so we
additionally provide a :predicate
that checks whether the current
buffer has the right shell.
You can even omit :modes
and only use a predicate to determine
whether a syntax checker is applicable for the current buffer.
Previous: Controlling use of checkers, Up: Syntax checker definitions [Index]
Frequently, we would like to use multiple syntax checkers in a buffer.
For instance, we might want to check the syntax of a script with
sh-zsh
from the previous section, and then use
Shellcheck to check for questionable code
such as unquoted variable expansions, if there are no syntax errors.
Flycheck supports this scenario by chaining syntax checkers.
Suppose we defined a syntax checker for Shellcheck called SH-SHELLCHECK as follows:
(flycheck-define-checker sh-shellcheck "A shell script syntax and style checker using Shellcheck. See URL `https://github.com/koalaman/shellcheck/'." :command ("shellcheck" "-f" "checkstyle" "-s" (eval (symbol-name sh-shell)) source) :modes sh-mode :error-parser flycheck-parse-checkstyle)
Note how we use the special eval
argument to put the result of an
arbitrary Emacs Lisp expression into the command line of
shellcheck
, in order to tell Shellcheck what shell the script
is written for.
We can now arrange for this syntax checker to be used after
sh-zsh
with flycheck-add-next-checker
:
(flycheck-add-next-checker 'sh-zsh '(warning . sh-shellcheck))
The first item of the cons cell in the second argument is the
maximum error level in the buffer, for which sh-shellcheck
is still applicable. With warning
Flycheck will run
sh-shellcheck
after sh-zsh
if there are warning
or
info
level errors from sh-zsh
, but not if there are any
errors with level error
, such as syntax errors.
Flycheck will only use a chained syntax checker if it is registered in
flycheck-checkers
, so we need to register our new syntax checker
(see Registering new checkers):
(add-to-list 'flycheck-checkers 'sh-shellcheck 'append)
Note that unlike before we append the new syntax checker at the
end of flycheck-checkers
. This ensures that Flycheck does not
try sh-shellcheck
before sh-zsh
. Flycheck tries
all syntax checkers in this list in order of appearance, so if
you add your new chained syntax checker at the beginning, it will likely
be used right away, before any prior syntax checkers.
You also can specify chained syntax checkers directly in
flycheck-define-checker
with the :next-checkers
property.
Instead of calling flycheck-add-next-checker
, we could also have
added this property to the definition of sh-zsh
:
(flycheck-define-checker sh-zsh "A Zsh syntax checker using the Zsh shell. See URL `http://www.zsh.org/'." :command ("zsh" "-n" "-d" "-f" source) :error-patterns ... :modes sh-mode :predicate (lambda () (eq sh-shell 'zsh)) :next-checkers ((warning . sh-shellcheck)))
If you control the definition of both syntax checkers, this style is
preferable to flycheck-add-next-checker
. Use the latter
only if you cannot change the definition of the prior syntax checker.
Next: Flycheck API, Previous: Syntax checker definitions, Up: Top [Index]
This chapter gives you a brief overview over Flycheck’s rich hook interface, which you can use for your own extensions.
flycheck-before-syntax-check-hook
and
flycheck-after-syntax-check-hook
run before and after syntax
checks, and let you update your Emacs instance according to Flycheck’s
state. For instance, flycheck-color-mode-line uses these hooks to colour your mode-line
according to the result of the last syntax check. Additionally,
flycheck-status-changed-functions
runs on every single status
change of Flycheck, and provides a fine-grained reporting about what
Flycheck is currently doing.
Flycheck uses the function given by the option
flycheck-executable-find
to search for executables, and passes
all syntax checker commands through
flycheck-command-wrapper-function
before running them. These
features let you adapt Flycheck to search executables and run commands
in sandboxed environments such as bundle exec
or
nix-shell
.
The functions in flycheck-process-error-functions
are used to
process new errors reported by a Flycheck syntax checker. Add to this
hook to get informed about each error reported in a Flycheck buffer. In
fact, Flycheck uses this hook itself: The standard value
flycheck-add-overlay
is responsible for adding error highlighting
to the buffer. As a consequence, you can entirely opt out from
highlighting with a custom hook.
The function flycheck-display-errors-function
is called to
display an error at point. The flycheck-pos-tip extension uses this hook to show errors in a GUI popup
like conventional IDEs do.
Next: Supported languages, Previous: Flycheck hooks, Up: Top [Index]
TODO: The API documentation still needs to be written.
• Command syntax checkers: | Syntax checkers with external commands | |
• Errors: | Error representation in Flycheck |
Next: Errors, Up: Flycheck API [Index]
• Argument Substitution: | Argument substitution in syntax checker commands | |
• Checker configuration: | Configuration for command checkers | |
• Error parsers: | Parsing structured output formats |
Next: Checker configuration, Up: Command syntax checkers [Index]
Next: Error parsers, Previous: Argument Substitution, Up: Command syntax checkers [Index]
Previous: Checker configuration, Up: Command syntax checkers [Index]
Previous: Command syntax checkers, Up: Flycheck API [Index]
Next: Getting Help, Previous: Flycheck API, Up: Top [Index]
This chapter lists the languages supported by Flycheck. 3rd party extensions may provide for more languages; please take a look at our list of extensions for more information.
Each language has one or more syntax checkers, whose names follow a convention of ‘language-tool’ where language is the programming language checked by the checker, and tool the name of the checker tool.
The syntax checkers are listed in the order they are applied to a
buffer. Use C-c ! ? (flycheck-describe-checker
) to obtain
more information about a syntax checker, and C-h v
(describe-variable
) to read the complete docstring of any option.
Flycheck supports the following languages:
ada-gnat
(GNAT), with the
following options:
flycheck-gnat-args
A list of additional arguments to GNAT.
flycheck-gnat-include-path
A list of include directories for GNAT. Relative paths are relative to the file being checked.
flycheck-gnat-language-standard
The language standard to use in GNAT, as string.
flycheck-gnat-warnings
A list of additional warnings to enable in GNAT. Each item is the name of a warning category to enable.
asciidoc
(AsciiDoc)
c/c++-clang
(syntax and type check with
Clang) or c/c++-gcc
(syntax and
type check with GCC), and
c/c++-cppcheck
(style and error check with
cppcheck).
c/c++-clang
and c/c++-gcc
provide the following options:
flycheck-clang-args
flycheck-gcc-args
A list of additional arguments for Clang/GCC.
flycheck-clang-blocks
Whether to enable blocks in Clang.
flycheck-clang-definitions
flycheck-gcc-definitions
A list of additional preprocessor definitions for Clang/GCC.
flycheck-clang-include-path
flycheck-gcc-include-path
A list of include directories for Clang/GCC, relative to the file being checked.
flycheck-clang-includes
flycheck-gcc-includes
A list of additional include files for Clang/GCC, relative to the file being checked.
flycheck-clang-language-standard
flycheck-gcc-language-standard
The language standard to use in Clang/GCC, as string, via the -std option.
flycheck-clang-ms-extensions
Whether to enable Microsoft extensions to C/C++ in Clang.
flycheck-clang-no-exceptions
flycheck-gcc-no-exceptions
Whether to disable exceptions in Clang/GCC.
flycheck-clang-no-rtti
flycheck-gcc-no-rtti
Whether to disable RTTI in Clang/GCC, via -fno-rtti.
flycheck-clang-standard-library
The name of the standard library to use for Clang, as string.
flycheck-gcc-openmp
Whether to enable OpenMP in GCC.
flycheck-clang-pedantic
flycheck-gcc-pedantic
Whether to warn about language extensions in Clang/GCC.
flycheck-clang-pedantic-errors
flycheck-gcc-pedantic-errors
Whether to error on language extensions in Clang/GCC.
flycheck-clang-warnings
flycheck-gcc-warnings
A list of additional warnings to enable in Clang. Each item is the name of a warning or warning category for -W.
c/c++-cppcheck
provides the following options:
flycheck-cppcheck-checks
A list of enabled checks for cppcheck. Each item is the name of a check for the --enable option.
flycheck-cppcheck-inconclusive
Whether to enable inconclusive checks in cppcheck. These checks may yield more false positives than normal checks.
flycheck-cppcheck-include-path
A list of include directories for cppcheck. Relative paths are relative to the file being checked.
flycheck-cppcheck-language-standard
The C or C++ language standard to use with cppcheck via --std=.
cfengine
(CFEngine)
chef-foodcritic
(style check with
foodcritic), with the
following option:
coffee
(syntax check with coffee)
coffee-coffeelint
(code style check with
coffeelint), with the following
option:
flycheck-coffeelintrc
Configuration file for coffeelint. See Syntax checker configuration files, for more information about configuration files.
coq
(Coq)
css-csslint
(style and error check with
CSSLint)
d-dmd
(DMD), with the following options:
The extension flycheck-d-unittest adds a syntax checker which runs D unittests on the fly and reports the results.
emacs-lisp
(syntax check with the built-in Emacs byte compiler)
emacs-lisp-checkdoc
(code and documentation check with
checkdoc
)
The extension flycheck-package adds a syntax checker which checks for violations of Emacs Lisp packaging conventions.
The emacs-lisp
checker provides the following options
flycheck-emacs-lisp-load-path
The load path to use while checking Emacs Lisp files, as list of
strings. Relative directories are expanded against the
default-directory
of the buffer being checked.
flycheck-emacs-lisp-initialize-packages
Whether to initialize Emacs’ package manager with
package-initialize
before checking the buffer. If set to
auto
(the default), only initialize the package managers for
files in under user-emacs-directory
.
flycheck-emacs-lisp-package-user-dir
The package directory for the Emacs Lisp checker, as string. Has no
effect if flycheck-emacs-lisp-initialize-packages
is nil.
erlang
(Erlang)
eruby-erubis
(erubis
)
fortran-gfortran
(GFortran), with the
following options:
flycheck-gfortran-args
A list of additional arguments to GFortran.
flycheck-gfortran-include-path
A list of include directories for GFortran. Relative paths are relative to the file being checked.
flycheck-gfortran-language-standard
The language standard to use with GFortran, for the -std option.
flycheck-gfortran-layout
The source code layout to use with GFortran. Set to free
or
fixed
for free or fixed layout respectively, or nil (the default)
to let GFortran automatically determine the layout.
flycheck-gfortran-warnings
A list of warnings enabled for GFortran, via the -W option.
go-gofmt
(syntax check with
gofmt)
go-golint
(coding style with
Golint)
go-vet
(check for suspicious code with
go tool
vet
)
go-build
or go-test
(syntax and type check with
Go, for source and tests
respectively)
go-errcheck
(check for unhandled error returns with
errcheck)
go-vet
provides the following option:
flycheck-go-build-install-deps
Whether to install dependencies while checking with go build
.
flycheck-go-build-tags
A list of tags for go build
.
flycheck-go-vet-print-functions
A list of print-like functions for go vet. Go vet will check these functions for format string problems.
flycheck-go-vet-shadow
Whether to check for shadowed variables in go vet, in Go 1.6 or newer.
groovy
(syntax check using groovy compiler API (http://www.groovy-lang.org/))
haml
(Haml)
handlebars
(Handlebars)
haskell-hlint
(style checker with
hlint), with the
following options:
flycheck-hlint-args
A list of additional arguments for Hlint.
flycheck-hlint-language-extensions
Extensions list.
flycheck-hlint-ignore-rules
Ignore rules list.
flycheck-hlint-hint-packages
Hint packages to include.
flycheck-hlintrc
Configuration file for hlint. See Syntax checker configuration files, for more information about configuration files.
The extension flycheck-haskell configures Flycheck from the current Cabal project, and adds support for Cabal sandboxes. The extension flycheck-hdevtools adds an alternative syntax checker for
haskell-ghc
using hdevtools.
The haskell-ghc
checker provides the following options:
flycheck-ghc-args
A list of additional arguments for GHC.
flycheck-ghc-no-user-package-database
Whether to disable the user package database in GHC.
flycheck-ghc-package-databases
A list of additional package databases for GHC. Each item points to a directory containing a package directory, for the -package-db option.
flycheck-ghc-search-path
A list of module directories for GHC, via the -i option.
flycheck-ghc-language-extensions
A list of language extensions for GHC, via -X.
html-tidy
(Tidy HTML5),
with the following option:
flycheck-tidyrc
Configuration file for Tidy. See Syntax checker configuration files, for more information about configuration files.
jade
(using Jade)
javascript-jshint
(JSHint),
javascript-eslint
(ESLint),
javascript-gjslint
(Closure Linter)
javascript-jscs
(JSCS)
javascript-standard
(Standard or
Semistandard)
These checkers provide the following option:
flycheck-eslint-rulesdir
A directory with custom rules for ESLint.
flycheck-jshint-extract-javascript
Whether to extract Javascript from HTML before linting with JSHint.
flycheck-eslintrc
Configuration file for ESLint. See Syntax checker configuration files, for more information about configuration files.
flycheck-jshintrc
Configuration file for JSHint. See Syntax checker configuration files, for more information about configuration files.
flycheck-gjslintrc
Configuration file for Closure Linter. See Syntax checker configuration files, for more information about configuration files.
flycheck-jscsrc
Configuration file for JSCS. See Syntax checker configuration files, for more information about configuration files.
json-jsonlint
(jsonlint)
json-python-json
(Python json.tool module)
less
(less)
luacheck
(Luacheck)
with the following option:
flycheck-luacheckrc
Configuration file for Luacheck. See Syntax checker configuration files, for more information about configuration files.
lua
(Lua compiler)
perl
(syntax check with the Perl
interpreter)
perl-perlcritic
(style and code check with
Perl::Critic)
These syntax checkers checker provide the following options:
flycheck-perl-include-path
A list of include directories for Perl, relative to the file being checked.
flycheck-perlcriticrc
Configuration file for Perl::Critic. See Syntax checker configuration files, for more information about configuration files.
flycheck-perlcritic-severity
The severity level for Perl::Critic, as integer for the --severity option of Perl::Critic.
php
(syntax check with
PHP CLI)
php-phpmd
(code check with PHP Mess
Detector)
php-phpcs
(style check with
PHP CodeSniffer)
These checkers provide the following options:
flycheck-phpmd-rulesets
A list of rule sets for PHP Mess Detector as strings. Each item is either the name of a default rule set, or the path to a custom rule set file.
flycheck-phpcs-standard
The coding standard for PHP CodeSniffer, either as name of a built-in standard, or as path to a standard specification.
processing
(using the Processing
command-line tool)
puppet-parser
(syntax check with Puppet)
puppet-lint
(style check with Puppet Lint)
puppet-lint
provides the following options:
flycheck-puppet-lint-rc
Configuration file for puppet-lint. See Syntax checker configuration files, for more information about configuration files.
flycheck-puppet-lint-disabled-checks
A list of Puppet Lint checks to disable.
python-flake8
(syntax and style checking with
flake8), or
python-pylint
(syntax and style checking with
Pylint), or
python-pycompile
(syntax checking with Python’s
built-in byte
compiler, as last resort)
The extension flycheck-pyflakes adds a syntax checker using Pyflakes.
python-flake8
provides the following options:
flycheck-flake8-error-level-alist
An alist mapping Flake8 error IDs to Flycheck error levels.
flycheck-flake8-maximum-complexity
The maximum McCabe complexity of methods allowed by Flake8.
flycheck-flake8-maximum-line-length
The maximum length of lines for Flake8.
flycheck-flake8rc
Configuration file for Flake8. See Syntax checker configuration files, for more information about configuration files.
python-pylint
provides the following options:
flycheck-pylint-use-symbolic-id
A boolean indicating whether to report symbolic or numeric message identifiers. For example, whether to report a message type as no-name-in-module, or E0611. On by default.
flycheck-pylintrc
Configuration file for Pylint. See Syntax checker configuration files, for more information about configuration files.
r-lintr
(syntax and style check with
lintr), with the following options:
racket
(syntax checker with raco expand
, requires the
compiler-lib
package)
rpm-rpmlint
(rpmlint)
rst-sphinx
(using Sphinx, for Sphinx
documentation files), or
rst
(using docutils, for
plain reStructuredFiles files)
rst-sphinx
provides the following option:
flycheck-sphinx-warn-on-missing-references
Whether to emit warnings for all missing references in Sphinx.
ruby-rubocop
(syntax and style check using
RuboCop)
ruby-rubylint
(syntax and style check using
ruby-lint)
These checkers provide the following options
flycheck-rubocop-lint-only
Whether to suppress warnings about style issues in Rubocop, via the --lint option.
flycheck-rubocoprc
Configuration file for Rubocop. See Syntax checker configuration files, for more information about configuration files.
flycheck-rubylintrc
Configuration file for ruby-lint. See Syntax checker configuration files, for more information about configuration files.
If none of the above is available, Flycheck will fall back to one of the following checkers for very basic checking:
ruby
(using the standard Ruby
interpreter), or
ruby-jruby
(using JRuby)
rust-cargo
(using the Cargo), or
rust
(using the Rust compiler)
These checkers provide the following options:
flycheck-rust-args
A list of additional arguments for the Rust compiler rustc
.
flycheck-rust-check-tests
Whether to check test code in Rust.
flycheck-rust-crate-root
A path to the crate root for the current buffer, or nil if the current
buffer is a crate by itself. rust-cargo
ignores this option, as
the crate root comes from Cargo.
flycheck-rust-crate-type
The type of the crate to check, as string for the --crate-type option.
flycheck-rust-library-path
A list of additional library directories for Rust. Relative paths are relative to the buffer being checked.
The flycheck-rust extension configures Flycheck according to the current Cargo project.
sass
(using the standard Sass
processor), with the following option:
scala
(syntax and type check using the
Scala compiler)
scala-scalastyle
(style check using
Scalastyle)
The scala-scalastyle
syntax checker needs the following option:
flycheck-scalastylerc
Configuration file for Scalastyle. See Syntax checker configuration files, for more information about configuration files.
If this option is not set, or if the configuration file was not found
scala-scalastyle
will not be used.
scss-lint
(using SCSS-Lint), or
scss
(using the standard SCSS
processor)
These syntax checkers provide the following options:
flycheck-scss-compass
Whether to enable the Compass CSS framework in SCSS, via --compass.
flycheck-scss-lintrc
Configuration file for SCSS-Lint. See Syntax checker configuration files, for more information about configuration files.
sh-shellcheck
(code and style check using
ShellCheck)
sh-shellcheck
provides the following option:
flycheck-shellcheck-excluded-warnings
A list of excluded warnings for ShellCheck.
slim
(using Slim)
sql-sqlint
(using Sqlint)
tex-chktex
provides the following option:
flycheck-chktexrc
Configuration file for ChkTeX. See Syntax checker configuration files, for more information about configuration files.
texinfo
(using
makeinfo)
verilog-verilator
(using
Verilator)
verilog-verilator
provides the following options:
flycheck-verilator-include-path
A list of include directories for Verilator. Relative paths are relative to the file being checked.
xml-xmlstarlet
(using XMLStarlet),
or
xml-xmllint
(using xmllint)
yaml-jsyaml
(using
js-yaml), or
yaml-ruby
(using Ruby’s YAML parser)
Next: GNU Free Documentation License, Previous: Supported languages, Up: Top [Index]
Please ask questions about Flycheck on Stack Exchange or in our Gitter channel. We try to answer all questions as fast and as precise as possible.
To report problems or bugs, please use our issue tracker. Our Contribution Guidelines help you to create good bug reports; please take a look.
We welcome patches and pull requests that fix bugs or provide new features. Please read our Contribution Guidelines for help and guidelines before submitting pull requests. When making larger changes to Flycheck or implementing new features we recommend that you first open a separate issue or ask in our Gitter channel to discuss you intended changes.
Please follow our Code of Conduct in all our communication channels.
Next: Main Index, Previous: Getting Help, Up: Top [Index]
Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. http://fsf.org/ Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
The purpose of this License is to make a manual, textbook, or other functional and useful document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.
This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.
We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.
This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.
A “Modified Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.
A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document’s overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.
The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.
The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.
A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not “Transparent” is called “Opaque”.
Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.
The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, “Title Page” means the text near the most prominent appearance of the work’s title, preceding the beginning of the body of the text.
The “publisher” means any person or entity that distributes copies of the Document to the public.
A section “Entitled XYZ” means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of such a section when you modify the Document means that it remains a section “Entitled XYZ” according to this definition.
The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.
You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and you may publicly display copies.
If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document’s license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.
If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.
You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:
If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version’s license notice. These titles must be distinct from any other section titles.
You may add a section Entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.
You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.
You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled “History” in the various original documents, forming one section Entitled “History”; likewise combine any sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You must delete all sections Entitled “Endorsements.”
You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.
A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an “aggregate” if the copyright resulting from the compilation is not used to limit the legal rights of the compilation’s users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document’s Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.
Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail.
If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”, the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.
You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License.
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it.
The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License “or any later version” applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that proxy’s public statement of acceptance of a version permanently authorizes you to choose that version for the Document.
“Massive Multiauthor Collaboration Site” (or “MMC Site”) means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A “Massive Multiauthor Collaboration” (or “MMC”) contained in the site means any set of copyrightable works thus published on the MMC site.
“CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization.
“Incorporate” means to publish or republish a Document, in whole or in part, as part of another Document.
An MMC is “eligible for relicensing” if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008.
The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing.
To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:
Copyright (C) year your name. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''.
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the “with…Texts.” line with this:
with the Invariant Sections being list their titles, with the Front-Cover Texts being list, and with the Back-Cover Texts being list.
If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation.
If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.
Next: Key Index, Previous: GNU Free Documentation License, Up: Top [Index]
Jump to: | A C D E F G H I J L M O P R S T V W X Y |
---|
Jump to: | A C D E F G H I J L M O P R S T V W X Y |
---|
Next: Function and Variable Index, Previous: Main Index, Up: Top [Index]
Jump to: | C M |
---|
Jump to: | C M |
---|
Jump to: | D F G L |
---|
Jump to: | D F G L |
---|