From: Andreas Gerler Date: Tue, 14 Jul 2015 20:58:47 +0000 (+0200) Subject: new version of flycheck. X-Git-Url: http://git.bundesbrandschatzamt.de/?a=commitdiff_plain;h=c87dd44dc24d73598447378e364c824a7f686a0e;p=emacsconfig.git new version of flycheck. --- diff --git a/bba.org b/bba.org index b8bf9d19..358be589 100644 --- a/bba.org +++ b/bba.org @@ -259,7 +259,7 @@ snippets. Some help for Perl and even for org-mode. #+BEGIN_SRC emacs-lisp (if (>= emacs-major-version 24) (progn - (add-to-list 'load-path "~/.emacs.d/elpa/flycheck-20150125.601") + (add-to-list 'load-path "~/.emacs.d/elpa/flycheck-20150703.359") (require 'flycheck) (add-hook 'after-init-hook #'global-flycheck-mode) )) diff --git a/elpa/flycheck-20150125.601/dir b/elpa/flycheck-20150125.601/dir deleted file mode 100644 index 1443f763..00000000 --- a/elpa/flycheck-20150125.601/dir +++ /dev/null @@ -1,18 +0,0 @@ -This is the file .../info/dir, which contains the -topmost node of the Info hierarchy, called (dir)Top. -The first time you invoke Info you start off looking at this node. - -File: dir, Node: Top This is the top of the INFO tree - - This (the Directory node) gives a menu of major topics. - Typing "q" exits, "?" lists all Info commands, "d" returns here, - "h" gives a primer for first-timers, - "mEmacs" visits the Emacs manual, etc. - - In Emacs, you can click mouse button 2 on a menu item or cross reference - to select it. - -* Menu: - -Emacs -* flycheck: (flycheck.info). On the fly syntax checking for GNU Emacs diff --git a/elpa/flycheck-20150125.601/flycheck-autoloads.el b/elpa/flycheck-20150125.601/flycheck-autoloads.el deleted file mode 100644 index dba13240..00000000 --- a/elpa/flycheck-20150125.601/flycheck-autoloads.el +++ /dev/null @@ -1,227 +0,0 @@ -;;; flycheck-autoloads.el --- automatically extracted autoloads -;; -;;; Code: - - -;;;### (autoloads (flycheck-def-option-var flycheck-def-config-file-var -;;;;;; flycheck-define-command-checker flycheck-define-error-level -;;;;;; global-flycheck-mode flycheck-mode flycheck-info) "flycheck" -;;;;;; "flycheck.el" (21701 7957 0 0)) -;;; Generated autoloads from flycheck.el - -(autoload 'flycheck-info "flycheck" "\ -Open the Flycheck manual. - -\(fn)" t nil) - -(autoload 'flycheck-mode "flycheck" "\ -Minor mode for on-the-fly syntax checking. - -When called interactively, toggle `flycheck-mode'. With prefix -ARG, enable `flycheck-mode' if ARG is positive, otherwise disable -it. - -When called from Lisp, enable `flycheck-mode' if ARG is omitted, -nil or positive. If ARG is `toggle', toggle `flycheck-mode'. -Otherwise behave as if called interactively. - -In `flycheck-mode' the buffer is automatically syntax-checked -using the first suitable syntax checker from `flycheck-checkers'. -Use `flycheck-select-checker' to select a checker for the current -buffer manually. - -\\{flycheck-mode-map} - -\(fn &optional ARG)" t nil) - -(defvar global-flycheck-mode nil "\ -Non-nil if Global-Flycheck mode is enabled. -See the command `global-flycheck-mode' for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `global-flycheck-mode'.") - -(custom-autoload 'global-flycheck-mode "flycheck" nil) - -(autoload 'global-flycheck-mode "flycheck" "\ -Toggle Flycheck mode in all buffers. -With prefix ARG, enable Global-Flycheck mode if ARG is positive; -otherwise, disable it. If called from Lisp, enable the mode if -ARG is omitted or nil. - -Flycheck mode is enabled in all buffers where -`flycheck-mode-on-safe' would do it. -See `flycheck-mode' for more information on Flycheck mode. - -\(fn &optional ARG)" t nil) - -(autoload 'flycheck-define-error-level "flycheck" "\ -Define a new error LEVEL with PROPERTIES. - -The following PROPERTIES constitute an error level: - -`:severity SEVERITY' - A number denoting the severity of this level. The higher - the number, the more severe is this level compared to other - levels. Defaults to 0. - - The severity is used by `flycheck-error-level-<' to - determine the ordering of errors according to their levels. - -`:overlay-category CATEGORY' - A symbol denoting the overlay category to use for error - highlight overlays for this level. See Info - node `(elisp)Overlay Properties' for more information about - overlay categories. - - A category for an error level overlay should at least define - the `face' property, for error highlighting. Other useful - properties for error level categories are `priority' to - influence the stacking of multiple error level overlays, and - `help-echo' to define a default error messages for errors - without messages. - -`:fringe-bitmap BITMAP' - A fringe bitmap symbol denoting the bitmap to use for fringe - indicators for this level. See Info node `(elisp)Fringe - Bitmaps' for more information about fringe bitmaps, - including a list of built-in fringe bitmaps. - -`:fringe-face FACE' - A face symbol denoting the face to use for fringe indicators - for this level. - -`:error-list-face FACE' - A face symbol denoting the face to use for messages of this - level in the error list. See `flycheck-list-errors'. - -\(fn LEVEL &rest PROPERTIES)" nil nil) - -(put 'flycheck-define-error-level 'lisp-indent-function '1) - -(autoload 'flycheck-define-command-checker "flycheck" "\ -Define SYMBOL as syntax checker which runs a command. - -Define SYMBOL as generic syntax checker via -`flycheck-define-generic-checker', which uses an external command -to check the buffer. SYMBOL and DOCSTRING are the same as for -`flycheck-define-generic-checker'. - -In addition to the properties understood by -`flycheck-define-generic-checker', the following PROPERTIES -constitute a command syntax checker. Unless otherwise noted, all -properties are mandatory. Note that the default `:error-filter' -of command checkers is `flycheck-sanitize-errors'. - -`:command COMMAND' - The command to run for syntax checking. - - COMMAND is a list of the form `(EXECUTABLE [ARG ...])'. - - EXECUTABLE is a string with the executable of this syntax - checker. It can be overridden with the variable - `flycheck-SYMBOL-executable'. Note that this variable is - NOT implicitly defined by this function. Use - `flycheck-def-executable-var' to define this variable. - - Each ARG is an argument to the executable, either as string, - or as special symbol or form for - `flycheck-substitute-argument', which see. - -`:error-patterns PATTERNS' - A list of patterns to parse the output of the `:command'. - - Each ITEM in PATTERNS is a list `(LEVEL SEXP ...)', where - LEVEL is a Flycheck error level (see - `flycheck-define-error-level'), followed by one or more RX - `SEXP's which parse an error of that level and extract line, - column, file name and the message. - - See `rx' for general information about RX, and - `flycheck-rx-to-string' for some special RX forms provided - by Flycheck. - - All patterns are applied in the order of declaration to the - whole output of the syntax checker. Output already matched - by a pattern will not be matched by subsequent patterns. In - other words, the first pattern wins. - - This property is optional. If omitted, however, an - `:error-parser' is mandatory. - -`:error-parser FUNCTION' - A function to parse errors with. - - The function shall accept three arguments OUTPUT CHECKER - BUFFER. OUTPUT is the syntax checker output as string, - CHECKER the syntax checker that was used, and BUFFER a - buffer object representing the checked buffer. The function - must return a list of `flycheck-error' objects parsed from - OUTPUT. - - This property is optional. If omitted, it defaults to - `flycheck-parse-with-patterns'. In this case, - `:error-patterns' is mandatory. - -Note that you may not give `:start', `:interrupt', and -`:print-doc' for a command checker. You can give a custom -`:verify' function, but you should take care to call -`flycheck-verify-command-checker' in a custom `:verify' -function. - -\(fn SYMBOL DOCSTRING &rest PROPERTIES)" nil nil) - -(put 'flycheck-define-command-checker 'lisp-indent-function '1) - -(put 'flycheck-define-command-checker 'doc-string-elt '2) - -(autoload 'flycheck-def-config-file-var "flycheck" "\ -Define SYMBOL as config file variable for CHECKER, with default FILE-NAME. - -SYMBOL is declared as customizable variable using `defcustom', to -provide a configuration file for the given syntax CHECKER. -CUSTOM-ARGS are forwarded to `defcustom'. - -FILE-NAME is the initial value of the new variable. If omitted, -the default value is nil. - -Use this together with the `config-file' form in the `:command' -argument to `flycheck-define-checker'. - -\(fn SYMBOL CHECKER &optional FILE-NAME &rest CUSTOM-ARGS)" nil t) - -(put 'flycheck-def-config-file-var 'lisp-indent-function '3) - -(autoload 'flycheck-def-option-var "flycheck" "\ -Define SYMBOL as option variable with INIT-VALUE for CHECKER. - -SYMBOL is declared as customizable variable using `defcustom', to -provide an option for the given syntax CHECKER. INIT-VALUE is -the initial value of the variable, and DOCSTRING is its -docstring. CUSTOM-ARGS are forwarded to `defcustom'. - -Use this together with the `option', `option-list' and -`option-flag' forms in the `:command' argument to -`flycheck-define-checker'. - -\(fn SYMBOL INIT-VALUE CHECKER DOCSTRING &rest CUSTOM-ARGS)" nil t) - -(put 'flycheck-def-option-var 'lisp-indent-function '3) - -(put 'flycheck-def-option-var 'doc-string-elt '4) - -;;;*** - -;;;### (autoloads nil nil ("flycheck-ert.el" "flycheck-pkg.el") (21701 -;;;;;; 7957 765828 0)) - -;;;*** - -(provide 'flycheck-autoloads) -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; flycheck-autoloads.el ends here diff --git a/elpa/flycheck-20150125.601/flycheck-ert.el b/elpa/flycheck-20150125.601/flycheck-ert.el deleted file mode 100644 index 120fc6e5..00000000 --- a/elpa/flycheck-20150125.601/flycheck-ert.el +++ /dev/null @@ -1,469 +0,0 @@ -;;; flycheck-ert.el --- Flycheck: ERT extensions -*- lexical-binding: t; -*- - -;; Copyright (C) 2013-2015 Sebastian Wiesner - -;; Author: Sebastian Wiesner -;; URL: https://github.com/flycheck/flycheck - -;; This file is not part of GNU Emacs. - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Unit testing library for Flycheck, the modern on-the-fly syntax checking -;; extension for GNU Emacs. - -;; Provide various utility functions and unit test helpers to test Flycheck and -;; Flycheck extensions. - -;;; Code: - -(require 'flycheck) -(require 'ert) -(require 'macroexp) ; For macro utilities - - -;;; Compatibility - -(eval-and-compile - ;; Provide `ert-skip' and friends for Emacs 24.3 - (defconst flycheck-ert-ert-can-skip (fboundp 'ert-skip) - "Whether ERT supports test skipping.") - - (unless flycheck-ert-ert-can-skip - ;; Fake skipping - - (put 'flycheck-ert-skipped 'error-message "Test skipped") - (put 'flycheck-ert-skipped 'error-conditions '(error)) - - (defun ert-skip (data) - (signal 'flycheck-ert-skipped data)) - - (defmacro skip-unless (form) - `(unless (ignore-errors ,form) - (signal 'flycheck-ert-skipped ',form))) - - (defun ert-test-skipped-p (result) - (and (ert-test-failed-p result) - (eq (car (ert-test-failed-condition result)) - 'flycheck-ert-skipped))))) - - -;;; Internal variables - -(defvar flycheck-ert--resource-directory nil - "The directory to get resources from in this test suite.") - - -;;; Resource management macros - -(defmacro flycheck-ert-with-temp-buffer (&rest body) - "Eval BODY within a temporary buffer. - -Like `with-temp-buffer', but resets the modification state of the -temporary buffer to make sure that it is properly killed even if -it has a backing file and is modified." - (declare (indent 0)) - `(with-temp-buffer - (unwind-protect - ,(macroexp-progn body) - ;; Reset modification state of the buffer, and unlink it from its backing - ;; file, if any, because Emacs refuses to kill modified buffers with - ;; backing files, even if they are temporary. - (set-buffer-modified-p nil) - (set-visited-file-name nil 'no-query)))) - -(defmacro flycheck-ert-with-file-buffer (file-name &rest body) - "Create a buffer from FILE-NAME and eval BODY. - -BODY is evaluated with `current-buffer' being a buffer with the -contents FILE-NAME." - (declare (indent 1)) - `(let ((file-name ,file-name)) - (unless (file-exists-p file-name) - (error "%s does not exist" file-name)) - (flycheck-ert-with-temp-buffer - (insert-file-contents file-name 'visit) - (set-visited-file-name file-name 'no-query) - (cd (file-name-directory file-name)) - ;; Mark the buffer as not modified, because we just loaded the file up to - ;; now. - (set-buffer-modified-p nil) - ,@body))) - -(defmacro flycheck-ert-with-help-buffer (&rest body) - "Execute BODY and kill the help buffer afterwards. - -Use this macro to test functions that create a Help buffer." - (declare (indent 0)) - `(unwind-protect - ,(macroexp-progn body) - (when (buffer-live-p (get-buffer (help-buffer))) - (kill-buffer (help-buffer))))) - -(defmacro flycheck-ert-with-global-mode (&rest body) - "Execute BODY with Global Flycheck Mode enabled. - -After BODY, restore the old state of Global Flycheck Mode." - (declare (indent 0)) - `(let ((old-state global-flycheck-mode)) - (unwind-protect - (progn - (global-flycheck-mode 1) - ,@body) - (global-flycheck-mode old-state)))) - -(defmacro flycheck-ert-with-env (env &rest body) - "Add ENV to `process-environment' in BODY. - -Execute BODY with a `process-environment' with contains all -variables from ENV added. - -ENV is an alist, where each cons cell `(VAR . VALUE)' is a -environment variable VAR to be added to `process-environment' -with VALUE." - (declare (indent 1)) - `(let ((process-environment (copy-sequence process-environment))) - (pcase-dolist (`(,var . ,value) ,env) - (setenv var value)) - ,@body)) - - -;;; Test resources -(defun flycheck-ert-resource-filename (resource-file) - "Determine the absolute file name of a RESOURCE-FILE. - -Relative file names are expanded against -`flycheck-ert-resources-directory'." - (expand-file-name resource-file flycheck-ert--resource-directory)) - -(defmacro flycheck-ert-with-resource-buffer (resource-file &rest body) - "Create a temp buffer from a RESOURCE-FILE and execute BODY. - -The absolute file name of RESOURCE-FILE is determined with -`flycheck-ert-resource-filename'." - (declare (indent 1)) - `(flycheck-ert-with-file-buffer - (flycheck-ert-resource-filename ,resource-file) - ,@body)) - -(defun flycheck-ert-locate-config-file (filename _checker) - "Find a configuration FILENAME within unit tests. - -_CHECKER is ignored." - (let* ((directory (flycheck-ert-resource-filename "config-files")) - (filepath (expand-file-name filename directory))) - (when (file-exists-p filepath) - filepath))) - - -;;; Test suite initialization - -(defun flycheck-ert-initialize (resource-dir) - "Initialize a test suite with RESOURCE-DIR. - -RESOURCE-DIR is the directory, `flycheck-ert-resource-filename' -should use to lookup resource files." - (when flycheck-ert--resource-directory - (error "Test suite already initialized")) - (let ((tests (ert-select-tests t t))) - ;; Select all tests - (unless tests - (error "No tests defined. Call `flycheck-ert-initialize' after defining all tests!")) - - (setq flycheck-ert--resource-directory resource-dir) - - ;; Emacs 24.3 don't support skipped tests, so we add poor man's test - ;; skipping: We mark skipped tests as expected failures by adjusting the - ;; expected result of all test cases. Not particularly pretty, but works :) - (unless flycheck-ert-ert-can-skip - (dolist (test tests) - (let ((result (ert-test-expected-result-type test))) - (setf (ert-test-expected-result-type test) - `(or ,result (satisfies ert-test-skipped-p)))))))) - - -;;; Environment and version information - -(defconst flycheck-ert-user-error-type - (if (version< emacs-version "24.2") - 'error - 'user-error) - "The `user-error' type used by Flycheck.") - -(defun flycheck-ert-travis-ci-p () - "Determine whether we are running on Travis CI." - (string= (getenv "TRAVIS") "true")) - -(defun flycheck-ert-check-gpg () - "Check whether GPG is available." - (or (epg-check-configuration (epg-configuration)) t)) - -(defun flycheck-ert-extract-version-command (re executable &rest args) - "Use RE to extract the version from EXECUTABLE with ARGS. - -Run EXECUTABLE with ARGS, catch the output, and apply RE to find -the version number. Return the text captured by the first group -in RE, or nil, if EXECUTABLE is missing, or if RE failed to -match." - (-when-let (executable (executable-find executable)) - (with-temp-buffer - (apply #'call-process executable nil t nil args) - (goto-char (point-min)) - (when (re-search-forward re nil 'no-error) - (match-string 1))))) - - -;;; Test case definitions -(defmacro flycheck-ert-def-checker-test (checker language name - &rest keys-and-body) - "Define a test case for a syntax CHECKER for LANGUAGE. - -CHECKER is a symbol or a list of symbols denoting syntax checkers -being tested by the test. The test case is skipped, if any of -these checkers cannot be used. LANGUAGE is a symbol or a list of -symbols denoting the programming languages supported by the -syntax checkers. This is currently only used for tagging the -test appropriately. - -NAME is a symbol denoting the local name of the test. The test -itself is ultimately named -`flycheck-define-checker/CHECKER/NAME'. If CHECKER is a list, -the first checker in the list is used for naming the test. - -Optionally, the keyword arguments `:tags' and `:expected-result' -may be given. They have the same meaning as in `ert-deftest.', -and are added to the tags and result expectations set up by this -macro. - -The remaining forms denote the body of the test case, including -assertions and setup code." - (declare (indent 3)) - (unless checker - (error "No syntax checkers specified.")) - (unless language - (error "No languages specified")) - (let* ((checkers (if (symbolp checker) (list checker) checker)) - (checker (car checkers)) - (languages (if (symbolp language) (list language) language)) - (language-tags (mapcar (lambda (l) (intern (format "language-%s" l))) - languages)) - (checker-tags (mapcar (lambda (c) (intern (format "checker-%s" c))) - checkers)) - (local-name (or name 'default)) - (full-name (intern (format "flycheck-define-checker/%s/%s" - checker local-name))) - (keys-and-body (ert--parse-keys-and-body keys-and-body)) - (body (cadr keys-and-body)) - (keys (car keys-and-body)) - (default-tags '(syntax-checker external-tool))) - `(ert-deftest ,full-name () - :expected-result - (list 'or - '(satisfies flycheck-ert-syntax-check-timed-out-p) - ,(or (plist-get keys :expected-result) :passed)) - :tags (append ',(append default-tags language-tags checker-tags) - ,(plist-get keys :tags)) - ,@(mapcar (lambda (c) `(skip-unless - ;; Ignore non-command checkers - (or (not (get ',c 'flycheck-command)) - (executable-find (flycheck-checker-executable ',c))))) - checkers) - ,@body))) - - -;;; Test case results - -(defun flycheck-ert-syntax-check-timed-out-p (result) - "Whether RESULT denotes a timed-out test. - -RESULT is an ERT test result object." - (and (ert-test-failed-p result) - (eq (car (ert-test-failed-condition result)) - 'flycheck-ert-syntax-check-timed-out))) - - -;;; Syntax checking in tests - -(defvar-local flycheck-ert-syntax-checker-finished nil - "Non-nil if the current checker has finished.") - -(add-hook 'flycheck-after-syntax-check-hook - (lambda () (setq flycheck-ert-syntax-checker-finished t))) - -(defconst flycheck-ert-checker-wait-time 10 - "Time to wait until a checker is finished in seconds. - -After this time has elapsed, the checker is considered to have -failed, and the test aborted with failure.") - -(put 'flycheck-ert-syntax-check-timed-out 'error-message - "Syntax check timed out.") -(put 'flycheck-ert-syntax-check-timed-out 'error-conditions '(error)) - -(defun flycheck-ert-wait-for-syntax-checker () - "Wait until the syntax check in the current buffer is finished." - (let ((starttime (float-time))) - (while (and (not flycheck-ert-syntax-checker-finished) - (< (- (float-time) starttime) flycheck-ert-checker-wait-time)) - (sleep-for 1)) - (unless (< (- (float-time) starttime) flycheck-ert-checker-wait-time) - (flycheck-stop) - (signal 'flycheck-ert-syntax-check-timed-out nil))) - (setq flycheck-ert-syntax-checker-finished nil)) - -(defun flycheck-ert-buffer-sync () - "Like `flycheck-buffer', but synchronously." - (setq flycheck-ert-syntax-checker-finished nil) - (should (not (flycheck-running-p))) - (flycheck-mode) ; This will only start a deferred check, - (flycheck-buffer) ; so we need an explicit manual check - ;; After starting the check, the checker should either be running now, or - ;; already be finished (if it was fast). - (should (or flycheck-current-syntax-check - flycheck-ert-syntax-checker-finished)) - ;; Also there should be no deferred check pending anymore - (should-not (flycheck-deferred-check-p)) - (flycheck-ert-wait-for-syntax-checker)) - -(defun flycheck-ert-ensure-clear () - "Clear the current buffer. - -Raise an assertion error if the buffer is not clear afterwards." - (flycheck-clear) - (should (not flycheck-current-errors)) - (should (not (-any? (lambda (ov) (overlay-get ov 'flycheck-overlay)) - (overlays-in (point-min) (point-max)))))) - - -;;; Test assertions - -(defun flycheck-ert-should-overlay (error) - "Test that ERROR has a proper overlay in the current buffer. - -ERROR is a Flycheck error object." - (let* ((overlay (-first (lambda (ov) (equal (overlay-get ov 'flycheck-error) - error)) - (flycheck-overlays-in 0 (+ 1 (buffer-size))))) - (region (flycheck-error-region-for-mode error 'symbols)) - (message (flycheck-error-message error)) - (level (flycheck-error-level error)) - (category (flycheck-error-level-overlay-category level)) - (face (get category 'face)) - (fringe-bitmap (flycheck-error-level-fringe-bitmap level)) - (fringe-face (flycheck-error-level-fringe-face level)) - (fringe-icon (list 'left-fringe fringe-bitmap fringe-face))) - (should overlay) - (should (overlay-get overlay 'flycheck-overlay)) - (should (= (overlay-start overlay) (car region))) - (should (= (overlay-end overlay) (cdr region))) - (should (eq (overlay-get overlay 'face) face)) - (should (equal (get-char-property 0 'display - (overlay-get overlay 'before-string)) - fringe-icon)) - (should (eq (overlay-get overlay 'category) category)) - (should (equal (overlay-get overlay 'flycheck-error) error)) - (should (string= (overlay-get overlay 'help-echo) message)))) - -(defun flycheck-ert-should-errors (&rest errors) - "Test that the current buffers has ERRORS. - -ERRORS is a list of errors expected to be present in the current -buffer. Each error is given as a list of arguments to -`flycheck-error-new-at'. - -If ERRORS are omitted, test that there are no errors at all in -the current buffer. - -With ERRORS, test that each error in ERRORS is present in the -current buffer, and that the number of errors in the current -buffer is equal to the number of given ERRORS. In other words, -check that the buffer has all ERRORS, and no other errors." - (let ((expected (mapcar (apply-partially #'apply #'flycheck-error-new-at) - errors))) - (should (equal expected flycheck-current-errors)) - (mapc #'flycheck-ert-should-overlay expected)) - (should (= (length errors) - (length (flycheck-overlays-in (point-min) (point-max)))))) - -(defun flycheck-ert-should-syntax-check (resource-file modes &rest errors) - "Test a syntax check in RESOURCE-FILE with MODES. - -RESOURCE-FILE is the file to check. MODES is a single major mode -symbol or a list thereof, specifying the major modes to syntax -check with. If more than one major mode is specified, the test -is run for each mode separately, so if you give three major -modes, the entire test will run three times. ERRORS is the list -of expected errors, as in `flycheck-ert-should-errors'. If -omitted, the syntax check must not emit any errors. The errors -are cleared after each test. - -The syntax checker is selected via standard syntax checker -selection. To test a specific checker, you need to set -`flycheck-checker' or `flycheck-disabled-checkers' accordingly -before using this predicate, depending on whether you want to use -manual or automatic checker selection. - -During the syntax check, configuration files of syntax checkers -are also searched in the `config-files' sub-directory of the -resource directory." - (when (symbolp modes) - (setq modes (list modes))) - (dolist (mode modes) - (unless (fboundp mode) - (ert-skip (format "%S missing" mode))) - (flycheck-ert-with-resource-buffer resource-file - (funcall mode) - ;; Configure config file locating for unit tests - (dolist (fn '(flycheck-locate-config-file-absolute-path - flycheck-ert-locate-config-file)) - (add-hook 'flycheck-locate-config-file-functions fn 'append 'local)) - (let ((process-hook-called 0)) - (add-hook 'flycheck-process-error-functions - (lambda (_err) - (setq process-hook-called (1+ process-hook-called)) - nil) - nil :local) - (flycheck-ert-buffer-sync) - (apply #'flycheck-ert-should-errors errors) - (should (= process-hook-called (length errors)))) - (flycheck-ert-ensure-clear)))) - -(defun flycheck-ert-at-nth-error (n) - "Determine whether point is at the N'th Flycheck error. - -Return non-nil if the point is at the N'th Flycheck error in the -current buffer. Otherwise return nil." - (let* ((error (nth (1- n) flycheck-current-errors)) - (mode flycheck-highlighting-mode) - (region (flycheck-error-region-for-mode error mode))) - (and (member error (flycheck-overlay-errors-at (point))) - (= (point) (car region))))) - -(defun flycheck-ert-explain--at-nth-error (n) - (let ((errors (flycheck-overlay-errors-at (point)))) - (if (null errors) - (format "Expected to be at error %s, but no error at point %s" - n (point)) - (let ((pos (cl-position (car errors) flycheck-current-errors))) - (format "Expected to be at error %s, but point %s is at error %s" - n (point) (1+ pos)))))) - -(put 'flycheck-ert-at-nth-error 'ert-explainer - 'flycheck-ert-explain--at-nth-error) - -(provide 'flycheck-ert) - -;;; flycheck-ert.el ends here diff --git a/elpa/flycheck-20150125.601/flycheck-pkg.el b/elpa/flycheck-20150125.601/flycheck-pkg.el deleted file mode 100644 index 709a8f15..00000000 --- a/elpa/flycheck-20150125.601/flycheck-pkg.el +++ /dev/null @@ -1,11 +0,0 @@ -(define-package "flycheck" "20150125.601" "Modern on-the-fly syntax checking for GNU Emacs" - '((dash "2.4.0") - (pkg-info "0.4") - (let-alist "1.0.1") - (cl-lib "0.3") - (emacs "24.1")) - :url "https://www.flycheck.org" :keywords - '("convenience" "languages" "tools")) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/flycheck-20150125.601/flycheck.el b/elpa/flycheck-20150125.601/flycheck.el deleted file mode 100644 index 12224f64..00000000 --- a/elpa/flycheck-20150125.601/flycheck.el +++ /dev/null @@ -1,7259 +0,0 @@ -;;; flycheck.el --- Modern on-the-fly syntax checking for GNU Emacs -*- lexical-binding: t; -*- - -;; Copyright (c) 2012-2015 Sebastian Wiesner -;; Copyright (C) 2013, 2014 Free Software Foundation, Inc. -;; -;; Author: Sebastian Wiesner -;; URL: https://www.flycheck.org -;; Keywords: convenience languages tools -;; Version: 0.23-cvs -;; Package-Requires: ((dash "2.4.0") (pkg-info "0.4") (let-alist "1.0.1") (cl-lib "0.3") (emacs "24.1")) - -;; This file is not part of GNU Emacs. - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; Modern on-the-fly syntax checking for GNU Emacs. - -;; Provide `flycheck-mode' which enables on-the-fly syntax checking for a large -;; number of different modes and languages (see `flycheck-checkers' for a -;; complete list). -;; -;; Support for new modes and languages can be added by defining a new syntax -;; checker (see `flycheck-define-checker'). - -;;; Code: - -(eval-when-compile - (require 'let-alist) ; `let-alist' - (require 'cl-lib) ; `cl-defstruct' - (require 'compile) ; Compile Mode integration - (require 'package) ; Tell Emacs about package-user-dir - (require 'sh-script) ; `sh-shell' for sh checker predicates - (require 'jka-compr) ; For JKA workarounds in `flycheck-temp-file-system' - (require 'pcase) ; `pcase-dolist' (`pcase' itself is autoloaded) - ) - -(require 'dash) - -(require 'subr-x nil 'no-error) ; Additional utilities, Emacs 24.4 and upwards -(require 'tabulated-list) ; To list errors -(require 'easymenu) ; Flycheck Mode menu definition -(require 'rx) ; Regexp fanciness in `flycheck-define-checker' -(require 'help-mode) ; `define-button-type' -(require 'find-func) ; `find-function-regexp-alist' - -;; Tell the byte compiler about autoloaded functions from packages -(declare-function pkg-info-version-info "pkg-info" (package)) - - -;;; Compatibility -(eval-and-compile - ;; `defvar-local' Emacs 24.2 and below - (unless (fboundp 'defvar-local) - (defmacro defvar-local (var val &optional docstring) - "Define VAR as a buffer-local variable with default value VAL. -Like `defvar' but additionally marks the variable as being automatically -buffer-local wherever it is set." - (declare (debug defvar) (doc-string 3)) - `(progn - (defvar ,var ,val ,docstring) - (make-variable-buffer-local ',var)))) - - (unless (fboundp 'setq-local) - ;; `setq-local' for Emacs 24.2 and below - (defmacro setq-local (var val) - "Set variable VAR to value VAL in current buffer." - `(set (make-local-variable ',var) ,val))) - - (unless (fboundp 'user-error) - ;; `user-error' for Emacs 24.2 and below - (defalias 'user-error 'error) - - (add-to-list 'debug-ignored-errors - (rx string-start "No more Flycheck errors" string-end)) - (add-to-list 'debug-ignored-errors - (rx string-start "Flycheck mode disabled" string-end)) - (add-to-list 'debug-ignored-errors - (rx string-start "Configured syntax checker " - symbol-start (one-or-more not-newline) symbol-end - " cannot be used" string-end))) - - (unless (fboundp 'string-suffix-p) - ;; `string-suffix-p' for Emacs 24.3 and below - (defun string-suffix-p (suffix string &optional ignore-case) - "Return non-nil if SUFFIX is a suffix of STRING. -If IGNORE-CASE is non-nil, the comparison is done without paying -attention to case differences." - (let ((start-pos (- (length string) (length suffix)))) - (and (>= start-pos 0) - (eq t (compare-strings suffix nil nil - string start-pos nil ignore-case)))))) - - (unless (featurep 'subr-x) - ;; `subr-x' function for Emacs 24.3 and below - (defsubst string-join (strings &optional separator) - "Join all STRINGS using SEPARATOR." - (mapconcat 'identity strings separator)) - - (defsubst string-trim-left (string) - "Remove leading whitespace from STRING." - (if (string-match "\\`[ \t\n\r]+" string) - (replace-match "" t t string) - string)) - - (defsubst string-trim-right (string) - "Remove trailing whitespace from STRING." - (if (string-match "[ \t\n\r]+\\'" string) - (replace-match "" t t string) - string)) - - (defsubst string-trim (string) - "Remove leading and trailing whitespace from STRING." - (string-trim-left (string-trim-right string))) - - (defsubst string-empty-p (string) - "Check whether STRING is empty." - (string= string "")))) - -(when (and (not (get 'exclamation-mark 'fringe)) - (fboundp 'define-fringe-bitmap)) - ;; Provide `exclamation-mark' bitmap for Emacs 24.2 and below. We also check, - ;; whether `define-fringe-bitmap' is defined, because this function is not - ;; available if Emacs is built without GUI support. See - ;; https://github.com/flycheck/flycheck/issues/57 - (define-fringe-bitmap 'exclamation-mark - [24 60 60 24 24 0 0 24 24] nil nil 'center)) - - -;;; Customization -(defgroup flycheck nil - "Modern on-the-fly syntax checking for GNU Emacs." - :prefix "flycheck-" - :group 'tools - :link '(url-link :tag "Online manual" "http://flycheck.readthedocs.org") - :link '(url-link :tag "Github" "https://github.com/flycheck/flycheck") - :link '(custom-manual "(flycheck)Top") - :link '(info-link "(flycheck)Usage")) - -(defgroup flycheck-config-files nil - "Configuration files for on-the-fly syntax checkers." - :prefix "flycheck-" - :group 'flycheck - :link '(custom-manual "(flycheck)Syntax checker configuration files")) - -(defgroup flycheck-options nil - "Options for on-the-fly syntax checkers." - :prefix "flycheck-" - :group 'flycheck - :link '(custom-manual "(flycheck)Syntax checker options")) - -(defgroup flycheck-executables nil - "Executables of syntax checkers." - :prefix "flycheck-" - :group 'flycheck - :link '(custom-manual "(flycheck)Syntax checker executables")) - -(defgroup flycheck-faces nil - "Faces used by on-the-fly syntax checking." - :prefix "flycheck-" - :group 'flycheck - :link '(info-link "(flycheck)Error reporting")) - -(defcustom flycheck-checkers - '(ada-gnat - asciidoc - c/c++-clang - c/c++-gcc - c/c++-cppcheck - cfengine - chef-foodcritic - coffee - coffee-coffeelint - coq - css-csslint - d-dmd - elixir - emacs-lisp - emacs-lisp-checkdoc - erlang - eruby-erubis - fortran-gfortran - go-gofmt - go-golint - go-vet - go-build - go-test - go-errcheck - haml - handlebars - haskell-ghc - haskell-hlint - html-tidy - javascript-jshint - javascript-eslint - javascript-gjslint - json-jsonlint - less - lua - perl - perl-perlcritic - php - php-phpmd - php-phpcs - puppet-parser - puppet-lint - python-flake8 - python-pylint - python-pycompile - r-lintr - racket - rpm-rpmlint - rst - rst-sphinx - ruby-rubocop - ruby-rubylint - ruby - ruby-jruby - rust - sass - scala - scala-scalastyle - scss - sh-bash - sh-posix-dash - sh-posix-bash - sh-zsh - sh-shellcheck - slim - tex-chktex - tex-lacheck - texinfo - verilog-verilator - xml-xmlstarlet - xml-xmllint - yaml-jsyaml - yaml-ruby) - "Syntax checkers available for automatic selection. - -A list of Flycheck syntax checkers to choose from when syntax -checking a buffer. Flycheck will automatically select a suitable -syntax checker from this list, unless `flycheck-checker' is set, -either directly or with `flycheck-select-checker'. - -You should not need to change this variable normally. In order -to disable syntax checkers, please use -`flycheck-disabled-checkers'. This variable is intended for 3rd -party extensions to tell Flycheck about new syntax checkers. - -Syntax checkers in this list must be defined with -`flycheck-define-checker'." - :group 'flycheck - :type '(repeat (symbol :tag "Checker")) - :risky t) - -(defcustom flycheck-disabled-checkers nil - "Syntax checkers excluded from automatic selection. - -A list of Flycheck syntax checkers to exclude from automatic -selection. Flycheck will never automatically select a syntax -checker in this list, regardless of the value of -`flycheck-checkers'. - -However, syntax checkers in this list are still available for -manual selection with `flycheck-select-checker'. - -Use this variable to disable syntax checkers, instead of removing -the syntax checkers from `flycheck-checkers'. You may also use -this option as a file or directory local variable to disable -specific checkers in individual files and directories -respectively." - :group 'flycheck - :type '(repeat (symbol :tag "Checker")) - :package-version '(flycheck . "0.16") - :safe #'flycheck-symbol-list-p) -(make-variable-buffer-local 'flycheck-disabled-checkers) - -(defvar-local flycheck-checker nil - "Syntax checker to use for the current buffer. - -If unset or nil, automatically select a suitable syntax checker -from `flycheck-checkers' on every syntax check. - -If set to a syntax checker only use this syntax checker and never -select one from `flycheck-checkers' automatically. The syntax -checker is used regardless of whether it is contained in -`flycheck-checkers' or `flycheck-disabled-checkers'. If the -syntax checker is unusable in the current buffer an error is -signaled. - -A syntax checker assigned to this variable must be defined with -`flycheck-define-checker'. - -Use the command `flycheck-select-checker' to select a syntax -checker for the current buffer, or set this variable as file -local variable to always use a specific syntax checker for a -file. See Info Node `(emacs)Specifying File Variables' for more -information about file variables.") -(put 'flycheck-checker 'safe-local-variable 'flycheck-registered-checker-p) - -(defcustom flycheck-locate-config-file-functions - '(flycheck-locate-config-file-absolute-path - flycheck-locate-config-file-ancestor-directories - flycheck-locate-config-file-home) - "Functions to locate syntax checker configuration files. - -Each function in this hook must accept two arguments: The value -of the configuration file variable, and the syntax checker -symbol. It must return either a string with an absolute path to -the configuration file, or nil, if it cannot locate the -configuration file. - -The functions in this hook are called in order of appearance, until a -function returns non-nil. The configuration file returned by that -function is then given to the syntax checker if it exists. - -This variable is an abnormal hook. See Info -node `(elisp)Hooks'." - :group 'flycheck - :type 'hook - :risky t) - -(defcustom flycheck-checker-error-threshold 400 - "Maximum errors allowed per syntax checker. - -The value of this variable is either an integer denoting the -maximum number of errors per syntax checker and buffer, or nil to -not limit the errors reported from a syntax checker. - -If this variable is a number and a syntax checker reports more -errors than the value of this variable, its errors are not -discarded, and not highlighted in the buffer or available in the -error list. The affected syntax checker is also disabled for -future syntax checks of the buffer." - :group 'flycheck - :type '(choice (const :tag "Do not limit reported errors" nil) - (integer :tag "Maximum number of errors")) - :risky t - :package-version '(flycheck . "0.22")) - -(defcustom flycheck-process-error-functions '(flycheck-add-overlay) - "Functions to process errors. - -Each function in this hook must accept a single argument: A -Flycheck error to process. - -All functions in this hook are called in order of appearance, -until a function returns non-nil. Thus, a function in this hook -may return nil, to allow for further processing of the error, or -any non-nil value, to indicate that the error was fully processed -and inhibit any further processing. - -The functions are called for each newly parsed error immediately -after the corresponding syntax checker finished. At this stage, -the overlays from the previous syntax checks are still present, -and there may be further syntax checkers in the chain. - -This variable is an abnormal hook. See Info -node `(elisp)Hooks'." - :group 'flycheck - :type 'hook - :package-version '(flycheck . "0.13") - :risky t) - -(defcustom flycheck-display-errors-delay 0.9 - "Delay in seconds before displaying errors at point. - -Use floating point numbers to express fractions of seconds." - :group 'flycheck - :type 'number - :package-version '(flycheck . "0.15") - :safe #'numberp) - -(defcustom flycheck-display-errors-function #'flycheck-display-error-messages - "Function to display error messages. - -If set to a function, call the function with the list of errors -to display as single argument. Each error is an instance of the -`flycheck-error' struct. - -If set to nil, do not display errors at all." - :group 'flycheck - :type '(choice (const :tag "Display error messages" - flycheck-display-error-messages) - (const :tag "Display error messages only if no error list" - flycheck-display-error-messages-unless-error-list) - (function :tag "Error display function")) - :package-version '(flycheck . "0.13") - :risky t) - -(defcustom flycheck-indication-mode 'left-fringe - "The indication mode for Flycheck errors and warnings. - -This variable controls how Flycheck indicates errors in buffers. -May either be `left-fringe', `right-fringe', or nil. - -If set to `left-fringe' or `right-fringe', indicate errors and -warnings via icons in the left and right fringe respectively. - -If set to nil, do not indicate errors and warnings, but just -highlight them according to `flycheck-highlighting-mode'." - :group 'flycheck - :type '(choice (const :tag "Indicate in the left fringe" left-fringe) - (const :tag "Indicate in the right fringe" right-fringe) - (const :tag "Do not indicate" nil)) - :safe #'symbolp) - -(defcustom flycheck-highlighting-mode 'symbols - "The highlighting mode for Flycheck errors and warnings. - -The highlighting mode controls how Flycheck highlights errors in -buffers. The following modes are known: - -`columns' - Highlight the error column. If the error does not have a column, - highlight the whole line. - -`symbols' - Highlight the symbol at the error column, if there is any, - otherwise behave like `columns'. This is the default. - -`sexps' - Highlight the expression at the error column, if there is - any, otherwise behave like `columns'. Note that this mode - can be *very* slow in some major modes. - -`lines' - Highlight the whole line. - -nil - Do not highlight errors at all. However, errors will still - be reported in the mode line and in error message popups, - and indicated according to `flycheck-indication-mode'." - :group 'flycheck - :type '(choice (const :tag "Highlight columns only" columns) - (const :tag "Highlight symbols" symbols) - (const :tag "Highlight expressions" sexps) - (const :tag "Highlight whole lines" lines) - (const :tag "Do not highlight errors" nil)) - :package-version '(flycheck . "0.14") - :safe #'symbolp) - -(defcustom flycheck-check-syntax-automatically '(save - idle-change - new-line - mode-enabled) - "When Flycheck should check syntax automatically. - -This variable is a list of events that may trigger syntax checks. -The following events are known: - -`save' - Check syntax immediately after the buffer was saved. - -`idle-change' - Check syntax a short time (see `flycheck-idle-change-delay') - after the last change to the buffer. - -`new-line' - Check syntax immediately after a new line was inserted into - the buffer. - -`mode-enabled' - Check syntax immediately when `flycheck-mode' is enabled. - -Flycheck performs a syntax checks only on events, which are -contained in this list. For instance, if the value of this -variable is `(mode-enabled save)', Flycheck will only check if -the mode is enabled or the buffer was saved, but never after -changes to the buffer contents. - -If nil, never check syntax automatically. In this case, use -`flycheck-buffer' to start a syntax check manually." - :group 'flycheck - :type '(set (const :tag "After the buffer was saved" save) - (const :tag "After the buffer was changed and idle" idle-change) - (const :tag "After a new line was inserted" new-line) - (const :tag "After `flycheck-mode' was enabled" mode-enabled)) - :package-version '(flycheck . "0.12") - :safe #'symbolp) - -(defcustom flycheck-idle-change-delay 0.5 - "How many seconds to wait before checking syntax automatically. - -After the buffer was changed, Flycheck will wait as many seconds -as the value of this variable before starting a syntax check. If -the buffer is modified during this time, Flycheck will wait -again. - -This variable has no effect, if `idle-change' is not contained in -`flycheck-check-syntax-automatically'." - :group 'flycheck - :type 'number - :package-version '(flycheck . "0.13") - :safe #'numberp) - -(defcustom flycheck-standard-error-navigation t - "Whether to support error navigation with `next-error'. - -If non-nil, enable navigation of Flycheck errors with -`next-error', `previous-error' and `first-error'. Otherwise, -these functions just navigate errors from compilation modes. - -Flycheck error navigation with `flycheck-next-error', -`flycheck-previous-error' and `flycheck-first-error' is always -enabled, regardless of the value of this variable. - -Note that this setting only takes effect when `flycheck-mode' is -enabled. Changing it will not affect buffers which already have -`flycheck-mode' enabled." - :group 'flycheck - :type 'boolean - :package-version '(flycheck . "0.15") - :safe #'booleanp) - -(defcustom flycheck-navigation-minimum-level nil - "The minimum level of errors to navigate. - -If set to an error level, only navigate errors whose error level -is at least as severe as this one. If nil, navigate all errors." - :group 'flycheck - :type '(radio (const :tag "All locations" nil) - (const :tag "Informational messages" info) - (const :tag "Warnings" warning) - (const :tag "Errors" error) - (symbol :tag "Custom error level")) - :safe #'flycheck-error-level-p - :package-version '(flycheck . "0.21")) - -(defcustom flycheck-completion-system nil - "The completion system to use. - -`ido' - Use IDO. - - IDO is a built-in alternative completion system, without - good flex matching and a powerful UI. You may want to - install flx-ido (see URL `https://github.com/lewang/flx') to - improve the flex matching in IDO. - -`grizzl' - Use Grizzl. - - Grizzl is an alternative completion system with powerful - flex matching, but a very limited UI. See URL - `https://github.com/d11wtq/grizzl'. - -nil - Use the standard unfancy `completing-read'. - - `completing-read' has a very simple and primitive UI, and - does not offer flex matching. This is the default setting, - though, to match Emacs' defaults. With this system, you may - want enable option `icomplete-mode' to improve the display - of completion candidates at least." - :group 'flycheck - :type '(choice (const :tag "IDO" ido) - (const :tag "Grizzl" grizzl) - (const :tag "Completing read" nil)) - :package-version '(flycheck . "0.17")) - -(defcustom flycheck-temp-prefix "flycheck" - "Prefix for temporary files created by Flycheck." - :group 'flycheck - :type 'string - :package-version '(flycheck . "0.19") - :risky t) - -(defcustom flycheck-mode-hook nil - "Hooks to run after `flycheck-mode'." - :group 'flycheck - :type 'hook - :risky t) - -(defcustom flycheck-after-syntax-check-hook nil - "Functions to run after each syntax check. - -This hook is run after a syntax check was finished. - -At this point, *all* chained checkers were run, and all errors -were parsed, highlighted and reported. The variable -`flycheck-current-errors' contains all errors from all syntax -checkers run during the syntax check, so you can apply any error -analysis functions. - -Note that this hook does *not* run after each individual syntax -checker in the syntax checker chain, but only after the *last -checker*. - -This variable is a normal hook. See Info node `(elisp)Hooks'." - :group 'flycheck - :type 'hook - :risky t) - -(defcustom flycheck-before-syntax-check-hook nil - "Functions to run before each syntax check. - -This hook is run right before a syntax check starts. - -Error information from the previous syntax check is *not* -cleared before this hook runs. - -Note that this hook does *not* run before each individual syntax -checker in the syntax checker chain, but only before the *first -checker*. - -This variable is a normal hook. See Info node `(elisp)Hooks'." - :group 'flycheck - :type 'hook - :risky t) - -(defcustom flycheck-syntax-check-failed-hook nil - "Functions to run if a syntax check failed. - -This hook is run whenever an error occurs during Flycheck's -internal processing. No information about the error is given to -this hook. - -You should use this hook to conduct additional cleanup actions -when Flycheck failed. - -This variable is a normal hook. See Info node `(elisp)Hooks'." - :group 'flycheck - :type 'hook - :risky t) - -(defcustom flycheck-status-changed-functions nil - "Functions to run if the Flycheck status changed. - -This hook is run whenever the status of Flycheck changes. Each -hook function takes the status symbol as sinlge argument, as -given to `flycheck-report-status', which see. - -This variable is a abnormal hook. See Info -node `(elisp)Hooks'." - :group 'flycheck - :type 'hook - :risky t - :package-version '(flycheck . "0.20")) - -(defcustom flycheck-error-list-after-refresh-hook nil - "Functions to run after the error list was refreshed. - -This hook is run whenever the error list is refreshed. - -This variable is a normal hook. See Info node `(elisp)Hooks'." - :group 'flycheck - :type 'hook - :risky t - :package-version '(flycheck . "0.21")) - -(defface flycheck-error - '((((supports :underline (:style wave))) - :underline (:style wave :color "Red1")) - (t - :underline t :inherit error)) - "Flycheck face for errors." - :package-version '(flycheck . "0.13") - :group 'flycheck-faces) - -(defface flycheck-warning - '((((supports :underline (:style wave))) - :underline (:style wave :color "DarkOrange")) - (t - :underline t :inherit warning)) - "Flycheck face for warnings." - :package-version '(flycheck . "0.13") - :group 'flycheck-faces) - -(defface flycheck-info - '((((supports :underline (:style wave))) - :underline (:style wave :color "ForestGreen")) - (t - :underline t :inherit success)) - "Flycheck face for informational messages." - :package-version '(flycheck . "0.15") - :group 'flycheck-faces) - -(defface flycheck-fringe-error - '((t :inherit error)) - "Flycheck face for fringe error indicators." - :package-version '(flycheck . "0.13") - :group 'flycheck-faces) - -(defface flycheck-fringe-warning - '((t :inherit warning)) - "Flycheck face for fringe warning indicators." - :package-version '(flycheck . "0.13") - :group 'flycheck-faces) - -(defface flycheck-fringe-info - ;; Semantically `success' is probably not the right face, but it looks nice as - ;; a base face - '((t :inherit success)) - "Flycheck face for fringe info indicators." - :package-version '(flycheck . "0.15") - :group 'flycheck-faces) - -(defface flycheck-error-list-error - '((t :inherit error)) - "Flycheck face for error messages in the error list." - :package-version '(flycheck . "0.16") - :group 'flycheck-faces) - -(defface flycheck-error-list-warning - '((t :inherit warning)) - "Flycheck face for warning messages in the error list." - :package-version '(flycheck . "0.16") - :group 'flycheck-faces) - -(defface flycheck-error-list-info - '((t :inherit success)) - "Flycheck face for info messages in the error list." - :package-version '(flycheck . "0.16") - :group 'flycheck-faces) - -;; The base faces for the following two faces are inspired by Compilation Mode -(defface flycheck-error-list-line-number - '((t :inherit font-lock-constant-face)) - "Face for line numbers in the error list." - :group 'flycheck-faces - :package-version '(flycheck . "0.16")) - -(defface flycheck-error-list-column-number - '((t :inherit font-lock-constant-face)) - "Face for line numbers in the error list." - :group 'flycheck-faces - :package-version '(flycheck . "0.16")) - -(defface flycheck-error-list-id - '((t :inherit font-lock-type-face)) - "Face for the error ID in the error list." - :group 'flycheck-faces - :package-version '(flycheck . "0.22")) - -(defface flycheck-error-list-checker-name - '((t :inherit font-lock-function-name-face)) - "Face for the syntax checker name in the error list." - :group 'flycheck-faces - :package-version '(flycheck . "0.21")) - -(defface flycheck-error-list-highlight - '((t :inherit highlight)) - "Flycheck face to highlight errors in the error list." - :package-version '(flycheck . "0.15") - :group 'flycheck-faces) - -(defvar flycheck-command-map - (let ((map (make-sparse-keymap))) - (define-key map "c" #'flycheck-buffer) - (define-key map "C" #'flycheck-clear) - (define-key map (kbd "C-c") #'flycheck-compile) - (define-key map "n" #'flycheck-next-error) - (define-key map "p" #'flycheck-previous-error) - (define-key map "l" #'flycheck-list-errors) - (define-key map (kbd "C-w") #'flycheck-copy-errors-as-kill) - (define-key map "s" #'flycheck-select-checker) - (define-key map "e" #'flycheck-set-checker-executable) - (define-key map "?" #'flycheck-describe-checker) - (define-key map "i" #'flycheck-info) - (define-key map "V" #'flycheck-version) - (define-key map "v" #'flycheck-verify-setup) - (define-key map "x" #'flycheck-disable-checker) - map) - "Keymap of Flycheck interactive commands.") - -(defcustom flycheck-keymap-prefix (kbd "C-c !") - "Prefix for key bindings of Flycheck. - -Changing this variable outside Customize does not have any -effect. To change the keymap prefix from Lisp, you need to -explicitly re-define the prefix key: - - (define-key flycheck-mode-map flycheck-keymap-prefix nil) - (setq flycheck-keymap-prefix (kbd \"C-c f\")) - (define-key flycheck-mode-map flycheck-keymap-prefix - flycheck-command-map) - -Please note that Flycheck's manual documents the default -keybindings. Changing this variable is at your own risk." - :group 'flycheck - :package-version '(flycheck . "0.19") - :type 'string - :risky t - :set - (lambda (variable key) - (when (and (boundp variable) (boundp 'flycheck-mode-map)) - (define-key flycheck-mode-map (symbol-value variable) nil) - (define-key flycheck-mode-map key flycheck-command-map)) - (set-default variable key))) - -(defcustom flycheck-mode-line '(:eval (flycheck-mode-line-status-text)) - "Mode line lighter for Flycheck. - -The value of this variable is a mode line template as in -`mode-line-format'. See Info Node `(elisp)Mode Line Format' for -more information. Note that it should contain a _single_ mode -line construct only. - -Customize this variable to change how Flycheck reports its status -in the mode line. You may use `flycheck-mode-line-status-text' -to obtain a human-readable status text, including an -error/warning count. - -You may also assemble your own status text. The current status -of Flycheck is available in `flycheck-last-status-change'. The -errors in the current buffer are stored in -`flycheck-current-errors', and the function -`flycheck-count-errors' may be used to obtain the number of -errors grouped by error level. - -Set this variable to nil to disable the mode line completely." - :group 'flycheck - :type 'sexp - :risky t - :package-version '(flycheck . "0.20")) - -(defcustom flycheck-error-list-mode-line - `(,(propertized-buffer-identification "%12b") - " for buffer " - (:eval (flycheck-error-list-propertized-source-name))) - "Mode line construct for Flycheck error list. - -The value of this variable is a mode line template as in -`mode-line-format', to be used as -`mode-line-buffer-identification' in `flycheck-error-list-mode'. -See Info Node `(elisp)Mode Line Format' for more information. - -Customize this variable to change how the error list appears in -the mode line. The default shows the name of the buffer and the -name of the source buffer, i.e. the buffer whose errors are -currently listed." - :group 'flycheck - :type 'sexp - :risky t - :package-version '(flycheck . "0.20")) - -(defcustom flycheck-global-modes t - "Modes for which `flycheck-mode' is turned on by `global-flycheck-mode'. - -If t, Flycheck Mode is turned on for all major modes. If a list, -Flycheck Mode is turned on for all `major-mode' symbols in that -list. If the `car' of the list is `not', Flycheck Mode is turned -on for all `major-mode' symbols _not_ in that list. If nil, -Flycheck Mode is never turned on by `global-flycheck-mode'. - -Note that Flycheck is never turned on for modes whose -`mode-class' property is `special' (see Info node `(elisp)Major -Mode Conventions'), regardless of the value of this option." - :group 'flycheck - :type '(choice (const :tag "none" nil) - (const :tag "all" t) - (set :menu-tag "mode specific" :tag "modes" - :value (not) - (const :tag "Except" not) - (repeat :inline t (symbol :tag "mode")))) - :risky t - :package-version '(flycheck . "0.23")) - - -;;; Global Flycheck menu -(defvar flycheck-mode-menu-map - (easy-menu-create-menu - "Syntax Checking" - '(["Enable on-the-fly syntax checking" flycheck-mode - :style toggle :selected flycheck-mode - ;; Don't let users toggle the mode if there is no syntax checker for this - ;; buffer - :enable (or flycheck-mode (flycheck-get-checker-for-buffer))] - ["Check current buffer" flycheck-buffer flycheck-mode] - ["Clear errors in buffer" flycheck-clear t] - "---" - ["Go to next error" flycheck-next-error flycheck-mode] - ["Go to previous error" flycheck-previous-error flycheck-mode] - ["Show all errors" flycheck-list-errors flycheck-mode] - "---" - ["Copy messages at point" flycheck-copy-errors-as-kill - (flycheck-overlays-at (point))] - "---" - ["Select syntax checker" flycheck-select-checker flycheck-mode] - ["Disable syntax checker" flycheck-disable-checker flycheck-mode] - ["Set executable of syntax checker" flycheck-set-checker-executable - flycheck-mode] - "---" - ["Describe syntax checker" flycheck-describe-checker t] - ["Show Flycheck version" flycheck-version t] - ["Read the Flycheck manual" flycheck-info t])) - "Menu of `flycheck-mode'.") - -(easy-menu-add-item nil '("Tools") flycheck-mode-menu-map "Spell Checking") - - -;;; Version information, manual and loading of Flycheck -(defun flycheck-version (&optional show-version) - "Get the Flycheck version as string. - -If called interactively or if SHOW-VERSION is non-nil, show the -version in the echo area and the messages buffer. - -The returned string includes both, the version from package.el -and the library version, if both a present and different. - -If the version number could not be determined, signal an error, -if called interactively, or if SHOW-VERSION is non-nil, otherwise -just return nil." - (interactive (list t)) - (let ((version (pkg-info-version-info 'flycheck))) - (when show-version - (message "Flycheck version: %s" version)) - version)) - -(defun flycheck-unload-function () - "Unload function for Flycheck." - (global-flycheck-mode -1) - (easy-menu-remove-item nil '("Tools") (cadr flycheck-mode-menu-map)) - (remove-hook 'kill-emacs-hook #'flycheck-global-teardown) - (setq find-function-regexp-alist - (assq-delete-all 'flycheck-checker find-function-regexp-alist))) - -;;;###autoload -(defun flycheck-info () - "Open the Flycheck manual." - (interactive) - (info "flycheck")) - - -;;; Utility functions -(defun flycheck-sexp-to-string (sexp) - "Convert SEXP to a string. - -Like `prin1-to-string' but ensure that the returned string -is loadable." - (let ((print-quoted t) - (print-length nil) - (print-level nil)) - (prin1-to-string sexp))) - -(defun flycheck-string-to-number-safe (string) - "Safely convert STRING to a number. - -If STRING is of string type and a numeric string, convert STRING -to a number and return it. Otherwise return nil." - (let ((number-re (rx string-start (one-or-more (any digit)) string-end))) - (when (and (stringp string) (string-match-p number-re string)) - (string-to-number string)))) - -(defun flycheck-string-list-p (obj) - "Determine if OBJ is a list of strings." - (and (listp obj) (-all? #'stringp obj))) - -(defun flycheck-symbol-list-p (obj) - "Determine if OBJ is a list of symbols." - (and (listp obj) (-all? #'symbolp obj))) - -(defun flycheck-same-files-p (file-a file-b) - "Determine whether FILE-A and FILE-B refer to the same file." - (string= (directory-file-name (expand-file-name file-a)) - (directory-file-name (expand-file-name file-b)))) - -(defvar-local flycheck-temporaries nil - "Temporary files and directories created by Flycheck.") - -(defun flycheck-temp-dir-system () - "Create a unique temporary directory. - -Use `flycheck-temp-prefix' as prefix, and add the directory to -`flycheck-temporaries'. - -Return the path of the directory" - (let* ((tempdir (make-temp-file flycheck-temp-prefix 'directory))) - (push tempdir flycheck-temporaries) - tempdir)) - -(defun flycheck-temp-file-system (filename) - "Create a temporary file named after FILENAME. - -If FILENAME is non-nil, this function creates a temporary -directory with `flycheck-temp-dir-system', and creates a file -with the same name as FILENAME in this directory. - -Otherwise this function creates a temporary file with -`flycheck-temp-prefix' and a random suffix. The path of the file -is added to `flycheck-temporaries'. - -Add the path of the file to `flycheck-temporaries'. - -Return the path of the file." - (let (tempfile) - (if filename - (let ((directory (flycheck-temp-dir-system))) - (setq tempfile (expand-file-name (file-name-nondirectory filename) - directory))) - (setq tempfile (make-temp-file flycheck-temp-prefix))) - (push tempfile flycheck-temporaries) - tempfile)) - -(defun flycheck-temp-file-inplace (filename) - "Create an in-place copy of FILENAME. - -Prefix the file with `flycheck-temp-prefix' and add the path of -the file to `flycheck-temporaries'. - -If FILENAME is nil, fall back to `flycheck-temp-file-system'. - -Return the path of the file." - (if filename - (let* ((tempname (format "%s_%s" - flycheck-temp-prefix - (file-name-nondirectory filename))) - (tempfile (expand-file-name tempname - (file-name-directory filename)))) - (push tempfile flycheck-temporaries) - tempfile) - (flycheck-temp-file-system filename))) - -(defun flycheck-save-buffer-to-file (file-name) - "Save the contents of the current buffer to FILE-NAME." - (make-directory (file-name-directory file-name) t) - (let ((jka-compr-inhibit t)) - (write-region nil nil file-name nil 0))) - -(defun flycheck-save-buffer-to-temp (temp-file-fn) - "Save buffer to temp file returned by TEMP-FILE-FN. - -Return the name of the temporary file." - (let ((filename (funcall temp-file-fn (buffer-file-name)))) - ;; Do not flush short-lived temporary files onto disk - (let ((write-region-inhibit-fsync t)) - (flycheck-save-buffer-to-file filename)) - filename)) - -(defun flycheck-prepend-with-option (option items &optional prepend-fn) - "Prepend OPTION to each item in ITEMS, using PREPEND-FN. - -Prepend OPTION to each item in ITEMS. - -ITEMS is a list of strings to pass to the syntax checker. OPTION -is the option, as string. PREPEND-FN is a function called to -prepend OPTION to each item in ITEMS. It receives the option and -a single item from ITEMS as argument, and must return a string or -a list of strings with OPTION prepended to the item. If -PREPEND-FN is nil or omitted, use `list'. - -Return a list of strings where OPTION is prepended to each item -in ITEMS using PREPEND-FN. If PREPEND-FN returns a list, it is -spliced into the resulting list." - (unless (stringp option) - (error "Option %S is not a string" option)) - (unless prepend-fn - (setq prepend-fn #'list)) - (let ((prepend - (lambda (item) - (let ((result (funcall prepend-fn option item))) - (cond - ((and (listp result) (-all? #'stringp result)) result) - ((stringp result) (list result)) - (t (error "Invalid result type for option: %S" result))))))) - (apply #'append (mapcar prepend items)))) - -(defun flycheck-find-in-buffer (pattern) - "Find PATTERN in the current buffer. - -Return the result of the first matching group of PATTERN, or nil, -if PATTERN did not match." - (save-restriction - (widen) - (save-excursion - (goto-char (point-min)) - (when (re-search-forward pattern nil 'no-error) - (match-string-no-properties 1))))) - -(defun flycheck-ephemeral-buffer-p () - "Determine whether the current buffer is an ephemeral buffer. - -See Info node `(elisp)Buffer Names' for information about -ephemeral buffers." - (string-prefix-p " " (buffer-name))) - -(defun flycheck-encrypted-buffer-p () - "Determine whether the current buffer is an encrypted file. - -See Info node `(epa)Top' for Emacs' interface to encrypted -files." - ;; The EPA file handler sets this variable locally to remember the recipients - ;; of the encrypted file for re-encryption. Hence, a local binding of this - ;; variable is a good indication that the buffer is encrypted. I haven't - ;; found any better indicator anyway. - (local-variable-p 'epa-file-encrypt-to)) - -(defun flycheck-autoloads-file-p () - "Determine whether the current buffer is a autoloads file. - -Autoloads are generated by package.el during installation." - (string-suffix-p "-autoloads.el" (buffer-name))) - -(defun flycheck-in-user-emacs-directory-p (filename) - "Whether FILENAME is in `user-emacs-directory'." - (string-prefix-p (file-name-as-directory (file-truename user-emacs-directory)) - (file-truename filename))) - -(defun flycheck-safe-delete (file-or-dir) - "Safely delete FILE-OR-DIR." - (ignore-errors - (if (file-directory-p file-or-dir) - (delete-directory file-or-dir 'recursive) - (delete-file file-or-dir)))) - -(defun flycheck-safe-delete-temporaries () - "Safely delete all temp files and directories of Flycheck. - -Safely delete all files and directories listed in -`flycheck-temporaries' and set the variable's value to nil." - (mapc #'flycheck-safe-delete flycheck-temporaries) - (setq flycheck-temporaries nil)) - -(eval-and-compile - (defun flycheck-rx-file-name (form) - "Translate the `(file-name)' FORM into a regular expression." - (let ((body (or (cdr form) '((minimal-match - (one-or-more not-newline)))))) - (rx-submatch-n `(group-n 1 ,@body)))) - - (defun flycheck-rx-message (form) - "Translate the `(message)' FORM into a regular expression." - (let ((body (or (cdr form) '((one-or-more not-newline))))) - (rx-submatch-n `(group-n 4 ,@body)))) - - (defun flycheck-rx-id (form) - "Translate the `(id)' FORM into a regular expression." - (rx-submatch-n `(group-n 5 ,@(cdr form)))) - - (defun flycheck-rx-to-string (form &optional no-group) - "Like `rx-to-string' for FORM, but with special keywords: - -`line' - matches the line number. - -`column' - matches the column number. - -`(file-name SEXP ...)' - matches the file name. SEXP describes the file name. If no - SEXP is given, use a default body of `(minimal-match - (one-or-more not-newline))'. - -`(message SEXP ...)' - matches the message. SEXP constitutes the body of the message. If no SEXP - is given, use a default body of `(one-or-more not-newline)'. - -`(id SEXP ...)' - matches an error ID. SEXP describes the ID. - -NO-GROUP is passed to `rx-to-string'." - (let ((rx-constituents - (append - `((line . ,(rx (group-n 2 (one-or-more digit)))) - (column . ,(rx (group-n 3 (one-or-more digit)))) - (file-name flycheck-rx-file-name 0 nil) - (message flycheck-rx-message 0 nil) - (id flycheck-rx-id 0 nil)) - rx-constituents nil))) - (rx-to-string form no-group)))) - -(defun flycheck-current-load-file () - "Get the source file currently being loaded. - -Always return the name of the corresponding source file, never -any byte-compiled file. - -Return nil, if the currently loaded file cannot be determined." - (-when-let* ((this-file (cond - (load-in-progress load-file-name) - ((bound-and-true-p byte-compile-current-file)) - (t (buffer-file-name)))) - ;; A best guess for the source file of a compiled library. Works - ;; well in most cases, and especially for ELPA packages - (source-file (concat (file-name-sans-extension this-file) - ".el"))) - (when (file-exists-p source-file) - source-file))) - -(defun flycheck-module-root-directory (module &optional file-name) - "Get the root directory for a MODULE in FILE-NAME. - -MODULE is a qualified module name, either a string with -components separated by a dot, or as list of components. -FILE-NAME is the name of the file or directory containing the -module as string. When nil or omitted, defaults to the return -value of function `buffer-file-name'. - -Return the root directory of the module, that is, the directory, -from which FILE-NAME can be reached by descending directories -along each part of MODULE. - -If the MODULE name does not match the directory hierarchy upwards -from FILE-NAME, return the directory containing FILE-NAME. When -FILE-NAME is nil, return `default-directory'." - (let ((file-name (or file-name (buffer-file-name))) - (module-components (if (stringp module) - (split-string module (rx ".")) - (copy-sequence module)))) - (if (and module-components file-name) - (let ((parts (nreverse module-components)) - (base-directory (directory-file-name - (file-name-sans-extension file-name)))) - (while (and parts - (string= (file-name-nondirectory base-directory) - (car parts))) - (pop parts) - (setq base-directory (directory-file-name - (file-name-directory base-directory)))) - (file-name-as-directory base-directory)) - (if file-name - (file-name-directory file-name) - (expand-file-name default-directory))))) - - -;;; Minibuffer tools -(defvar read-flycheck-checker-history nil - "`completing-read' history of `read-flycheck-checker'.") - -(defun read-flycheck-checker (prompt &optional default property candidates) - "Read a flycheck checker from minibuffer with PROMPT and DEFAULT. - -PROMPT is a string to show in the minibuffer as prompt. It -should end with a single space. DEFAULT is a symbol denoting the -default checker to use, if the user did not select any checker. -PROPERTY is a symbol denoting a syntax checker property. If -non-nil, only complete syntax checkers which have a non-nil value -for PROPERTY. CANDIDATES is an optional list of all syntax -checkers available for completion, defaulting to all defined -checkers. If given, PROPERTY is ignored. - -Return the checker as symbol, or DEFAULT if no checker was -chosen. If DEFAULT is nil and no checker was chosen, signal a -`user-error' if the underlying completion system does not provide -a default on its own." - (when (and default (not (flycheck-valid-checker-p default))) - (error "%S is no valid Flycheck checker" default)) - (let* ((candidates (mapcar #'symbol-name - (or candidates - (flycheck-defined-checkers property)))) - (default (and default (symbol-name default))) - (input (pcase flycheck-completion-system - (`ido (ido-completing-read prompt candidates nil - 'require-match nil - 'read-flycheck-checker-history - default)) - (`grizzl (if (and (fboundp 'grizzl-make-index) - (fboundp 'grizzl-completing-read)) - (grizzl-completing-read - prompt (grizzl-make-index candidates)) - (user-error "Please install Grizzl from \ -https://github.com/d11wtq/grizzl"))) - (_ (completing-read prompt candidates nil 'require-match - nil 'read-flycheck-checker-history - default))))) - (when (string-empty-p input) - (unless default - (user-error "No syntax checker selected")) - (setq input default)) - (let ((checker (intern input))) - (unless (flycheck-valid-checker-p checker) - (error "%S is no Flycheck syntax checker" checker)) - checker))) - - -;;; Checker API -(defun flycheck-defined-checkers (&optional property) - "Find all defined syntax checkers, optionally with PROPERTY. - -PROPERTY is a symbol. If given, only return syntax checkers with -a non-nil value for PROPERTY. - -The returned list is sorted alphapetically by the symbol name of -the syntax checkers." - (let (defined-checkers) - (mapatoms (lambda (symbol) - (when (and (flycheck-valid-checker-p symbol) - (or (null property) (get symbol property))) - (push symbol defined-checkers)))) - (sort defined-checkers #'string<))) - -(defun flycheck-registered-checker-p (checker) - "Determine whether CHECKER is registered. - -A checker is registered if it is contained in -`flycheck-checkers'." - (and (flycheck-valid-checker-p checker) - (memq checker flycheck-checkers))) - -(defun flycheck-disabled-checker-p (checker) - "Determine whether CHECKER is disabled. - -A checker is disabled if it is contained in -`flycheck-disabled-checkers'." - (memq checker flycheck-disabled-checkers)) - -(defun flycheck-possibly-suitable-checkers () - "Find possibly suitable checkers for the current buffer. - -Return a list of all syntax checkers which could possibly be -suitable for the current buffer, if any problems in their setup -were fixed. - -Currently this function collects all registered syntax checkers -whose `:modes' contain the current major mode or which do not -have any `:modes', but a `:predicate' that returns non-nil for -the current buffer." - (let (checkers) - (dolist (checker flycheck-checkers) - (let ((modes (flycheck-checker-modes checker)) - (predicate (flycheck-checker-predicate checker))) - (when (or (memq major-mode modes) - (and (not modes) - (functionp predicate) - (funcall predicate))) - (push checker checkers)))) - (nreverse checkers))) - - -;;; Generic syntax checkers -(defconst flycheck-generic-checker-version 2 - "The internal version of generic syntax checker declarations. - -Flycheck will not use syntax checkers whose generic version is -less than this constant.") - -(defun flycheck-validate-next-checker (next &optional strict) - "Validate NEXT checker. - -With STRICT non-nil, also check whether the syntax checker and -the error level in NEXT are valid. Otherwise just check whether -these are symbols. - -Signal an error if NEXT is not a valid entry for -`:next-checkers'." - (when (symbolp next) - (setq next (cons t next))) - (pcase next - (`(,level . ,checker) - (if strict - (progn - (unless (or (eq level t) (flycheck-error-level-p level)) - (error "%S is not a valid Flycheck error level" level)) - (unless (flycheck-valid-checker-p checker) - (error "%s is not a valid Flycheck syntax checker" checker))) - (unless (symbolp level) - (error "Error level %S must be a symbol" level)) - (unless (symbolp checker) - (error "Checker %S must be a symbol" checker)))) - (_ (error "%S must be a symbol or cons cell" next))) - t) - -(defun flycheck-define-generic-checker (symbol docstring &rest properties) - "Define SYMBOL as generic syntax checker. - -Any syntax checker defined with this macro is eligible for manual -syntax checker selection with `flycheck-select-checker'. To make -the new syntax checker available for automatic selection, it must -be registered in `flycheck-checkers'. - -DOCSTRING is the documentation of the syntax checker, for -`flycheck-describe-checker'. The following PROPERTIES constitute -a generic syntax checker. Unless otherwise noted, all properties -are mandatory. - -`:start FUNCTION' - A function to start the syntax checker. - - FUNCTION shall take two arguments and return a context - object if the checker is started successfully. Otherwise it - shall signal an error. - - The first argument is the syntax checker being started. The - second is a callback function to report state changes to - Flycheck. The callback takes two arguments STATUS DATA, - where STATUS is a symbol denoting the syntax checker status - and DATA an optional argument with additional data for the - status report. See `flycheck-report-buffer-checker-status' - for more information about STATUS and DATA. - - FUNCTION may be synchronous or asynchronous, i.e. it may - call the given callback either immediately, or at some later - point (e.g. from a process sentinel). - - A syntax checker _must_ call CALLBACK at least once with a - STATUS that finishes the current syntax checker. Otherwise - Flycheck gets stuck at the current syntax check with this - syntax checker. - - The context object returned by FUNCTION is passed to - `:interrupt'. - -`:interrupt FUNCTION' - A function to interrupt the syntax check. - - FUNCTION is called with the syntax checker and the context - object returned by the `:start' function and shall try to - interrupt the syntax check. The context may be nil, if the - syntax check is interrupted before actually started. - FUNCTION should handle this situation. - - If it cannot interrupt the syntax check, it may either - signal an error or silently ignore the attempt to interrupt - the syntax checker, depending on the severity of the - situation. - - If interrupting the syntax check failed, Flycheck will let - the syntax check continue, but ignore any status reports. - Notably, it won't highlight any errors reported by the - syntax check in the buffer. - - This property is optional. If omitted, Flycheck won't - attempt to interrupt syntax checks wit this syntax checker, - and simply ignore their results. - -`:print-doc FUNCTION' - A function to print additional documentation into the Help - buffer of this checker. - - FUNCTION is called when creating the Help buffer for the - syntax checker, with the syntax checker as single argument, - after printing the name of the syntax checker and its modes - and predicate, but before printing DOCSTRING. It may insert - additional documentation into the current buffer. - - The call occurs within `with-help-window'. Hence - `standard-output' points to the current buffer, so you may - use `princ' and friends to add content. Also, the current - buffer is put into Help mode afterwards, which automatically - turns symbols into references, if possible. - - This property is optional. If omitted, no additional - documentation is printed for this syntax checker. - -:verify FUNCTION - A function to verify the checker for the current buffer. - - FUNCTION is called with the syntax checker as single - argument, and shall return a list of - `flycheck-verification-result' objects indicating whether - the syntax checker could be used in the current buffer, and - highlighting potential setup problems. - - This property is optional. If omitted, no additional - verification occurs for this syntax checker. It is however - absolutely recommended that you add a `:verify' function to - your syntax checker, because it will help users to spot - potential setup problems. - -`:modes MODES' - A major mode symbol or a list thereof, denoting major modes - to use this syntax checker in. - - If given this syntax checker is only used in buffers whose - `major-mode' is `eq' to any mode in MODES. - - If `:predicate' is also given, the syntax checker will only - be used in buffers for which the `:predicate' returns - non-nil. - - This property is optional, however at least one of `:modes' - or `:predicate' must be given. - -`:predicate FUNCTION' - A function to determine whether to use the syntax checker in - the current buffer. - - FUNCTION is called without arguments and shall return - non-nil if this syntax checker shall be used to check the - current buffer. Otherwise it shall return nil. - - If `:modes' is also given, FUNCTION is only called in - matching major modes. - - This property is optional, however at least one of `:modes' - or `:predicate' must be given. - -`:error-filter FUNCTION' - A function to filter the errors returned by this checker. - - FUNCTION is called with the list of `flycheck-error' objects - returned by the syntax checker and shall return another list - of `flycheck-error' objects, which is considered the final - result of this syntax checker. - - FUNCTION is free to add, remove or modify errors, whether in - place or by copying. - - This property is optional. The default filter is - `identity'. - -`:next-checkers NEXT-CHECKERS' - A list denoting syntax checkers to apply after this syntax - checker, in what we call \"chaining\" of syntax checkers. - - Each ITEM is a cons cell `(LEVEL . CHECKER)'. CHECKER is a - syntax checker to run after this syntax checker. LEVEL is - an error level. CHECKER will only be used if there are no - current errors of at least LEVEL. LEVEL may also be t, in - which case CHECKER is used regardless of the current errors. - - ITEM may also be a syntax checker symbol, which is - equivalent to `(t . ITEM)'. - - Flycheck tries all items in order of declaration, and uses - the first whose LEVEL matches and whose CHECKER is - registered and can be used for the current buffer. - - This feature is typically used to apply more than one syntax - checker to a buffer. For instance, you might first use a - compiler to check a buffer for syntax and type errors, and - then run a linting tool that checks for insecure code, or - questionable style. - - This property is optional. If omitted, it defaults to the - nil, i.e. no other syntax checkers are applied after this - syntax checker. - -Signal an error, if any property has an invalid value." - (declare (indent 1) - (doc-string 2)) - (let ((start (plist-get properties :start)) - (interrupt (plist-get properties :interrupt)) - (print-doc (plist-get properties :print-doc)) - (modes (plist-get properties :modes)) - (predicate (plist-get properties :predicate)) - (verify (plist-get properties :verify)) - (filter (or (plist-get properties :error-filter) #'identity)) - (next-checkers (plist-get properties :next-checkers)) - (file (flycheck-current-load-file))) - - (unless (listp modes) - (setq modes (list modes))) - - (unless (functionp start) - (error ":start %S of syntax checker %s is not a function" symbol start)) - (unless (or (null interrupt) (functionp interrupt)) - (error ":interrupt %S of syntax checker %s is not a function" - symbol interrupt)) - (unless (or (null print-doc) (functionp print-doc)) - (error ":print-doc %S of syntax checker %s is not a function" - symbol print-doc)) - (unless (or (null verify) (functionp verify)) - (error ":verify %S of syntax checker %S is not a function" - symbol verify)) - (unless (or modes predicate) - (error "Missing :modes or :predicate in syntax checker %s" symbol)) - (dolist (mode modes) - (unless (symbolp mode) - (error "Invalid :modes %s in syntax checker %s, %s must be a symbol" - modes symbol mode))) - (unless (or (null predicate) (functionp predicate)) - (error ":predicate %S of syntax checker %s is not a function" - symbol predicate)) - (unless (functionp filter) - (error ":error-filter %S of syntax checker %s is not a function" - symbol filter)) - (dolist (checker next-checkers) - (flycheck-validate-next-checker checker)) - - (let ((real-predicate (lambda () - (if (flycheck-valid-checker-p symbol) - (or (null predicate) (funcall predicate)) - (lwarn 'flycheck :warning "%S is no valid Flycheck syntax checker. -Try to reinstall the package defining this syntax checker." symbol) - nil)))) - (pcase-dolist (`(,prop . ,value) - `((flycheck-start . ,start) - (flycheck-interrupt . ,interrupt) - (flycheck-print-doc . ,print-doc) - (flycheck-modes . ,modes) - (flycheck-predicate . ,real-predicate) - (flycheck-verify . ,verify) - (flycheck-error-filter . ,filter) - (flycheck-next-checkers . ,next-checkers) - (flycheck-documentation . ,docstring) - (flycheck-file . ,file))) - (put symbol prop value))) - - ;; Track the version, to avoid breakage if the internal format changes - (put symbol 'flycheck-generic-checker-version - flycheck-generic-checker-version))) - -(defun flycheck-valid-checker-p (checker) - "Check whether a CHECKER is valid. - -A valid checker is a symbol defined as syntax checker with -`flycheck-define-checker'." - (and (symbolp checker) - (= (or (get checker 'flycheck-generic-checker-version) 0) - flycheck-generic-checker-version))) - -(defun flycheck-checker-modes (checker) - "Get the modes of CHECKER." - (get checker 'flycheck-modes)) - -(defun flycheck-checker-predicate (checker) - "Get the predicate function of CHECKER." - (get checker 'flycheck-predicate)) - -(defun flycheck-checker-next-checkers (checker) - "Get the next checkers for CHECKER." - (get checker 'flycheck-next-checkers)) - -(defun flycheck-checker-error-filter (checker) - "Get the error filter of CHECKER." - (get checker 'flycheck-error-filter)) - -(defun flycheck-checker-documentation (checker) - "Get the documentation of CHECKER." - (documentation-property checker 'flycheck-documentation)) - -(defun flycheck-checker-file (checker) - "Get the file CHECKER was defined in. - -Return nil if the file cannot be determined." - (get checker 'flycheck-file)) - -(defun flycheck-may-use-checker (checker) - "Whether a generic CHECKER may be used. - -Return non-nil if CHECKER may be used for the current buffer, and -nil otherwise." - (let ((modes (flycheck-checker-modes checker)) - (predicate (flycheck-checker-predicate checker))) - (and (flycheck-valid-checker-p checker) - (or (not modes) (memq major-mode modes)) - (funcall predicate) - (not (flycheck-disabled-checker-p checker))))) - -(defun flycheck-may-use-next-checker (next-checker) - "Determine whether NEXT-CHECKER may be used." - (when (symbolp next-checker) - (push t next-checker)) - (let ((level (car next-checker)) - (next-checker (cdr next-checker))) - (and (or (eq level t) - (flycheck-has-max-current-errors-p level)) - (flycheck-registered-checker-p next-checker) - (flycheck-may-use-checker next-checker)))) - - -;;; Help for generic syntax checkers -(define-button-type 'help-flycheck-checker-def - :supertype 'help-xref - 'help-function #'flycheck-goto-checker-definition - 'help-echo "mouse-2, RET: find Flycheck checker definition") - -(defconst flycheck-find-checker-regexp - (rx line-start (zero-or-more (syntax whitespace)) - "(" symbol-start "flycheck-define-checker" symbol-end - (eval (list 'regexp find-function-space-re)) - symbol-start - "%s" - symbol-end - (or (syntax whitespace) line-end)) - "Regular expression to find a checker definition.") - -(add-to-list 'find-function-regexp-alist - '(flycheck-checker . flycheck-find-checker-regexp)) - -(defun flycheck-goto-checker-definition (checker file) - "Go to to the definition of CHECKER in FILE." - (let ((location (find-function-search-for-symbol - checker 'flycheck-checker file))) - (pop-to-buffer (car location)) - (if (cdr location) - (goto-char (cdr location)) - (message "Unable to find checker location in file")))) - -(defun flycheck-checker-at-point () - "Return the Flycheck checker found at or before point. - -Return 0 if there is no checker." - (let ((symbol (variable-at-point 'any-symbol))) - (if (and (symbolp symbol) (flycheck-valid-checker-p symbol)) - symbol - 0))) - -(defun flycheck-describe-checker (checker) - "Display the documentation of CHECKER. - -CHECKER is a checker symbol. - -Pop up a help buffer with the documentation of CHECKER." - (interactive - (let* ((checker (flycheck-checker-at-point)) - (enable-recursive-minibuffers t) - (prompt (if (symbolp checker) - (format "Describe syntax checker (default %s): " checker) - "Describe syntax checker: ")) - (reply (read-flycheck-checker prompt))) - (list (or reply checker)))) - (if (or (null checker) (not (flycheck-valid-checker-p checker))) - (message "You didn't specify a Flycheck syntax checker.") - (help-setup-xref (list #'flycheck-describe-checker checker) - (called-interactively-p 'interactive)) - (save-excursion - (with-help-window (help-buffer) - (let ((filename (flycheck-checker-file checker)) - (modes (flycheck-checker-modes checker)) - (predicate (flycheck-checker-predicate checker)) - (print-doc (get checker 'flycheck-print-doc))) - (princ (format "%s is a Flycheck syntax checker" checker)) - (when filename - (princ (format " in `%s'" (file-name-nondirectory filename))) - (with-current-buffer standard-output - (save-excursion - (re-search-backward "`\\([^`']+\\)'" nil t) - (help-xref-button 1 'help-flycheck-checker-def checker filename)))) - (princ ".\n\n") - - (let ((modes-start (with-current-buffer standard-output (point-max)))) - ;; Track the start of the modes documentation, to properly re-fill - ;; it later - (if (not modes) - ;; Syntax checkers without modes must have a predicate - (princ " This syntax checker checks syntax if a custom predicate holds") - (princ " This syntax checker checks syntax in the major mode(s) ") - (princ (string-join - (mapcar (apply-partially #'format "`%s'") modes) - ", ")) - (when predicate - (princ ", and uses a custom predicate"))) - (princ ".") - (with-current-buffer standard-output - (save-excursion - (fill-region-as-paragraph modes-start (point-max))))) - (princ "\n") - ;; Call the custom print-doc function of the checker, if present - (when print-doc - (funcall print-doc checker)) - ;; Ultimately, print the docstring - (princ "\nDocumentation:\n") - (princ (flycheck-checker-documentation checker))))))) - - -;;; Syntax checker verification -(cl-defstruct (flycheck-verification-result - (:constructor flycheck-verification-result-new)) - "Structure for storing a single verification result. - -Slots: - -`label' - A label for this result, as string - -`message' - A message for this result, as string - -`face' - The face to use for the `message'. - - You can either use a face symbol, or a list of face symbols." - label message face) - -(defun flycheck-verify-generic-checker (checker) - "Verify a generic CHECKER in the current buffer. - -Return a list of `flycheck-verification-result' objects." - (let (results - (predicate (flycheck-checker-predicate checker)) - (verify (get checker 'flycheck-verify))) - (when predicate - (let ((result (funcall predicate))) - (push (flycheck-verification-result-new - :label "predicate" - :message (prin1-to-string (not (null result))) - :face (if result 'success '(bold warning))) - results))) - (append (nreverse results) - (and verify (funcall verify checker))))) - -(define-button-type 'help-flycheck-checker-doc - :supertype 'help-xref - 'help-function #'flycheck-describe-checker - 'help-echo "mouse-2, RET: describe Flycheck checker") - -(defun flycheck-verify-setup () - "Check whether Flycheck can be used in this buffer. - -Display a new buffer listing all syntax checkers that could be -applicable in the current buffer. For each syntax checkers, -possible problems are shown." - (interactive) - (when (and (buffer-file-name) (buffer-modified-p)) - ;; Save the buffer - (save-buffer)) - - (let ((buffer (current-buffer)) - (checkers (flycheck-possibly-suitable-checkers))) - - ;; Now print all applicable checkers - (with-help-window (get-buffer-create " *Flycheck checkers*") - (with-current-buffer standard-output - (princ "Syntax checkers for buffer ") - (insert (propertize (buffer-name buffer) 'face 'bold)) - (princ " in ") - (let ((mode (buffer-local-value 'major-mode buffer))) - (insert-button (symbol-name mode) - 'type 'help-function - 'help-args (list mode))) - (princ ":\n\n") - (unless checkers - (insert (propertize "There are no syntax checkers for this buffer!\n\n" - 'face '(bold error)))) - (dolist (checker checkers) - (princ " ") - (insert-button (symbol-name checker) - 'type 'help-flycheck-checker-doc - 'help-args (list checker)) - (princ "\n") - (let* ((results (with-current-buffer buffer - (flycheck-verify-generic-checker checker))) - (label-length - (-max (mapcar - (lambda (res) - (length (flycheck-verification-result-label res))) - results))) - (message-column (+ 8 label-length))) - (dolist (result results) - (princ " - ") - (princ (flycheck-verification-result-label result)) - (princ ": ") - (princ (make-string (- message-column (current-column)) ?\ )) - (let ((message (flycheck-verification-result-message result)) - (face (flycheck-verification-result-face result))) - (insert (propertize message 'face face))) - (princ "\n"))) - (princ "\n")) - (princ "Flycheck Mode is ") - (let ((enabled (buffer-local-value 'flycheck-mode buffer))) - (insert (propertize (if enabled "enabled" "disabled") - 'face (if enabled 'success '(warning bold))))) - (princ ".\n") - - (let ((unregistered-checkers (-difference (flycheck-defined-checkers) - flycheck-checkers))) - (when unregistered-checkers - (insert (propertize "\nThe following syntax checkers are not registered:\n\n" - 'face '(bold warning))) - (dolist (checker unregistered-checkers) - (princ " - ") - (princ checker) - (princ "\n")) - (princ "\nTry adding these syntax checkers to `flycheck-checkers'."))))))) - - -;;; Predicates for generic syntax checkers -(defun flycheck-buffer-saved-p (&optional buffer) - "Determine whether BUFFER is saved to a file. - -BUFFER is the buffer to check. If omitted or nil, use the -current buffer as BUFFER. - -Return non-nil if the BUFFER is backed by a file, and not -modified, or nil otherwise." - (and (buffer-file-name buffer) (not (buffer-modified-p buffer)))) - - -;;; Extending generic checkers -(defun flycheck-add-next-checker (checker next &optional append) - "Add a NEXT checker after CHECKER. - -CHECKER is a syntax checker symbol, to which to add NEXT checker. - -NEXT is a cons cell `(LEVEL . NEXT-CHECKER)'. NEXT-CHECKER is a -symbol denoting the syntax checker to run after CHECKER. LEVEL -is an error level. NEXT-CHECKER will only be used if there is no -current error whose level is more severe than LEVEL. LEVEL may -also be t, in which case NEXT-CHECKER is used regardless of the -current errors. - -NEXT can also be a syntax checker symbol only, which is -equivalent to `(t . NEXT)'. - -NEXT-CHECKER is prepended before other next checkers, unless -APPEND is non-nil." - (unless (flycheck-valid-checker-p checker) - (error "%s is not a valid syntax checker" checker)) - (flycheck-validate-next-checker next 'strict) - (if append - (put checker 'flycheck-next-checkers - (append (get checker 'flycheck-next-checkers) (list next))) - (push next (get checker 'flycheck-next-checkers)))) - -(defun flycheck-add-mode (checker mode) - "Add a new major MODE to CHECKER. - -CHECKER and MODE are symbols denoting a syntax checker and a -major mode respectively. - -Add MODE to the `:modes' property of CHECKER, so that CHECKER -will be used in buffers with MODE." - (unless (flycheck-valid-checker-p checker) - (error "%s is not a valid syntax checker" checker)) - (unless (symbolp mode) - (error "%s is not a symbol" mode)) - (push mode (get checker 'flycheck-modes))) - - -;;; Generic syntax checks -(cl-defstruct (flycheck-syntax-check - (:constructor flycheck-syntax-check-new)) - "Structure for storing syntax check state. - -Slots: - -`buffer' - The buffer being checked - -`checker' - The syntax checker being used - -`context' - The context object." - buffer checker context) - -(defun flycheck-syntax-check-start (syntax-check callback) - "Start a SYNTAX-CHECK with CALLBACK." - (let ((checker (flycheck-syntax-check-checker syntax-check))) - (setf (flycheck-syntax-check-context syntax-check) - (funcall (get checker 'flycheck-start) checker callback)))) - -(defun flycheck-syntax-check-interrupt (syntax-check) - "Interrupt a SYNTAX-CHECK." - (let* ((checker (flycheck-syntax-check-checker syntax-check)) - (interrupt-fn (get checker 'flycheck-interrupt)) - (context (flycheck-syntax-check-context syntax-check))) - (when interrupt-fn - (funcall interrupt-fn checker context)))) - - -;;; Syntax checking mode - -(defvar flycheck-mode-map - (let ((map (make-sparse-keymap))) - (define-key map flycheck-keymap-prefix flycheck-command-map) - ;; We place the menu under a custom menu key. Since this menu key is not - ;; present in the menu of the global map, no top-level menu entry is added - ;; to the global menu bar. However, it still appears on the mode line - ;; lighter. - (define-key map [menu-bar flycheck] flycheck-mode-menu-map) - map) - "Keymap of `flycheck-mode'.") - -(defvar-local flycheck-old-next-error-function nil - "Remember the old `next-error-function'.") - -(defconst flycheck-hooks-alist - '( - ;; Handle events that may start automatic syntax checks - (after-save-hook . flycheck-handle-save) - (after-change-functions . flycheck-handle-change) - ;; Handle events that may triggered pending deferred checks - (window-configuration-change-hook . flycheck-perform-deferred-syntax-check) - (post-command-hook . flycheck-perform-deferred-syntax-check) - ;; Teardown Flycheck whenever the buffer state is about to get lost, to - ;; clean up temporary files and directories. - (kill-buffer-hook . flycheck-teardown) - (change-major-mode-hook . flycheck-teardown) - (before-revert-hook . flycheck-teardown) - ;; Update the error list if necessary - (post-command-hook . flycheck-error-list-update-source) - (post-command-hook . flycheck-error-list-highlight-errors) - ;; Show or hide error popups after commands - (post-command-hook . flycheck-display-error-at-point-soon) - (post-command-hook . flycheck-hide-error-buffer) - ;; Immediately show error popups when navigating to an error - (next-error-hook . flycheck-display-error-at-point)) - "Hooks which Flycheck needs to hook in. - -The `car' of each pair is a hook variable, the `cdr' a function -to be added or removed from the hook variable if Flycheck mode is -enabled and disabled respectively.") - -;;;###autoload -(define-minor-mode flycheck-mode - "Minor mode for on-the-fly syntax checking. - -When called interactively, toggle `flycheck-mode'. With prefix -ARG, enable `flycheck-mode' if ARG is positive, otherwise disable -it. - -When called from Lisp, enable `flycheck-mode' if ARG is omitted, -nil or positive. If ARG is `toggle', toggle `flycheck-mode'. -Otherwise behave as if called interactively. - -In `flycheck-mode' the buffer is automatically syntax-checked -using the first suitable syntax checker from `flycheck-checkers'. -Use `flycheck-select-checker' to select a checker for the current -buffer manually. - -\\{flycheck-mode-map}" - :init-value nil - :keymap flycheck-mode-map - :lighter flycheck-mode-line - :group 'flycheck - :require 'flycheck - :after-hook (flycheck-buffer-automatically 'mode-enabled 'force-deferred) - (cond - (flycheck-mode - (flycheck-clear) - - (pcase-dolist (`(,hook . ,fn) flycheck-hooks-alist) - (add-hook hook fn nil 'local)) - - (setq flycheck-old-next-error-function (if flycheck-standard-error-navigation - next-error-function - :unset)) - (when flycheck-standard-error-navigation - (setq next-error-function #'flycheck-next-error-function))) - (t - (unless (eq flycheck-old-next-error-function :unset) - (setq next-error-function flycheck-old-next-error-function)) - - (pcase-dolist (`(,hook . ,fn) flycheck-hooks-alist) - (remove-hook hook fn 'local)) - - (flycheck-teardown)))) - - -;;; Syntax checker selection for the current buffer -(defvar-local flycheck-last-checker nil - "The last checker used for the current buffer.") - -(defun flycheck-clear-checker () - "Clear configured and remembered checkers in the current buffer." - (setq flycheck-last-checker nil)) - -(defun flycheck-try-last-checker-for-buffer () - "Try the last checker for the current buffer. - -Return the checker if it may be used, or nil otherwise." - ;; We should not use the last checker if it was removed from the list of - ;; allowed checkers in the meantime - (when (and (flycheck-registered-checker-p flycheck-last-checker) - (flycheck-may-use-checker flycheck-last-checker)) - flycheck-last-checker)) - -(defun flycheck-get-new-checker-for-buffer () - "Find a new checker for the current buffer. - -Return the checker if there is any, or nil otherwise." - (let ((checkers flycheck-checkers)) - (while (and checkers (not (flycheck-may-use-checker (car checkers)))) - (setq checkers (cdr checkers))) - (car checkers))) - -(defun flycheck-get-checker-for-buffer () - "Find the checker for the current buffer. - -Return checker if there is a checker for the current buffer, or -nil otherwise." - (if flycheck-checker - (if (flycheck-may-use-checker flycheck-checker) - flycheck-checker - (user-error "Selected syntax checker %s cannot be used" - flycheck-checker)) - (or (flycheck-try-last-checker-for-buffer) - (flycheck-get-new-checker-for-buffer)))) - -(defun flycheck-get-next-checker-for-buffer (checker) - "Get the checker to run after CHECKER for the current buffer." - (let ((next-checkers (flycheck-checker-next-checkers checker))) - (while (and next-checkers - (not (flycheck-may-use-next-checker (car next-checkers)))) - (setq next-checkers (cdr next-checkers))) - (when next-checkers - (if (symbolp (car next-checkers)) - (car next-checkers) - (cdar next-checkers))))) - -(defun flycheck-select-checker (checker) - "Select CHECKER for the current buffer. - -CHECKER is a syntax checker symbol (see `flycheck-checkers') or -nil. In the former case, use CHECKER for the current buffer, -otherwise deselect the current syntax checker (if any) and use -automatic checker selection via `flycheck-checkers'. - -If called interactively prompt for CHECKER. With prefix arg -deselect the current syntax checker and enable automatic -selection again. - -Set `flycheck-checker' to CHECKER and automatically start a new -syntax check if the syntax checker changed. - -CHECKER will be used, even if it is not contained in -`flycheck-checkers', or if it is disabled via -`flycheck-disabled-checkers'." - (interactive - (if current-prefix-arg - (list nil) - (list (read-flycheck-checker "Select checker: " flycheck-last-checker)))) - (when (not (eq checker flycheck-checker)) - (unless (or (not checker) (flycheck-may-use-checker checker)) - (user-error "Can't use syntax checker %S in this buffer" checker)) - (setq flycheck-checker checker - ;; Clear cached checker to make sure that automatic selection restarts - ;; if necessary - flycheck-last-checker nil) - (when flycheck-mode - (flycheck-buffer)))) - -(defun flycheck-disable-checker (checker &optional enable) - "Interactively disable CHECKER for the current buffer. - -Interactively, prompt for a syntax checker to disable, and add -the syntax checker to the buffer-local value of -`flycheck-disabled-checkers'. With prefix arg, prompt for a -disabled syntax checker and re-enable it by removing it from the -buffer-local value of `flycheck-disabled-checkers'." - (interactive - (let* ((enable current-prefix-arg) - (candidates (if enable flycheck-disabled-checkers flycheck-checkers)) - (prompt (if enable "Enable syntax checker: " - "Disable syntax checker: "))) - (when (and enable (not candidates)) - (user-error "No syntax checkers disabled in this buffer")) - (list (read-flycheck-checker prompt nil nil candidates) enable))) - (unless checker - (user-error "No syntax checker given")) - (if enable - ;; We must use `remq' instead of `delq', because we must _not_ modify the - ;; list. Otherwise we could potentially modify the global default value, - ;; in case the list is the global default. - (setq flycheck-disabled-checkers (remq checker flycheck-disabled-checkers)) - (unless (memq checker flycheck-disabled-checkers) - (push checker flycheck-disabled-checkers)))) -(put 'flycheck-disable-checker 'interactive-only - "Directly set `flycheck-disabled-checkers' instead") - - -;;; Syntax checks for the current buffer -(defvar-local flycheck-current-syntax-check nil - "The current syntax check in the this buffer.") -(put 'flycheck-current-syntax-check 'permanent-local t) - -(defun flycheck-start-current-syntax-check (checker) - "Start a syntax check in the current buffer with CHECKER. - -Set `flycheck-current-syntax-check' accordingly." - ;; Allocate the current syntax check *before* starting it. This allows for - ;; synchronous checks, which call the status callback immediately in there - ;; start function. - (let* ((check (flycheck-syntax-check-new :buffer (current-buffer) - :checker checker - :context nil)) - (callback (flycheck-buffer-status-callback check))) - (setq flycheck-current-syntax-check check) - (flycheck-report-status 'running) - (flycheck-syntax-check-start check callback))) - -(defun flycheck-running-p () - "Determine whether a syntax check is running in the current buffer." - (not (null flycheck-current-syntax-check))) - -(defun flycheck-stop () - "Stop any ongoing syntax check in the current buffer." - (when (flycheck-running-p) - (flycheck-syntax-check-interrupt flycheck-current-syntax-check) - ;; Remove the current syntax check, to reset Flycheck into a non-running - ;; state, and to make `flycheck-report-buffer-checker-status' ignore any - ;; status reports from the current syntax check. - (setq flycheck-current-syntax-check nil) - (flycheck-report-status 'interrupted))) - -(defun flycheck-buffer-status-callback (syntax-check) - "Create a status callback for SYNTAX-CHECK in the current buffer." - (lambda (&rest args) - (apply #'flycheck-report-buffer-checker-status - syntax-check args))) - -(defun flycheck-buffer () - "Check syntax in the current buffer. - -The syntax checker used for the syntax check is cached in -`flycheck-last-checker' and re-used for the next check, if -possible." - (interactive) - (flycheck-clean-deferred-check) - (if flycheck-mode - (unless (flycheck-running-p) - ;; Clear error list and mark all overlays for deletion. We do not - ;; delete all overlays immediately to avoid excessive re-displays and - ;; flickering, if the same errors gets highlighted again after the check - ;; completed. - (run-hooks 'flycheck-before-syntax-check-hook) - (flycheck-clear-errors) - (flycheck-mark-all-overlays-for-deletion) - (condition-case err - (let* ((checker (flycheck-get-checker-for-buffer))) - (if checker - (progn - ;; Remember the last syntax checker to speed up checker - ;; selection - (setq flycheck-last-checker checker) - (flycheck-start-current-syntax-check checker)) - (flycheck-clear) - (flycheck-report-status 'no-checker))) - (error - (flycheck-report-failed-syntax-check) - (signal (car err) (cdr err))))) - (user-error "Flycheck mode disabled"))) - -(defun flycheck-report-buffer-checker-status - (syntax-check status &optional data) - "In BUFFER, report a SYNTAX-CHECK STATUS with DATA. - -SYNTAX-CHECK is the `flycheck-syntax-check' which reported -STATUS. STATUS denotes the status of CHECKER, with an optional -DATA. STATUS may be one of the following symbols: - -`errored' - The syntax checker has errored. DATA is an optional error - message. - - This report finishes the current syntax check. - -`interrupted' - The syntax checker was interrupted. DATA is ignored. - - This report finishes the current syntax check. - -`finished' - The syntax checker has finished with a proper error report - for the current buffer. DATA is the (potentially empty) - list of `flycheck-error' objects reported by the syntax - check. - - This report finishes the current syntax check. - -`suspicious' - The syntax checker encountered a suspicious state, which the - user needs to be informed about. DATA is an optional - message. - -A syntax checker _must_ report a status at least once with any -symbol that finishes the current syntax checker. Otherwise -Flycheck gets stuck with the current syntax check. - -If CHECKER is not the currently used syntax checker in -`flycheck-current-syntax-check', the status report is largely -ignored. Notably, any errors reported by the checker are -discarded." - (let ((buffer (flycheck-syntax-check-buffer syntax-check))) - ;; Ignore the status report if the buffer is gone, or if this syntax check - ;; isn't the current one in buffer (which can happen if this is an old - ;; report of an interrupted syntax check, and a new syntax check was started - ;; since this check was interrupted) - (when (and (buffer-live-p buffer) - (eq syntax-check - (buffer-local-value 'flycheck-current-syntax-check buffer))) - (with-current-buffer buffer - (let ((checker (flycheck-syntax-check-checker syntax-check))) - (pcase status - ((or `errored `interrupted) - (flycheck-report-failed-syntax-check status) - (when (eq status 'errored) - ;; In case of error, show the error message - (message "Error from syntax checker %s: %s" - checker (or data "UNKNOWN!")))) - (`suspicious - (when flycheck-mode - (message "Suspicious state from syntax checker %s: %s" - checker (or data "UNKNOWN!"))) - (flycheck-report-status 'suspicious)) - (`finished - (when flycheck-mode - ;; Only report errors from the checker if Flycheck Mode is - ;; still enabled. - (flycheck-finish-current-syntax-check data))) - (_ - (error "Unknown status %s from syntax checker %s" - status checker)))))))) - -(defun flycheck-finish-current-syntax-check (errors) - "Finish the current syntax-check in the current buffer with ERRORS. - -ERRORS is a list of `flycheck-error' objects reported by the -current syntax check in `flycheck-current-syntax-check'. - -Report all ERRORS and potentially start any next syntax checkers. - -If the current syntax checker reported excessive errors, it is disabled -via `flycheck-disable-excessive-checker' for subsequent syntax -checks." - (let* ((syntax-check flycheck-current-syntax-check) - (checker (flycheck-syntax-check-checker syntax-check)) - (errors (flycheck-relevant-errors - (flycheck-filter-errors - (flycheck-assert-error-list-p errors) checker)))) - (unless (flycheck-disable-excessive-checker checker errors) - (flycheck-report-current-errors errors)) - (let ((next-checker (flycheck-get-next-checker-for-buffer checker))) - (if next-checker - (flycheck-start-current-syntax-check next-checker) - (setq flycheck-current-syntax-check nil) - (flycheck-report-status 'finished) - ;; Delete overlays only after the very last checker has run, to avoid - ;; flickering on intermediate re-displays - (flycheck-delete-marked-overlays) - (flycheck-error-list-refresh) - (run-hooks 'flycheck-after-syntax-check-hook) - (when (eq (current-buffer) (window-buffer)) - (flycheck-display-error-at-point)) - ;; Immediately try to run any pending deferred syntax check, which - ;; were triggered by intermediate automatic check event, to make sure - ;; that we quickly refine outdated error information - (flycheck-perform-deferred-syntax-check))))) - -(defun flycheck-disable-excessive-checker (checker errors) - "Disable CHECKER if it reported excessive ERRORS. - -If ERRORS has more items than `flycheck-checker-error-threshold', -add CHECKER to `flycheck-disabled-checkers', and show a warning. - -Return t when CHECKER was disabled, or nil otherwise." - (when (and flycheck-checker-error-threshold - (> (length errors) flycheck-checker-error-threshold)) - ;; Disable CHECKER for this buffer (`flycheck-disabled-checkers' is a local - ;; variable). - (lwarn '(flycheck syntax-checker) :warning - "Syntax checker %s reported too many errors (%s) and is disabled." - checker (length errors)) - (push checker flycheck-disabled-checkers) - t)) - -(defun flycheck-clear (&optional shall-interrupt) - "Clear all errors in the current buffer. - -With prefix arg or SHALL-INTERRUPT non-nil, also interrupt the -current syntax check." - (interactive "P") - (when shall-interrupt - (flycheck-stop)) - (flycheck-delete-all-overlays) - (flycheck-clear-errors) - (flycheck-error-list-refresh) - (flycheck-hide-error-buffer)) - -(defun flycheck-teardown () - "Teardown Flycheck in the current buffer.. - -Completely clear the whole Flycheck state. Remove overlays, kill -running checks, and empty all variables used by Flycheck." - (flycheck-safe-delete-temporaries) - (flycheck-stop) - (flycheck-clean-deferred-check) - (flycheck-clear) - (flycheck-cancel-error-display-error-at-point-timer) - (flycheck-clear-checker)) - - -;;; Automatic syntax checking in a buffer -(defun flycheck-may-check-automatically (&optional condition) - "Determine whether the buffer may be checked under CONDITION. - -Read-only buffers may never be checked automatically. - -If CONDITION is non-nil, determine whether syntax may checked -automatically according to -`flycheck-check-syntax-automatically'." - (and (not (or buffer-read-only (flycheck-ephemeral-buffer-p))) - (or (not condition) - (memq condition flycheck-check-syntax-automatically)))) - -(defun flycheck-buffer-automatically (&optional condition force-deferred) - "Automatically check syntax at CONDITION. - -Syntax is not checked if `flycheck-may-check-automatically' -returns nil for CONDITION. - -The syntax check is deferred if FORCE-DEFERRED is non-nil, or if -`flycheck-must-defer-check' returns t." - (when (and flycheck-mode (flycheck-may-check-automatically condition)) - (if (or force-deferred (flycheck-must-defer-check)) - (flycheck-buffer-deferred) - (with-demoted-errors "Error while checking syntax automatically: %S" - (flycheck-buffer))))) - -(defvar-local flycheck-idle-change-timer nil - "Timer to mark the idle time since the last change.") - -(defun flycheck-clear-idle-change-timer () - "Clear the idle change timer." - (when flycheck-idle-change-timer - (cancel-timer flycheck-idle-change-timer) - (setq flycheck-idle-change-timer nil))) - -(defun flycheck-handle-change (beg end _len) - "Handle a buffer change between BEG and END. - -BEG and END mark the beginning and end of the change text. _LEN -is ignored. - -Start a syntax check if a new line has been inserted into the -buffer." - ;; Save and restore the match data, as recommended in (elisp)Change Hooks - (save-match-data - (when flycheck-mode - ;; The buffer was changed, thus clear the idle timer - (flycheck-clear-idle-change-timer) - (if (string-match-p (rx "\n") (buffer-substring beg end)) - (flycheck-buffer-automatically 'new-line 'force-deferred) - (setq flycheck-idle-change-timer - (run-at-time flycheck-idle-change-delay nil - #'flycheck-handle-idle-change)))))) - -(defun flycheck-handle-idle-change () - "Handle an expired idle time since the last change." - (flycheck-clear-idle-change-timer) - (flycheck-buffer-automatically 'idle-change)) - -(defun flycheck-handle-save () - "Handle a save of the buffer." - (flycheck-buffer-automatically 'save)) - - -;;; Deferred syntax checking -(defvar-local flycheck-deferred-syntax-check nil - "If non-nil, a deferred syntax check is pending.") - -(defun flycheck-must-defer-check () - "Determine whether the syntax check has to be deferred. - -A check has to be deferred if the buffer is not visible, or if the buffer is -currently being reverted. - -Return t if the check is to be deferred, or nil otherwise." - (or (not (get-buffer-window)) - ;; We defer the syntax check if Flycheck is already running, to - ;; immediately start a new syntax check after the current one finished, - ;; because the result of the current check will most likely be outdated by - ;; the time it is finished. - (flycheck-running-p) - ;; We must defer checks while a buffer is being reverted, to avoid race - ;; conditions while the buffer contents are being restored. - revert-buffer-in-progress-p)) - -(defun flycheck-deferred-check-p () - "Determine whether the current buffer has a deferred check. - -Return t if so, or nil otherwise." - flycheck-deferred-syntax-check) - -(defun flycheck-buffer-deferred () - "Defer syntax check for the current buffer." - (setq flycheck-deferred-syntax-check t)) - -(defun flycheck-clean-deferred-check () - "Clean an deferred syntax checking state." - (setq flycheck-deferred-syntax-check nil)) - -(defun flycheck-perform-deferred-syntax-check () - "Perform any deferred syntax checks." - (when (flycheck-deferred-check-p) - (flycheck-clean-deferred-check) - (flycheck-buffer-automatically))) - - -;;; Syntax checking in all buffers -(defun flycheck-may-enable-mode () - "Determine whether Flycheck mode may be enabled. - -Flycheck mode is not enabled for - -- the minibuffer, -- major modes whose `mode-class' property is `special', -- ephemeral buffers (see `flycheck-ephemeral-buffer-p'), -- encrypted buffers (see `flycheck-encrypted-buffer-p'), -- remote files (see `file-remote-p'), -- and major modes excluded by `flycheck-global-modes'. - -Return non-nil if Flycheck mode may be enabled, and nil -otherwise." - (and (pcase flycheck-global-modes - ;; Whether `major-mode' is disallowed by `flycheck-global-modes' - (`t t) - (`(not . ,modes) (not (memq major-mode modes))) - (modes (memq major-mode modes))) - (not (or (minibufferp) - (eq (get major-mode 'mode-class) 'special) - (flycheck-ephemeral-buffer-p) - (flycheck-encrypted-buffer-p) - (and (buffer-file-name) - (file-remote-p (buffer-file-name) 'method)))))) - -(defun flycheck-mode-on-safe () - "Enable `flycheck-mode' if it is safe to do so. - -`flycheck-mode' is only enabled if `flycheck-may-enable-mode' -returns t." - (when (flycheck-may-enable-mode) - (flycheck-mode))) - -;;;###autoload -(define-globalized-minor-mode global-flycheck-mode flycheck-mode - flycheck-mode-on-safe - :init-value nil - :group 'flycheck - :require 'flycheck) - -(defun flycheck-global-teardown () - "Teardown Flycheck in all buffers. - -Completely clear the whole Flycheck state in all buffers, stop -all running checks, remove all temporary files, and empty all -variables of Flycheck." - (dolist (buffer (buffer-list)) - (with-current-buffer buffer - (when flycheck-mode - (flycheck-teardown))))) - -;; Clean up the entire state of Flycheck when Emacs is killed, to get rid of any -;; pending temporary files. -(add-hook 'kill-emacs-hook #'flycheck-global-teardown) - - -;;; Errors from syntax checks -(cl-defstruct (flycheck-error - (:constructor flycheck-error-new) - (:constructor flycheck-error-new-at (line column - &optional level message - &key checker id - (filename (buffer-file-name)) - (buffer (current-buffer))))) - "Structure representing an error reported by a syntax checker. -Slots: - -`buffer' - The buffer the reported was reported for, as buffer object. - -`checker' - The syntax checker which reported this error, as symbol. - -`filename' - The file name the error refers to, as string. - -`line' - The line number the error refers to, as number. - -`column' (optional) - The column number the error refers to, as number. - - For compatibility with external tools and unlike Emacs - itself (e.g. in Compile Mode) Flycheck uses _1-based_ - columns: The first character on a line is column 1. - - Occasionally some tools try to proactively adapt to Emacs - and emit 0-based columns automatically. In these cases, the - columns must be adjusted for Flycheck, see - `flycheck-increment-error-columns'. - -`level' - The error level, as either `warning' or `error'. - -`id' (optional) - An ID identifying the kind of error." - buffer checker filename line column message level id) - -(defmacro flycheck-error-with-buffer (err &rest forms) - "Switch to the buffer of ERR and evaluate FORMS. - -If the buffer of ERR is not live, FORMS are not evaluated." - (declare (indent 1) (debug t)) - `(when (buffer-live-p (flycheck-error-buffer ,err)) - (with-current-buffer (flycheck-error-buffer ,err) - ,@forms))) - -(defun flycheck-error-line-region (err) - "Get the line region of ERR. - -ERR is a Flycheck error whose region to get. - -Return a cons cell `(BEG . END)' where BEG is the first -non-whitespace character on the line ERR refers to, and END the -end of the line." - (flycheck-error-with-buffer err - (save-restriction - (save-excursion - (widen) - (goto-char (point-min)) - (forward-line (- (flycheck-error-line err) 1)) - ;; We are at the beginning of the line now, so move to the beginning of - ;; its indentation, similar to `back-to-indentation' - (let ((end (line-end-position))) - (skip-syntax-forward " " end) - (backward-prefix-chars) - ;; If the current line is empty, include the previous line break - ;; character(s) to have any region at all. When called with 0, - ;; `line-end-position' gives us the end of the previous line - (cons (if (eolp) (line-end-position 0) (point)) end)))))) - -(defun flycheck-error-column-region (err) - "Get the error column region of ERR. - -ERR is a Flycheck error whose region to get. - -Return a cons cell `(BEG . END)' where BEG is the character -before the error column, and END the actual error column, or nil -if ERR has no column." - (flycheck-error-with-buffer err - (save-restriction - (save-excursion - (-when-let (column (flycheck-error-column err)) - (widen) - (goto-char (point-min)) - (forward-line (- (flycheck-error-line err) 1)) - (cond - ((eobp) ; Line beyond EOF - ;; If we are at the end of the file (i.e. the line was beyond the - ;; end of the file), use the very last column in the file. - (cons (- (point-max) 1) (point-max))) - ((eolp) ; Empty line - ;; If the target line is empty, there's no column to highlight on - ;; this line, so return the last column of the previous line. - (cons (line-end-position 0) (point))) - (t - ;; The end is either the column offset of the line, or the end of - ;; the line, if the column offset points beyond the end of the - ;; line. - (let ((end (min (+ (point) column) - (+ (line-end-position) 1)))) - (cons (- end 1) end))))))))) - -(defun flycheck-error-thing-region (thing err) - "Get the region of THING at the column of ERR. - -ERR is a Flycheck error whose region to get. THING is a -understood by `thing-at-point'. - -Return a cons cell `(BEG . END)' where BEG is the beginning of -the THING at the error column, and END the end of the symbol. If -ERR has no error column, or if there is no THING at this column, -return nil." - (-when-let (column (car (flycheck-error-column-region err))) - (flycheck-error-with-buffer err - (save-excursion - (save-restriction - (widen) - (goto-char column) - (bounds-of-thing-at-point thing)))))) - -(defun flycheck-error-region-for-mode (err mode) - "Get the region of ERR for the highlighting MODE. - -ERR is a Flycheck error. MODE may be one of the following symbols: - -`columns' - Get the column region of ERR, or the line region if ERR - has no column. - -`symbols' - Get the symbol region of ERR, or the result of `columns', if - there is no sexp at the error column. - -`sexps' - Get the sexp region of ERR, or the result of `columns', if - there is no sexp at the error column. - -`lines' - Return the line region. - -Otherwise signal an error." - (pcase mode - (`columns (or (flycheck-error-column-region err) - (flycheck-error-line-region err))) - (`symbols (or (flycheck-error-thing-region 'symbol err) - (flycheck-error-region-for-mode err 'columns))) - (`sexps (or (flycheck-error-thing-region 'sexp err) - (flycheck-error-region-for-mode err 'columns))) - (`lines (flycheck-error-line-region err)) - (_ (error "Invalid mode %S" mode)))) - -(defun flycheck-error-pos (err) - "Get the buffer position of ERR. - -ERR is a Flycheck error whose position to get. - -The error position is the error column, or the first -non-whitespace character of the error line, if ERR has no error column." - (car (or (flycheck-error-column-region err) - (flycheck-error-line-region err)))) - -(defun flycheck-error-format-message-and-id (err) - "Format the message and id of ERR as human-readable string." - (let ((id (flycheck-error-id err)) - (message (flycheck-error-message err))) - (if id (format "%s [%s]" message id) message))) - -(defun flycheck-error-format (err) - "Format ERR as human-readable string. - -Return a string that represents the given ERR. This string does -_not_ include the file name." - (let* ((line (flycheck-error-line err)) - (column (flycheck-error-column err)) - (level (symbol-name (flycheck-error-level err))) - (checker (symbol-name (flycheck-error-checker err))) - (format `(,(number-to-string line) ":" - ,@(when column (list (number-to-string column) ":")) - ,level ": " - ,(flycheck-error-format-message-and-id err) - " (" ,checker ")"))) - (apply #'concat format))) - -(defun flycheck-error-< (err1 err2) - "Determine whether ERR1 goes before ERR2 by location. - -Compare by line numbers and then by column numbers." - (let ((line1 (flycheck-error-line err1)) - (line2 (flycheck-error-line err2))) - (if (= line1 line2) - (let ((col1 (flycheck-error-column err1)) - (col2 (flycheck-error-column err2))) - (and col2 - ;; Sort errors for the whole line first - (or (not col1) (< col1 col2)))) - (< line1 line2)))) - -(defun flycheck-error-level-< (err1 err2) - "Determine whether ERR1 goes before ERR2 by error level. - -Like `flycheck-error-<', but compares by error level severity -first. Levels of the same severity are compared by name." - (let* ((level1 (flycheck-error-level err1)) - (level2 (flycheck-error-level err2)) - (severity1 (flycheck-error-level-severity level1)) - (severity2 (flycheck-error-level-severity level2))) - (cond - ((= severity1 severity2) - (if (string= level1 level2) - (flycheck-error-< err1 err2) - (string< level1 level2))) - (t (< severity1 severity2))))) - -(defun flycheck-assert-error-list-p (errors) - "Assert that all items in ERRORS are of `flycheck-error' type. - -Signal an error if any item in ERRORS is not a `flycheck-error' -object, as by `flycheck-error-p'. Otherwise return ERRORS -again." - (unless (listp errors) - (signal 'wrong-type-argument (list 'listp errors))) - (dolist (err errors) - (unless (flycheck-error-p err) - (signal 'wrong-type-argument (list 'flycheck-error-p err)))) - errors) - - -;;; Errors in the current buffer -(defvar-local flycheck-current-errors nil - "A list of all errors and warnings in the current buffer.") - -(defun flycheck-report-current-errors (errors) - "Report ERRORS in the current buffer. - -Add ERRORS to `flycheck-current-errors' and process each error -with `flycheck-process-error-functions'." - (setq flycheck-current-errors (sort (append errors flycheck-current-errors) - #'flycheck-error-<)) - (mapc (lambda (err) - (run-hook-with-args-until-success 'flycheck-process-error-functions - err)) - errors)) - -(defun flycheck-clear-errors () - "Remove all error information from the current buffer." - (setq flycheck-current-errors nil) - (flycheck-report-status 'not-checked)) - -(defun flycheck-relevant-error-p (err) - "Determine whether ERR is relevant for the current buffer. - -Return t if ERR may be shown for the current buffer, or nil -otherwise." - (flycheck-error-with-buffer err - (let ((file-name (flycheck-error-filename err)) - (message (flycheck-error-message err))) - (and - (or (not file-name) (flycheck-same-files-p file-name (buffer-file-name))) - message - (not (string-empty-p message)) - (flycheck-error-line err))))) - -(defun flycheck-relevant-errors (errors) - "Filter the relevant errors from ERRORS. - -Return a list of all errors that are relevant for their -corresponding buffer." - (-filter #'flycheck-relevant-error-p errors)) - - -;;; Status reporting for the current buffer -(defvar-local flycheck-last-status-change 'not-checked - "The last status change in the current buffer.") - -(defun flycheck-report-failed-syntax-check (&optional status) - "Report a failed Flycheck syntax check with STATUS. - -STATUS is a status symbol for `flycheck-report-status', -defaulting to `errored'. - -Clear Flycheck state, run `flycheck-syntax-check-failed-hook' and -report an error STATUS." - (flycheck-clear) - (setq flycheck-current-syntax-check nil) - (run-hooks 'flycheck-syntax-check-failed-hook) - (flycheck-report-status (or status 'errored))) - -(defun flycheck-report-status (status) - "Report Flycheck STATUS. - -STATUS is one of the following symbols: - -`not-checked' - The current buffer was not checked. - -`no-checker' - Automatic syntax checker selection did not find a suitable - syntax checker. - -`running' - A syntax check is now running in the current buffer. - -`errored' - The current syntax check has errored. - -`finished' - The current syntax check was finished normally. - -`interrupted' - The current syntax check was interrupted. - -`suspicious' - The last syntax check had a suspicious result. - -Set `flycheck-last-status-change' and call -`flycheck-status-changed-functions' with STATUS. Afterwards -refresh the mode line." - (setq flycheck-last-status-change status) - (run-hook-with-args 'flycheck-status-changed-functions status) - (force-mode-line-update)) - -(defun flycheck-mode-line-status-text (&optional status) - "Get a text describing STATUS for use in the mode line. - -STATUS defaults to `flycheck-last-status-change' if omitted or -nil." - (let ((text (pcase (or status flycheck-last-status-change) - (`not-checked "") - (`no-checker "-") - (`running "*") - (`errored "!") - (`finished - (if flycheck-current-errors - (let-alist (flycheck-count-errors flycheck-current-errors) - (format ":%s/%s" (or .error 0) (or .warning 0))) - "")) - (`interrupted "-") - (`suspicious "?")))) - (concat " FlyC" text))) - - -;;; Error levels -;;;###autoload -(defun flycheck-define-error-level (level &rest properties) - "Define a new error LEVEL with PROPERTIES. - -The following PROPERTIES constitute an error level: - -`:severity SEVERITY' - A number denoting the severity of this level. The higher - the number, the more severe is this level compared to other - levels. Defaults to 0. - - The severity is used by `flycheck-error-level-<' to - determine the ordering of errors according to their levels. - -`:overlay-category CATEGORY' - A symbol denoting the overlay category to use for error - highlight overlays for this level. See Info - node `(elisp)Overlay Properties' for more information about - overlay categories. - - A category for an error level overlay should at least define - the `face' property, for error highlighting. Other useful - properties for error level categories are `priority' to - influence the stacking of multiple error level overlays, and - `help-echo' to define a default error messages for errors - without messages. - -`:fringe-bitmap BITMAP' - A fringe bitmap symbol denoting the bitmap to use for fringe - indicators for this level. See Info node `(elisp)Fringe - Bitmaps' for more information about fringe bitmaps, - including a list of built-in fringe bitmaps. - -`:fringe-face FACE' - A face symbol denoting the face to use for fringe indicators - for this level. - -`:error-list-face FACE' - A face symbol denoting the face to use for messages of this - level in the error list. See `flycheck-list-errors'." - (declare (indent 1)) - (put level 'flycheck-error-level t) - (put level 'flycheck-error-severity - (or (plist-get properties :severity) 0)) - (put level 'flycheck-overlay-category - (plist-get properties :overlay-category)) - (put level 'flycheck-fringe-bitmap - (plist-get properties :fringe-bitmap)) - (put level 'flycheck-fringe-face - (plist-get properties :fringe-face)) - (put level 'flycheck-error-list-face - (plist-get properties :error-list-face))) - -(defun flycheck-error-level-p (level) - "Determine whether LEVEL is a Flycheck error level." - (get level 'flycheck-error-level)) - -(defun flycheck-error-level-severity (level) - "Get the numeric severity of LEVEL." - (or (get level 'flycheck-error-severity) 0)) - -(defun flycheck-error-level-overlay-category (level) - "Get the overlay category for LEVEL." - (get level 'flycheck-overlay-category)) - -(defun flycheck-error-level-fringe-bitmap (level) - "Get the fringe bitmap for LEVEL." - (get level 'flycheck-fringe-bitmap)) - -(defun flycheck-error-level-fringe-face (level) - "Get the fringe face for LEVEL." - (get level 'flycheck-fringe-face)) - -(defun flycheck-error-level-error-list-face (level) - "Get the error list face for LEVEL." - (get level 'flycheck-error-list-face)) - -(defun flycheck-error-level-make-fringe-icon (level side) - "Create the fringe icon for LEVEL at SIDE. - -Return a propertized string that shows a fringe bitmap according -to LEVEL and the given fringe SIDE. - -LEVEL is a Flycheck error level defined with -`flycheck-define-error-level', and SIDE is either `left-fringe' -or `right-fringe'. - -Return a propertized string representing the fringe icon, -intended for use as `before-string' of an overlay to actually -show the icon." - (unless (memq side '(left-fringe right-fringe)) - (error "Invalid fringe side: %S" side)) - (propertize "!" 'display - (list side - (flycheck-error-level-fringe-bitmap level) - (flycheck-error-level-fringe-face level)))) - - -;;; Built-in error levels -(put 'flycheck-error-overlay 'face 'flycheck-error) -(put 'flycheck-error-overlay 'priority 110) -(put 'flycheck-error-overlay 'help-echo "Unknown error.") - -(flycheck-define-error-level 'error - :severity 100 - :overlay-category 'flycheck-error-overlay - :fringe-bitmap 'exclamation-mark - :fringe-face 'flycheck-fringe-error - :error-list-face 'flycheck-error-list-error) - -(put 'flycheck-warning-overlay 'face 'flycheck-warning) -(put 'flycheck-warning-overlay 'priority 100) -(put 'flycheck-warning-overlay 'help-echo "Unknown warning.") - -(flycheck-define-error-level 'warning - :severity 10 - :overlay-category 'flycheck-warning-overlay - :fringe-bitmap 'question-mark - :fringe-face 'flycheck-fringe-warning - :error-list-face 'flycheck-error-list-warning) - -(put 'flycheck-info-overlay 'face 'flycheck-info) -(put 'flycheck-info-overlay 'priority 90) -(put 'flycheck-info-overlay 'help-echo "Unknown info.") - -(flycheck-define-error-level 'info - :severity -1 - :overlay-category 'flycheck-info-overlay - ;; Not exactly the right indicator, but looks pretty, and I prefer to use - ;; built-in bitmaps over diving into the hassle of messing around with custom - ;; fringe bitmaps - :fringe-bitmap 'empty-line - :fringe-face 'flycheck-fringe-info - :error-list-face 'flycheck-error-list-info) - - -;;; Error filtering -(defun flycheck-filter-errors (errors checker) - "Filter ERRORS from CHECKER. - -Apply the error filter of CHECKER to ERRORs and return the -result. If CHECKER has no error filter, fall back to -`flycheck-sanitize-errors'." - (let ((filter (or (flycheck-checker-error-filter checker) - #'flycheck-sanitize-errors))) - (funcall filter errors))) - -(defun flycheck-sanitize-errors (errors) - "Sanitize ERRORS. - -Sanitize ERRORS by trimming leading and trailing whitespace in -all error messages, and by replacing 0 columns and empty error -messages with nil. - -Returns sanitized ERRORS." - (dolist (err errors) - (flycheck-error-with-buffer err - (let ((message (flycheck-error-message err)) - (column (flycheck-error-column err))) - (when message - (setq message (string-trim message)) - (setf (flycheck-error-message err) - (if (string-empty-p message) nil message))) - (when (eq column 0) - (setf (flycheck-error-column err) nil))))) - errors) - -(defun flycheck-increment-error-columns (errors &optional offset) - "Increment all columns of ERRORS by OFFSET. - -Use this as `:error-filter' if a syntax checker outputs 0-based -columns." - (mapc (lambda (err) - (let ((column (flycheck-error-column err))) - (when column - (setf (flycheck-error-column err) - (+ column (or offset 1)))))) - errors) - errors) - -(defun flycheck-collapse-error-message-whitespace (errors) - "Collapse whitespace in all messages of ERRORS. - -Return ERRORS." - (dolist (err errors) - (-when-let (message (flycheck-error-message err)) - (setf (flycheck-error-message err) - (replace-regexp-in-string (rx (one-or-more (any space "\n" "\r"))) - " " message 'fixed-case 'literal)))) - errors) - -(defun flycheck-dedent-error-messages (errors) - "Dedent all messages of ERRORS. - -For each error in ERRORS, determine the indentation offset from -the leading whitespace of the first line, and dedent all further -lines accordingly. - -Return ERRORS, with in-place modifications." - (dolist (err errors) - (-when-let (message (flycheck-error-message err)) - (with-temp-buffer - (insert message) - ;; Determine the indentation offset - (goto-char (point-min)) - (back-to-indentation) - (let* ((indent-offset (- (point) (point-min)))) - ;; Now iterate over all lines and dedent each according to - ;; `indent-offset' - (while (not (eobp)) - (back-to-indentation) - ;; If the current line starts with sufficient whitespace, delete the - ;; indendation offset. Otherwise keep the line intact, as we might - ;; loose valuable information - (when (>= (- (point) (line-beginning-position)) indent-offset) - (delete-char (- indent-offset))) - (forward-line 1))) - (delete-trailing-whitespace (point-min) (point-max)) - (setf (flycheck-error-message err) - (buffer-substring-no-properties (point-min) (point-max)))))) - errors) - -(defun flycheck-fold-include-levels (errors sentinel-message) - "Fold levels of ERRORS from included files. - -ERRORS is a list of `flycheck-error' objects. SENTINEL-MESSAGE -is a regular expression matched against the error message to -determine whether the errror denotes errors from an included -file. Alternatively, it is a function that is given an error and -shall return non-nil, if the error denotes errors from an -included file." - (unless (or (stringp sentinel-message) (functionp sentinel-message)) - (error "Sentinel must be string or function: %S" sentinel-message)) - (let ((sentinel (if (functionp sentinel-message) - sentinel-message - (lambda (err) - (string-match-p sentinel-message - (flycheck-error-message err))))) - (remaining-errors errors)) - (while remaining-errors - (let* ((current-error (pop remaining-errors))) - (when (funcall sentinel current-error) - ;; We found an error denoting errors in the included file, so process - ;; all subsequent errors until an error has the current file name - ;; again, and find the most severe error level - (let ((current-filename (flycheck-error-filename current-error)) - (current-level nil) - (faulty-include-filename (flycheck-error-filename - (car remaining-errors)))) - (while (and remaining-errors - (not (string= (flycheck-error-filename - (car remaining-errors)) - current-filename))) - (let* ((error-in-include (pop remaining-errors)) - (in-include-level (flycheck-error-level error-in-include))) - (unless (funcall sentinel error-in-include) - ;; Ignore nested "included file" errors, we are only - ;; interested in real errors because these define our level - (when (or (not current-level) - (> (flycheck-error-level-severity in-include-level) - (flycheck-error-level-severity current-level))) - (setq current-level in-include-level))))) - (setf (flycheck-error-level current-error) current-level - (flycheck-error-message current-error) - (format "In include %s" faulty-include-filename)))))) - errors)) - -(defun flycheck-dequalify-error-ids (errors) - "De-qualify error ids in ERRORS. - -Remove all qualifications from error ids in ERRORS, by stripping -all leading dotted components from error IDs. For instance, if -the error ID is com.foo.E100, replace it with E100. - -This error filter is mainly useful to simplify error IDs obtained -from parsing Checkstyle XML, which frequently has very verbose -IDs, that include the name of the tool." - (mapc (lambda (err) - (let ((id (flycheck-error-id err))) - (when id - (setf (flycheck-error-id err) - (replace-regexp-in-string - (rx string-start - (group - (optional (zero-or-more not-newline) ".")) - (one-or-more (not (any "."))) - string-end) - "" id 'fixedcase 'literal 1))))) - errors) - errors) - -(defun flycheck-remove-error-ids (errors) - "Remove all error ids from ERRORS." - (mapc (lambda (err) (setf (flycheck-error-id err) nil)) errors) - errors) - - -;;; Error analysis -(defun flycheck-count-errors (errors) - "Count the number of ERRORS, grouped by level.. - -Return an alist, where each ITEM is a cons cell whose `car' is an -error level, and whose `cdr' is the number of errors of that -level." - (let (counts-by-level) - (dolist (err errors) - (let* ((level (flycheck-error-level err)) - (item (assq level counts-by-level))) - (if item - (setcdr item (1+ (cdr item))) - (push (cons level 1) counts-by-level)))) - counts-by-level)) - -(defun flycheck-has-max-errors-p (errors level) - "Check if there is no error in ERRORS more severe than LEVEL." - (let ((severity (flycheck-error-level-severity level)) - found) - (while (and errors (not found)) - (setq found (< severity (flycheck-error-level-severity - (flycheck-error-level (pop errors)))))) - (not found))) - -(defun flycheck-has-max-current-errors-p (level) - "Check if there is no current error more severe than LEVEL." - (flycheck-has-max-errors-p flycheck-current-errors level)) - -(defun flycheck-has-errors-p (errors level) - "Determine if there are any ERRORS with LEVEL." - (let (found) - (while (and errors (not found)) - (setq found (eq (flycheck-error-level (pop errors)) level))) - found)) - -(defun flycheck-has-current-errors-p (&optional level) - "Determine if the current buffer has errors with LEVEL. - -If LEVEL is omitted if the current buffer has any errors at all." - (if level - (flycheck-has-errors-p flycheck-current-errors level) - (and flycheck-current-errors t))) - - -;;; Error overlays in the current buffer -(defun flycheck-add-overlay (err) - "Add overlay for ERR. - -Return the created overlay." - ;; We must have a proper error region for the sake of fringe indication, - ;; error display and error navigation, even if the highlighting is disabled. - ;; We erase the highlighting later on in this case - (pcase-let* ((`(,beg . ,end) (flycheck-error-region-for-mode - err (or flycheck-highlighting-mode 'lines))) - (overlay (make-overlay beg end)) - (level (flycheck-error-level err)) - (category (flycheck-error-level-overlay-category level))) - (unless (flycheck-error-level-p level) - (error "Undefined error level: %S" level)) - (overlay-put overlay 'flycheck-overlay t) - (overlay-put overlay 'flycheck-error err) - ;; TODO: Consider hooks to re-check if overlay contents change - (overlay-put overlay 'category category) - (unless flycheck-highlighting-mode - ;; Erase the highlighting from the overlay if requested by the user - (overlay-put overlay 'face nil)) - (when flycheck-indication-mode - (overlay-put overlay 'before-string - (flycheck-error-level-make-fringe-icon - level flycheck-indication-mode))) - (overlay-put overlay 'help-echo (flycheck-error-message err)) - overlay)) - -(defun flycheck-filter-overlays (overlays) - "Get all Flycheck overlays from OVERLAYS." - (-filter (lambda (o) (overlay-get o 'flycheck-overlay)) overlays)) - -(defun flycheck-overlays-at (pos) - "Get all Flycheck overlays at POS." - (flycheck-filter-overlays (overlays-at pos))) - -(defun flycheck-overlays-in (beg end) - "Get all Flycheck overlays between BEG and END." - (flycheck-filter-overlays (overlays-in beg end))) - -(defun flycheck-overlay-errors-at (pos) - "Return a list of all flycheck errors overlayed at POS." - (mapcar (lambda (o) (overlay-get o 'flycheck-error)) - (flycheck-overlays-at pos))) - -(defun flycheck-overlay-errors-in (beg end) - "Return a list of all flycheck errors overlayed between BEG and END." - (mapcar (lambda (o) (overlay-get o 'flycheck-error)) - (flycheck-overlays-in beg end))) - -(defvar-local flycheck-overlays-to-delete nil - "Overlays mark for deletion after all syntax checks completed.") -(put 'flycheck-overlays-to-delete 'permanent-local t) - -(defun flycheck-delete-all-overlays () - "Remove all flycheck overlays in the current buffer." - (flycheck-delete-marked-overlays) - (save-restriction - (widen) - (mapc #'delete-overlay (flycheck-overlays-in (point-min) (point-max))))) - -(defun flycheck-mark-all-overlays-for-deletion () - "Mark all current overlays for deletion." - (setq flycheck-overlays-to-delete - (append (flycheck-overlays-in (point-min) (point-max)) - flycheck-overlays-to-delete))) - -(defun flycheck-delete-marked-overlays () - "Delete all overlays marked for deletion." - (mapc #'delete-overlay flycheck-overlays-to-delete) - (setq flycheck-overlays-to-delete nil)) - - -;;; Error navigation in the current buffer -(defun flycheck-error-level-interesting-at-pos-p (pos) - "Check if error severity at POS passes `flycheck-error-level-interesting-p'." - (flycheck-error-level-interesting-p (get-char-property pos 'flycheck-error))) - -(defun flycheck-error-level-interesting-p (err) - "Check if ERR severity is >= `flycheck-navigation-minimum-level'." - (when (flycheck-error-p err) - (-if-let (min-level flycheck-navigation-minimum-level) - (<= (flycheck-error-level-severity min-level) - (flycheck-error-level-severity (flycheck-error-level err))) - t))) - -(defun flycheck-next-error-pos (n &optional reset) - "Get the position of the N-th next error. - -With negative n, get the position of the (-N)-th previous error -instead. With non-nil RESET, search from `point-min', otherwise -search from the current point. - -Return the position of the next or previous error, or nil if -there is none." - (let ((n (or n 1)) - (pos (if reset (point-min) (point)))) - (if (>= n 0) - ;; Search forwards - (while (and pos (> n 0)) - (setq n (1- n)) - (when (get-char-property pos 'flycheck-error) - ;; Move beyond from the current error if any - (setq pos (next-single-char-property-change pos 'flycheck-error))) - (while (not (or (= pos (point-max)) - (flycheck-error-level-interesting-at-pos-p pos))) - ;; Scan for the next error - (setq pos (next-single-char-property-change pos 'flycheck-error))) - (when (and (= pos (point-max)) - (not (flycheck-error-level-interesting-at-pos-p pos))) - ;; If we reached the end of the buffer, but no error, we didn't find - ;; any - (setq pos nil))) - ;; Search backwards - (while (and pos (< n 0)) - (setq n (1+ n)) - ;; Loop until we find an error. We need to check the position *before* - ;; the current one, because `previous-single-char-property-change' - ;; always moves to the position *of* the change. - (while (not (or (= pos (point-min)) - (flycheck-error-level-interesting-at-pos-p (1- pos)))) - (setq pos (previous-single-char-property-change pos 'flycheck-error))) - (when (and (= pos (point-min)) - (not (flycheck-error-level-interesting-at-pos-p pos))) - ;; We didn't find any error. - (setq pos nil)) - (when pos - ;; We found an error, so move to its beginning - (setq pos (previous-single-char-property-change pos - 'flycheck-error))))) - pos)) - -(defun flycheck-next-error-function (n reset) - "Visit the N-th error from the current point. - -Intended for use with `next-error-function'." - (let ((pos (flycheck-next-error-pos n reset))) - (if pos - (goto-char pos) - (user-error "No more Flycheck errors")))) - -(defun flycheck-next-error (&optional n reset) - "Visit the N-th error from the current point. - -If RESET is given and non-nil, re-start from the beginning of the buffer. - -N specifies how many errors to move forwards. If negative, move backwards." - (interactive "P") - (when (consp n) - ;; Universal prefix argument means reset - (setq reset t n nil)) - (flycheck-next-error-function n reset)) - -(defun flycheck-previous-error (&optional n) - "Visit the N-th previous error. - -If given, N specifies the number of errors to move backwards. If -N is negative, move forwards instead." - (interactive "P") - (flycheck-next-error (- (or n 1)))) - -(defun flycheck-first-error (&optional n) - "Visit the N-th error from beginning of the buffer. - -If given, N specifies the number of errors to move forward from -the beginning of the buffer." - (interactive "P") - (flycheck-next-error n 'reset)) - - -;;; Listing errors in buffers -(defconst flycheck-error-list-buffer "*Flycheck errors*" - "The name of the buffer to show error lists.") - -(defvar flycheck-error-list-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "n") #'flycheck-error-list-next-error) - (define-key map (kbd "p") #'flycheck-error-list-previous-error) - (define-key map (kbd "g") #'flycheck-error-list-check-source) - (define-key map (kbd "RET") #'flycheck-error-list-goto-error) - map) - "The keymap of `flycheck-error-list-mode'.") - -(defconst flycheck-error-list-format - [("Line" 4 flycheck-error-list-entry-< :right-align t) - ("Col" 3 nil :right-align t) - ("Level" 8 flycheck-error-list-entry-level-<) - ("ID" 6 t) - ("Message" 0 t) - (" (Checker)" 8 t)] - "Table format for the error list.") - -(define-derived-mode flycheck-error-list-mode tabulated-list-mode "Flycheck errors" - "Major mode for listing Flycheck errors. - -\\{flycheck-error-list-mode-map}" - (setq tabulated-list-format flycheck-error-list-format - ;; Sort by location initially - tabulated-list-sort-key (cons "Line" nil) - tabulated-list-padding 1 - tabulated-list-entries #'flycheck-error-list-entries - ;; `revert-buffer' updates the mode line for us, so all we need to do is - ;; set the corresponding mode line construct. - mode-line-buffer-identification flycheck-error-list-mode-line) - (tabulated-list-init-header)) - -(defvar-local flycheck-error-list-source-buffer nil - "The current source buffer of the error list.") -;; Needs to permanently local to preserve the source buffer across buffer -;; reversions -(put 'flycheck-error-list-source-buffer 'permanent-local t) - -(defun flycheck-error-list-set-source (buffer) - "Set BUFFER as the source buffer of the error list." - (when (get-buffer flycheck-error-list-buffer) - (with-current-buffer flycheck-error-list-buffer - ;; Only update the source when required - (unless (eq buffer flycheck-error-list-source-buffer) - (setq flycheck-error-list-source-buffer buffer) - (flycheck-error-list-refresh))))) - -(defun flycheck-error-list-update-source () - "Update the source buffer of the error list." - (when (not (eq (current-buffer) (get-buffer flycheck-error-list-buffer))) - ;; We must not update the source buffer, if the current buffer is the error - ;; list itself. - (flycheck-error-list-set-source (current-buffer)))) - -(defun flycheck-error-list-check-source () - "Trigger a syntax check in the source buffer of the error list." - (interactive) - (let ((buffer (get-buffer flycheck-error-list-source-buffer))) - (when (buffer-live-p buffer) - (with-current-buffer buffer - (flycheck-buffer))))) - -(define-button-type 'flycheck-error-list - 'action #'flycheck-error-list-button-goto-error - 'help-echo "mouse-2, RET: goto error") - -(defun flycheck-error-list-button-goto-error (button) - "Go to the error at BUTTON." - (flycheck-error-list-goto-error (button-start button))) - -(defsubst flycheck-error-list-make-cell (text &optional face) - "Make an error list cell with TEXT and FACE." - (let ((face (or face 'default))) - (list text 'type 'flycheck-error-list 'face face))) - -(defsubst flycheck-error-list-make-number-cell (number face) - "Make a table cell for a NUMBER with FACE. - -Convert NUMBER to string, fontify it with FACE and return the -string with attached text properties." - (flycheck-error-list-make-cell - (if (numberp number) (number-to-string number) "") - face)) - -(defun flycheck-error-list-make-entry (error) - "Make a table cell for the given ERROR. - -Return a list with the contents of the table cell." - (let* ((level (flycheck-error-level error)) - (level-face (flycheck-error-level-error-list-face level)) - (line (flycheck-error-line error)) - (column (flycheck-error-column error)) - (message (or (flycheck-error-message error) - (format "Unknown %s" (symbol-name level)))) - (id (flycheck-error-id error)) - (checker (flycheck-error-checker error))) - (list error - (vector (flycheck-error-list-make-number-cell - line 'flycheck-error-list-line-number) - (flycheck-error-list-make-number-cell - column 'flycheck-error-list-column-number) - (flycheck-error-list-make-cell - (symbol-name (flycheck-error-level error)) level-face) - (flycheck-error-list-make-cell - (if id (format "%s" id) "") - 'flycheck-error-list-id) - (flycheck-error-list-make-cell message) - (flycheck-error-list-make-cell - (format "(%s)" checker) - 'flycheck-error-list-checker-name))))) - -(defun flycheck-error-list-entries () - "Create the entries for the error list." - (when (buffer-live-p flycheck-error-list-source-buffer) - (let ((errors (buffer-local-value 'flycheck-current-errors - flycheck-error-list-source-buffer))) - (mapcar #'flycheck-error-list-make-entry errors)))) - -(defun flycheck-error-list-entry-< (entry1 entry2) - "Determine whether ENTRY1 is before ENTRY2 by location. - -See `flycheck-error-<'." - (flycheck-error-< (car entry1) (car entry2))) - -(defun flycheck-error-list-entry-level-< (entry1 entry2) - "Determine whether ENTRY1 is before ENTRY2 by level. - -See `flycheck-error-level-<'." - (not (flycheck-error-level-< (car entry1) (car entry2)))) - -(defvar flycheck-error-list-mode-line-map - (let ((map (make-sparse-keymap))) - (define-key map [mode-line mouse-1] - #'flycheck-error-list-mouse-switch-to-source) - map) - "Keymap for error list mode line.") - -(defun flycheck-error-list-propertized-source-name () - "Get the name of the current source buffer for the mode line. - -Propertize the name of the current source buffer for use in the -mode line indication of `flycheck-error-list-mode'." - (let ((name (replace-regexp-in-string - (rx "%") "%%" - (buffer-name flycheck-error-list-source-buffer) - 'fixed-case 'literal))) - (propertize name 'face 'mode-line-buffer-id - 'mouse-face 'mode-line-highlight - 'help-echo "mouse-1: switch to source" - 'local-map flycheck-error-list-mode-line-map))) - -(defun flycheck-error-list-mouse-switch-to-source (event) - "Switch to the error list source buffer of the EVENT window." - (interactive "e") - (save-selected-window - (when (eventp event) - (select-window (posn-window (event-start event)))) - (when (buffer-live-p flycheck-error-list-source-buffer) - (switch-to-buffer flycheck-error-list-source-buffer)))) - -(defun flycheck-get-error-list-window-list (&optional all-frames) - "Get all windows displaying the error list. - -ALL-FRAMES specifies the frames to consider, as in -`get-buffer-window-list'." - (-when-let (buf (get-buffer flycheck-error-list-buffer)) - (get-buffer-window-list buf nil all-frames))) - -(defun flycheck-get-error-list-window (&optional all-frames) - "Get a window displaying the error list, or nil if none. - -ALL-FRAMES specifies the frames to consider, as in -`get-buffer-window'." - (-when-let (buf (get-buffer flycheck-error-list-buffer)) - (get-buffer-window buf all-frames))) - -(defun flycheck-error-list-recenter-at (pos) - "Recenter the error list at POS." - (dolist (window (flycheck-get-error-list-window-list t)) - (with-selected-window window - (goto-char pos) - (recenter)))) - -(defun flycheck-error-list-refresh () - "Refresh the current error list. - -Add all errors currently reported for the current -`flycheck-error-list-source-buffer', and recenter the error -list." - ;; We only refresh the error list, when it is visible in a window, and we - ;; select this window while reverting, because Tabulated List mode attempts to - ;; recenter the error at the old location, so it must have the proper window - ;; selected. - (-when-let (window (flycheck-get-error-list-window t)) - (with-selected-window window - (revert-buffer)) - (run-hooks 'flycheck-error-list-after-refresh-hook) - (let ((preserve-pos (eq (current-buffer) - (get-buffer flycheck-error-list-buffer)))) - ;; If the error list is the current buffer, don't recenter when - ;; highlighting - (flycheck-error-list-highlight-errors preserve-pos)))) - -(defun flycheck-error-list-goto-error (&optional pos) - "Go to the location of the error at POS in the error list. - -POS defaults to `point'." - (interactive) - (-when-let* ((error (tabulated-list-get-id pos)) - (buffer (flycheck-error-buffer error))) - (when (buffer-live-p buffer) - (if (eq (window-buffer) (get-buffer flycheck-error-list-buffer)) - ;; When called from within the error list, keep the error list, - ;; otherwise replace the current buffer. - (pop-to-buffer buffer 'other-window) - (switch-to-buffer buffer)) - (let ((pos (flycheck-error-pos error))) - (unless (eq (goto-char pos) (point)) - ;; If widening gets in the way of moving to the right place, remove it - ;; and try again - (widen) - (goto-char pos))) - ;; Re-highlight the errors - (flycheck-error-list-highlight-errors 'preserve-pos)))) - -(defun flycheck-error-list-next-error-pos (pos &optional n) - "Get the N'th next error in the error list from POS. - -N defaults to 1. If N is negative, search for the previous error -instead. - -Get the beginning position of the N'th next error from POS, or -nil, if there is no next error." - (let ((n (or n 1))) - (if (>= n 0) - ;; Search forward - (while (and pos (/= n 0)) - (setq n (1- n)) - (setq pos (next-single-property-change pos 'tabulated-list-id))) - ;; Search backwards - (while (/= n 0) - (setq n (1+ n)) - ;; We explicitly give the limit here to explicitly have the minimum - ;; point returned, to be able to move to the first error (which starts - ;; at `point-min') - (setq pos (previous-single-property-change pos 'tabulated-list-id - nil (point-min))))) - pos)) - -(defun flycheck-error-list-previous-error (n) - "Go to the N'th previous error in the error list." - (interactive "P") - (flycheck-error-list-next-error (- (or n 1)))) - -(defun flycheck-error-list-next-error (n) - "Go to the N'th next error in the error list." - (interactive "P") - (let ((pos (flycheck-error-list-next-error-pos (point) n))) - (when (and pos (/= pos (point))) - (goto-char pos) - (save-selected-window - ;; Keep the error list selected, so that the user can navigate errors by - ;; repeatedly pressing n/p, without having to re-select the error list - ;; window. - (flycheck-error-list-goto-error))))) - -(defvar-local flycheck-error-list-highlight-overlays nil - "Error highlight overlays in the error list buffer.") -(put 'flycheck-error-list-highlight-overlays 'permanent-local t) - -(defun flycheck-error-list-highlight-errors (&optional preserve-pos) - "Highlight errors in the error list. - -Highlight all errors in the error lists that are at point in the -source buffer, and on the same line as point. Then recenter the -error list to the highlighted error, unless PRESERVE-POS is -non-nil." - (when (get-buffer flycheck-error-list-buffer) - (let ((current-errors (flycheck-overlay-errors-in (line-beginning-position) - (line-end-position)))) - (with-current-buffer flycheck-error-list-buffer - (let ((old-overlays flycheck-error-list-highlight-overlays) - (min-point (point-max)) - (max-point (point-min))) - ;; Display the new overlays first, to avoid re-display flickering - (setq flycheck-error-list-highlight-overlays nil) - (when current-errors - (let ((next-error-pos (point-min))) - (while next-error-pos - (let* ((beg next-error-pos) - (end (flycheck-error-list-next-error-pos beg)) - (err (tabulated-list-get-id beg))) - (when (member err current-errors) - (setq min-point (min min-point beg) - max-point (max max-point beg)) - (let ((ov (make-overlay beg - ;; Extend overlay to the beginning of - ;; the next line, to highlight the - ;; whole line - (or end (point-max))))) - (push ov flycheck-error-list-highlight-overlays) - (overlay-put ov 'flycheck-error-highlight-overlay t) - (overlay-put ov 'face 'flycheck-error-list-highlight))) - (setq next-error-pos end))))) - ;; Delete the old overlays - (mapc #'delete-overlay old-overlays) - (when (and (not preserve-pos) current-errors) - ;; Move point to the middle error - (goto-char (+ min-point (/ (- max-point min-point) 2))) - (beginning-of-line) - ;; And recenter the error list at this position - (flycheck-error-list-recenter-at (point)))))))) - -(defun flycheck-list-errors () - "Show the error list for the current buffer." - (interactive) - (unless flycheck-mode - (user-error "Flycheck mode not enabled")) - ;; Create and initialize the error list - (unless (get-buffer flycheck-error-list-buffer) - (with-current-buffer (get-buffer-create flycheck-error-list-buffer) - (flycheck-error-list-mode))) - (flycheck-error-list-set-source (current-buffer)) - ;; Show the error list in a window, and re-select the old window - (display-buffer flycheck-error-list-buffer) - ;; Finally, refresh the error list to show the most recent errors - (flycheck-error-list-refresh)) - -(defalias 'list-flycheck-errors 'flycheck-list-errors) - - -;;; Displaying errors in the current buffer -(defun flycheck-display-errors (errors) - "Display ERRORS using `flycheck-display-errors-function'." - (when flycheck-display-errors-function - (funcall flycheck-display-errors-function errors))) - -(defvar-local flycheck-display-error-at-point-timer nil - "Timer to automatically show the error at point in minibuffer.") - -(defun flycheck-cancel-error-display-error-at-point-timer () - "Cancel the error display timer for the current buffer." - (when flycheck-display-error-at-point-timer - (cancel-timer flycheck-display-error-at-point-timer) - (setq flycheck-display-error-at-point-timer nil))) - -(defun flycheck-display-error-at-point () - "Display the all error messages at point in minibuffer." - (flycheck-cancel-error-display-error-at-point-timer) - (when flycheck-mode - (-when-let (errors (flycheck-overlay-errors-at (point))) - (flycheck-display-errors errors)))) - -(defun flycheck-display-error-at-point-soon () - "Display the first error message at point in minibuffer delayed." - (flycheck-cancel-error-display-error-at-point-timer) - (when (flycheck-overlays-at (point)) - (setq flycheck-display-error-at-point-timer - (run-at-time flycheck-display-errors-delay nil 'flycheck-display-error-at-point)))) - - -;;; Functions to display errors -(defconst flycheck-error-message-buffer "*Flycheck error messages*" - "The name of the buffer to show long error messages in.") - -(defun flycheck-error-message-buffer () - "Get the buffer object to show long error messages in. - -Get the buffer named by variable `flycheck-error-message-buffer', -or nil if the buffer does not exist." - (get-buffer flycheck-error-message-buffer)) - -(defun flycheck-may-use-echo-area-p () - "Determine whether the echo area may be used. - -The echo area may be used if the cursor is not in the echo area, -and if the echo area is not occupied by minibuffer input." - (not (or cursor-in-echo-area (active-minibuffer-window)))) - -(defun flycheck-display-error-messages (errors) - "Display the messages of ERRORS. - -Concatenate all non-nil messages of ERRORS separated by empty -lines, and display them with `display-message-or-buffer', which -shows the messages either in the echo area or in a separate -buffer, depending on the number of lines. See Info -node `(elisp)Displaying Messages' for more information. - -In the latter case, show messages in -`flycheck-error-message-buffer'." - (when (and errors (flycheck-may-use-echo-area-p)) - (let ((messages (mapcar #'flycheck-error-format-message-and-id errors))) - (display-message-or-buffer (string-join messages "\n\n") - flycheck-error-message-buffer)))) - -(defun flycheck-display-error-messages-unless-error-list (errors) - "Show messages of ERRORS unless the error list is visible. - -Like `flycheck-display-error-messages', but only if the error -list (see `flycheck-list-errors') is not visible in any window in -the current frame." - (unless (flycheck-get-error-list-window 'current-frame) - (flycheck-display-error-messages errors))) - -(defun flycheck-hide-error-buffer () - "Hide the Flycheck error buffer if necessary. - -Hide the error buffer if there is no error under point." - (-when-let* ((buffer (flycheck-error-message-buffer)) - (window (get-buffer-window buffer))) - (unless (flycheck-overlays-at (point)) - (quit-window nil window)))) - - -;;; Working with errors -(defun flycheck-copy-errors-as-kill (pos &optional formatter) - "Copy each error at POS into kill ring, using FORMATTER. - -FORMATTER is a function to turn an error into a string, -defaulting to `flycheck-error-message'. - -Interactively, use `flycheck-error-format-message-and-id' as -FORMATTER with universal prefix arg, and `flycheck-error-id' with -normal prefix arg, i.e. copy the message and the ID with -universal prefix arg, and only the id with normal prefix arg." - (interactive (list (point) - (pcase current-prefix-arg - ((pred not) #'flycheck-error-message) - ((pred consp) #'flycheck-error-format-message-and-id) - (_ #'flycheck-error-id)))) - (let ((messages (delq nil (mapcar (or formatter #'flycheck-error-message) - (flycheck-overlay-errors-at pos))))) - (when messages - (mapc #'kill-new (reverse messages)) - (message (string-join messages "\n"))))) - -(define-obsolete-function-alias 'flycheck-copy-messages-as-kill - 'flycheck-copy-errors-as-kill "0.22") - - -;;; Syntax checkers using external commands -(defun flycheck-command-argument-p (arg) - "Check whether ARG is a valid command argument." - (pcase arg - ((pred stringp) t) - ((or `source `source-inplace `source-original) t) - ((or `temporary-directory `temporary-file-name) t) - (`null-device t) - (`(config-file ,option-name ,config-file-var) - (and (stringp option-name) - (symbolp config-file-var))) - (`(config-file ,option-name ,config-file-var ,prepender) - (and (stringp option-name) - (symbolp config-file-var) - (symbolp prepender))) - (`(,(or `option `option-list) ,option-name ,option-var) - (and (stringp option-name) - (symbolp option-var))) - (`(,(or `option `option-list) ,option-name ,option-var ,prepender) - (and (stringp option-name) - (symbolp option-var) - (symbolp prepender))) - (`(,(or `option `option-list) ,option-name ,option-var ,prepender ,filter) - (and (stringp option-name) - (symbolp option-var) - (symbolp prepender) - (symbolp filter))) - (`(option-flag ,option-name ,option-var) - (and (stringp option-name) - (symbolp option-var))) - (`(eval ,_) t) - (_ nil))) - -;;;###autoload -(defun flycheck-define-command-checker (symbol docstring &rest properties) - "Define SYMBOL as syntax checker which runs a command. - -Define SYMBOL as generic syntax checker via -`flycheck-define-generic-checker', which uses an external command -to check the buffer. SYMBOL and DOCSTRING are the same as for -`flycheck-define-generic-checker'. - -In addition to the properties understood by -`flycheck-define-generic-checker', the following PROPERTIES -constitute a command syntax checker. Unless otherwise noted, all -properties are mandatory. Note that the default `:error-filter' -of command checkers is `flycheck-sanitize-errors'. - -`:command COMMAND' - The command to run for syntax checking. - - COMMAND is a list of the form `(EXECUTABLE [ARG ...])'. - - EXECUTABLE is a string with the executable of this syntax - checker. It can be overridden with the variable - `flycheck-SYMBOL-executable'. Note that this variable is - NOT implicitly defined by this function. Use - `flycheck-def-executable-var' to define this variable. - - Each ARG is an argument to the executable, either as string, - or as special symbol or form for - `flycheck-substitute-argument', which see. - -`:error-patterns PATTERNS' - A list of patterns to parse the output of the `:command'. - - Each ITEM in PATTERNS is a list `(LEVEL SEXP ...)', where - LEVEL is a Flycheck error level (see - `flycheck-define-error-level'), followed by one or more RX - `SEXP's which parse an error of that level and extract line, - column, file name and the message. - - See `rx' for general information about RX, and - `flycheck-rx-to-string' for some special RX forms provided - by Flycheck. - - All patterns are applied in the order of declaration to the - whole output of the syntax checker. Output already matched - by a pattern will not be matched by subsequent patterns. In - other words, the first pattern wins. - - This property is optional. If omitted, however, an - `:error-parser' is mandatory. - -`:error-parser FUNCTION' - A function to parse errors with. - - The function shall accept three arguments OUTPUT CHECKER - BUFFER. OUTPUT is the syntax checker output as string, - CHECKER the syntax checker that was used, and BUFFER a - buffer object representing the checked buffer. The function - must return a list of `flycheck-error' objects parsed from - OUTPUT. - - This property is optional. If omitted, it defaults to - `flycheck-parse-with-patterns'. In this case, - `:error-patterns' is mandatory. - -Note that you may not give `:start', `:interrupt', and -`:print-doc' for a command checker. You can give a custom -`:verify' function, but you should take care to call -`flycheck-verify-command-checker' in a custom `:verify' -function." - (declare (indent 1) - (doc-string 2)) - (dolist (prop '(:start :interrupt :print-doc)) - (when (plist-get properties prop) - (error "%s not allowed in definition of command syntax checker %s" - prop symbol))) - - (unless (plist-get properties :error-filter) - ;; Default to `flycheck-sanitize-errors' as error filter - (setq properties (plist-put properties :error-filter - #'flycheck-sanitize-errors))) - - (let ((command (plist-get properties :command)) - (patterns (plist-get properties :error-patterns)) - (parser (or (plist-get properties :error-parser) - #'flycheck-parse-with-patterns)) - (predicate (plist-get properties :predicate))) - - (unless command - (error "Missing :command in syntax checker %s" symbol)) - (unless (stringp (car command)) - (error "Command executable for syntax checker %s must be a string: %S" - symbol (car command))) - (dolist (arg (cdr command)) - (unless (flycheck-command-argument-p arg) - (error "Invalid command argument %S in syntax checker %s" arg symbol))) - (when (and (eq parser 'flycheck-parse-with-patterns) - (not patterns)) - (error "Missing :error-patterns in syntax checker %s" symbol)) - - (setq properties - ;; Construct a predicate that checks whether the executable exists, to - ;; guard against syntax checker tools which are not installed - (plist-put properties :predicate - (lambda () - (and (executable-find (flycheck-checker-executable symbol)) - (or (not predicate) (funcall predicate)))))) - - (apply #'flycheck-define-generic-checker symbol docstring - :start #'flycheck-start-command-checker - :interrupt #'flycheck-interrupt-command-checker - :print-doc #'flycheck-command-checker-print-doc - :verify #'flycheck-verify-command-checker - properties) - - ;; Pre-compile all errors patterns into strings, so that we don't need to do - ;; that on each error parse - (let ((patterns (mapcar (lambda (p) - (cons (flycheck-rx-to-string `(and ,@(cdr p)) - 'no-group) - (car p))) - patterns))) - (pcase-dolist (`(,prop . ,value) - `((flycheck-command . ,command) - (flycheck-error-parser . ,parser) - (flycheck-error-patterns . ,patterns))) - (put symbol prop value))))) - -(eval-and-compile - ;; Make this function available during byte-compilation, since we need it - ;; at macro expansion of `flycheck-def-executable-var'. - (defun flycheck-checker-executable-variable (checker) - "Get the executable variable of CHECKER. - -The executable variable is named `flycheck-CHECKER-executable'." - (intern (format "flycheck-%s-executable" checker)))) - -(defun flycheck-checker-default-executable (checker) - "Get the default executable of CHECKER." - (car (get checker 'flycheck-command))) - -(defun flycheck-checker-executable (checker) - "Get the command executable of CHECKER. - -The executable is either the value of the variable -`flycheck-CHECKER-executable', or the default executable given in -the syntax checker definition, if the variable is nil." - (let ((var (flycheck-checker-executable-variable checker))) - (or (and (boundp var) (symbol-value var)) - (flycheck-checker-default-executable checker)))) - -(defun flycheck-checker-arguments (checker) - "Get the command arguments of CHECKER." - (cdr (get checker 'flycheck-command))) - -(defun flycheck-checker-error-patterns (checker) - "Get the error patterns of CHECKER. - -Each pattern has the form `(REGEXP . LEVEL)' where REGEXP is the -regular expression, and LEVEL the corresponding level symbol." - (get checker 'flycheck-error-patterns)) - -(defun flycheck-checker-error-parser (checker) - "Get the error parser of CHECKER." - (get checker 'flycheck-error-parser)) - -(defun flycheck-substitute-argument (arg checker) - "Substitute ARG for CHECKER. - -Return a list of real arguments for the executable of CHECKER, -substituted for the symbolic argument ARG. Single arguments, -e.g. if ARG is a literal strings, are wrapped in a list. - -ARG may be one of the following forms: - -STRING - Return ARG unchanged. - -`source', `source-inplace' - Create a temporary file to check and return its path. With - `source-inplace' create the temporary file in the same - directory as the original file. The value of - `flycheck-temp-prefix' is used as prefix of the file name. - - With `source', try to retain the non-directory component of - the buffer's file name in the temporary file. - - `source' is the preferred way to pass the input file to a - syntax checker. `source-inplace' should only be used if the - syntax checker needs other files from the source directory, - such as include files in C. - -`source-original' - Return the path of the actual file to check, or an empty - string if the buffer has no file name. - - Note that the contents of the file may not be up to date - with the contents of the buffer to check. Do not use this - as primary input to a checker, unless absolutely necessary. - - When using this symbol as primary input to the syntax - checker, add `flycheck-buffer-saved-p' to the `:predicate'. - -`temporary-directory' - Create a unique temporary directory and return its path. - -`temporary-file-name' - Return a unique temporary filename. The file is *not* - created. - - To ignore the output of syntax checkers, try `null-device' - first. - -`null-device' - Return the value of `null-device', i.e the system null - device. - - Use this option to ignore the output of a syntax checker. - If the syntax checker cannot handle the null device, or - won't write to an existing file, try `temporary-file-name' - instead. - -`(config-file OPTION VARIABLE [PREPEND-FN])' - Search the configuration file bound to VARIABLE with - `flycheck-locate-config-file' and return a list of arguments - that pass this configuration file to the syntax checker, or - nil if the configuration file was not found. - - PREPEND-FN is called with the OPTION and the located - configuration file, and should return OPTION prepended - before the file, either a string or as list. If omitted, - PREPEND-FN defaults to `list'. - -`(option OPTION VARIABLE [PREPEND-FN [FILTER]])' - Retrieve the value of VARIABLE and return a list of - arguments that pass this value as value for OPTION to the - syntax checker. - - PREPEND-FN is called with the OPTION and the value of - VARIABLE, and should return OPTION prepended before the - file, either a string or as list. If omitted, PREPEND-FN - defaults to `list'. - - FILTER is an optional function to be applied to the value of - VARIABLE before prepending. This function must return nil - or a string. In the former case, return nil. In the latter - case, return a list of arguments as described above. - -`(option-list OPTION VARIABLE [PREPEND-FN [FILTER]])' - Retrieve the value of VARIABLE, which must be a list, - and prepend OPTION before each item in this list, using - PREPEND-FN. - - PREPEND-FN is called with the OPTION and each item of the - list as second argument, and should return OPTION prepended - before the item, either as string or as list. If omitted, - PREPEND-FN defaults to `list'. - - FILTER is an optional function to be applied to each item in - the list before prepending OPTION. It shall return the - option value for each item as string, or nil, if the item is - to be ignored. - -`(option-flag OPTION VARIABLE)' - Retrieve the value of VARIABLE and return OPTION, if the - value is non-nil. Otherwise return nil. - -`(eval FORM)' - Return the result of evaluating FORM in the buffer to be - checked. FORM must either return a string or a list of - strings, or nil to indicate that nothing should be - substituted for CELL. For all other return types, signal an - error - - _No_ further substitutions are performed, neither in FORM - before it is evaluated, nor in the result of evaluating - FORM. - -In all other cases, signal an error. - -Note that substitution is *not* recursive. No symbols or cells -are substituted within the body of cells!" - (pcase arg - ((pred stringp) (list arg)) - (`source - (list (flycheck-save-buffer-to-temp #'flycheck-temp-file-system))) - (`source-inplace - (list (flycheck-save-buffer-to-temp #'flycheck-temp-file-inplace))) - (`source-original (list (or (buffer-file-name) ""))) - (`temporary-directory (list (flycheck-temp-dir-system))) - (`temporary-file-name - (let ((directory (flycheck-temp-dir-system))) - (list (make-temp-name (expand-file-name "flycheck" directory))))) - (`null-device (list null-device)) - (`(config-file ,option-name ,file-name-var) - (-when-let* ((value (symbol-value file-name-var)) - (file-name (flycheck-locate-config-file value checker))) - (flycheck-prepend-with-option option-name (list file-name)))) - (`(config-file ,option-name ,file-name-var ,prepend-fn) - (-when-let* ((value (symbol-value file-name-var)) - (file-name (flycheck-locate-config-file value checker))) - (flycheck-prepend-with-option option-name (list file-name) prepend-fn))) - (`(option ,option-name ,variable) - (-when-let (value (symbol-value variable)) - (unless (stringp value) - (error "Value %S of %S for option %s is not a string" - value variable option-name)) - (flycheck-prepend-with-option option-name (list value)))) - (`(option ,option-name ,variable ,prepend-fn) - (-when-let (value (symbol-value variable)) - (unless (stringp value) - (error "Value %S of %S for option %s is not a string" - value variable option-name)) - (flycheck-prepend-with-option option-name (list value) prepend-fn))) - (`(option ,option-name ,variable ,prepend-fn ,filter) - (-when-let (value (funcall filter (symbol-value variable))) - (unless (stringp value) - (error "Value %S of %S (filter: %S) for option %s is not a string" - value variable filter option-name)) - (flycheck-prepend-with-option option-name (list value) prepend-fn))) - (`(option-list ,option-name ,variable) - (let ((value (symbol-value variable))) - (unless (and (listp value) (-all? #'stringp value)) - (error "Value %S of %S for option %S is not a list of strings" - value variable option-name)) - (flycheck-prepend-with-option option-name value))) - (`(option-list ,option-name ,variable ,prepend-fn) - (let ((value (symbol-value variable))) - (unless (and (listp value) (-all? #'stringp value)) - (error "Value %S of %S for option %S is not a list of strings" - value variable option-name)) - (flycheck-prepend-with-option option-name value prepend-fn))) - (`(option-list ,option-name ,variable ,prepend-fn ,filter) - (let ((value (delq nil (mapcar filter (symbol-value variable))))) - (unless (and (listp value) (-all? #'stringp value)) - (error "Value %S of %S for option %S is not a list of strings" - value variable option-name)) - (flycheck-prepend-with-option option-name value prepend-fn))) - (`(option-flag ,option-name ,variable) - (when (symbol-value variable) - (list option-name))) - (`(eval ,form) - (let ((result (eval form))) - (cond - ((and (listp result) (-all? #'stringp result)) result) - ((stringp result) (list result)) - (t (error "Invalid result from evaluation of %S: %S" form result))))) - (_ (error "Unsupported argument %S" arg)))) - -(defun flycheck-checker-substituted-arguments (checker) - "Get the substituted arguments of a CHECKER. - -Substitute each argument of CHECKER using -`flycheck-substitute-argument'. This replaces any special -symbols in the command." - (apply #'append - (mapcar (lambda (arg) (flycheck-substitute-argument arg checker)) - (flycheck-checker-arguments checker)))) - -(defun flycheck-start-command-checker (checker callback) - "Start a command CHECKER with CALLBACK." - (let (process) - (condition-case err - (let* ((program (flycheck-checker-executable checker)) - (args (flycheck-checker-substituted-arguments checker)) - ;; Use pipes to receive output from the syntax checker. They are - ;; more efficient and more robust than PTYs, which Emacs uses by - ;; default, and since we don't need any job control features, we - ;; can easily use pipes. - (process-connection-type nil)) - ;; We pass do not associate the process with any buffer, by - ;; passing nil for the BUFFER argument of `start-process'. - ;; Instead, we just remember the buffer being checked in a - ;; process property (see below). This neatly avoids all - ;; side-effects implied by attached a process to a buffer, which - ;; may cause conflicts with other packages. - ;; - ;; See https://github.com/flycheck/flycheck/issues/298 for an - ;; example for such a conflict. - (setq process (apply 'start-process (format "flycheck-%s" checker) - nil program args)) - (set-process-sentinel process 'flycheck-handle-signal) - (set-process-filter process 'flycheck-receive-checker-output) - (set-process-query-on-exit-flag process nil) - ;; Remember the syntax checker, the buffer and the callback - (process-put process 'flycheck-checker checker) - (process-put process 'flycheck-callback callback) - (process-put process 'flycheck-buffer (current-buffer)) - ;; Track the temporaries created by argument substitution in the - ;; process itself, to get rid of the global state ASAP. - (process-put process 'flycheck-temporaries flycheck-temporaries) - (setq flycheck-temporaries nil) - ;; Return the process - process) - (error - ;; In case of error, clean up our resources, and report the error back to - ;; Flycheck - (flycheck-safe-delete-temporaries) - (when process - ;; No need to explicitly delete the temporary files of the process, - ;; because deleting runs the sentinel, which will delete them anyway. - (delete-process process)) - (signal (car err) (cdr err)))))) - -(defun flycheck-interrupt-command-checker (_checker process) - "Interrupt a PROCESS." - ;; Deleting the process always triggers the sentinel, which does the cleanup - (when process - (delete-process process))) - -(defun flycheck-command-checker-print-doc (checker) - "Print additional documentation for a command CHECKER." - (let ((executable (flycheck-checker-default-executable checker)) - (config-file-var (flycheck-checker-config-file-var checker)) - (option-vars (-sort #'string< - (flycheck-checker-option-vars checker)))) - (princ "\n") - - (let ((doc-start (with-current-buffer standard-output (point-max)))) - ;; Track the start of our documentation so that we can re-indent it - ;; properly - (princ " This syntax checker executes \"") - (princ executable) - (princ "\"") - (when config-file-var - (princ ", using a configuration file from `") - (princ (symbol-name config-file-var)) - (princ "'")) - (princ ". The executable can be overridden with `") - (princ (symbol-name (flycheck-checker-executable-variable checker))) - (princ "'.") - - (with-current-buffer standard-output - (save-excursion - (fill-region-as-paragraph doc-start (point-max))))) - (princ "\n") - (when option-vars - (princ "\n This syntax checker can be configured with these options:\n\n") - (dolist (var option-vars) - (princ (format " * `%s'\n" var)))))) - -(defun flycheck-verify-command-checker (checker) - "Verify a command CHECKER in the current buffer. - -Return a list of `flycheck-verification-result' objects for -CHECKER." - (let ((executable (executable-find (flycheck-checker-executable checker)))) - (list - (flycheck-verification-result-new - :label "executable" - :message (if executable (format "Found at %s" executable) "Not found") - :face (if executable 'success '(bold error)))))) - - -;;; Process management for command syntax checkers -(defun flycheck-receive-checker-output (process output) - "Receive a syntax checking PROCESS OUTPUT." - (push output (process-get process 'flycheck-pending-output))) - -(defun flycheck-get-output (process) - "Get the complete output of PROCESS." - (with-demoted-errors "Error while retrieving process output: %S" - (let ((pending-output (process-get process 'flycheck-pending-output))) - (apply #'concat (nreverse pending-output))))) - -(defun flycheck-handle-signal (process _event) - "Handle a signal from the syntax checking PROCESS. - -_EVENT is ignored." - (when (memq (process-status process) '(signal exit)) - (let ((files (process-get process 'flycheck-temporaries)) - (buffer (process-get process 'flycheck-buffer)) - (callback (process-get process 'flycheck-callback))) - ;; Delete the temporary files - (mapc #'flycheck-safe-delete files) - (when (buffer-live-p buffer) - (with-current-buffer buffer - (condition-case err - (pcase (process-status process) - (`signal - (funcall callback 'interrupted)) - (`exit - (flycheck-finish-checker-process - (process-get process 'flycheck-checker) - (process-exit-status process) - files - (flycheck-get-output process) callback))) - (error - (funcall callback 'errored (error-message-string err))))))))) - -(defun flycheck-finish-checker-process - (checker exit-status files output callback) - "Finish a checker process from CHECKER with EXIT-STATUS. - -FILES is a list of files given as input to the checker. OUTPUT -is the output of the syntax checker. CALLBACK is the status -callback to use for reporting. - -Parse the OUTPUT and report an appropriate error status." - (let ((errors (flycheck-parse-output output checker (current-buffer)))) - (when (and (/= exit-status 0) (not errors)) - ;; Warn about a suspicious result from the syntax checker. We do right - ;; after parsing the errors, before filtering, because a syntax checker - ;; might report errors from other files (e.g. includes) even if there - ;; are no errors in the file being checked. - (funcall callback 'suspicious - (format "Checker %S returned non-zero exit code %s, but no errors from \ -output: %s\nChecker definition probably flawed." checker exit-status output))) - (funcall callback 'finished - ;; Fix error file names, by substituting them backwards from the - ;; temporaries - (mapcar (lambda (e) (flycheck-fix-error-filename e files)) - errors)))) - - -;;; Executables of command checkers. -(defmacro flycheck-def-executable-var (checker default-executable) - "Define the executable variable for CHECKER. - -DEFAULT-EXECUTABLE is the default executable. It is only used in -the docstring of the variable. - -The variable is defined with `defcustom' in the -`flycheck-executables' group. It's also defined to be risky as -file-local variable, to avoid arbitrary executables being used -for syntax checking." - (let ((executable-var (flycheck-checker-executable-variable checker))) - `(progn - (defcustom ,executable-var nil - ,(format "The executable of the %s syntax checker. - -Either a string containing the name or the path of the -executable, or nil to use the default executable from the syntax -checker declaration. - -The default executable is %S." checker default-executable) - :type '(choice (const :tag "Default executable" nil) - (string :tag "Name or path")) - :group 'flycheck-executables - :risky t)))) - -(defun flycheck-set-checker-executable (checker &optional executable) - "Set the EXECUTABLE of CHECKER in the current buffer. - -CHECKER is a syntax checker symbol. EXECUTABLE is a string with -the name of a executable or the path to an executable file, which -is to be used as executable for CHECKER. If omitted or nil, -reset the executable of CHECKER. - -Interactively, prompt for a syntax checker and an executable -file, and set the executable of the selected syntax checker. -With prefix arg, prompt for a syntax checker only, and reset the -executable of the select checker to the default. - -Set the executable variable of CHECKER, that is, -`flycheck-CHECKER-executable' to EXECUTABLE. Signal -`user-error', if EXECUTABLE does not denote a command or an -executable file. - -This command is intended for interactive use only. In Lisp, just -`let'-bind the corresponding variable, or set it directly. Use -`flycheck-checker-executable-variable' to obtain the executable -variable symbol for a syntax checker." - (interactive - (let* ((checker (read-flycheck-checker "Syntax checker: ")) - (default-executable (flycheck-checker-default-executable checker)) - (executable (if current-prefix-arg - nil - (read-file-name "Executable: " nil default-executable - nil nil #'executable-find)))) - (list checker executable))) - (when (and executable (not (executable-find executable))) - (user-error "%s is no executable" executable)) - (let ((variable (flycheck-checker-executable-variable checker))) - (set (make-local-variable variable) executable))) -(put 'flycheck-set-checker-executable 'interactive-only - "Set the executable variable directly instead") - - -;;; Configuration files and options for command checkers -;;;###autoload -(defmacro flycheck-def-config-file-var (symbol checker &optional file-name - &rest custom-args) - "Define SYMBOL as config file variable for CHECKER, with default FILE-NAME. - -SYMBOL is declared as customizable variable using `defcustom', to -provide a configuration file for the given syntax CHECKER. -CUSTOM-ARGS are forwarded to `defcustom'. - -FILE-NAME is the initial value of the new variable. If omitted, -the default value is nil. - -Use this together with the `config-file' form in the `:command' -argument to `flycheck-define-checker'." - (declare (indent 3)) - `(progn - (put ',checker 'flycheck-config-file-var ',symbol) - (defcustom ,symbol ,file-name - ,(format "Configuration file for `%s'. - -If set to a string, locate the configuration file using the -functions from `flycheck-locate-config-file-functions'. If the -file is found pass it to the syntax checker as configuration -file. - -If no configuration file is found, or if this variable is set to -nil, invoke the syntax checker without a configuration file. - -Use this variable as file-local variable if you need a specific -configuration file a buffer." checker) - :type '(choice (const :tag "No configuration file" nil) - (string :tag "File name or path")) - :group 'flycheck-config-files - ,@custom-args))) - -(defun flycheck-checker-config-file-var (checker) - "Get the associated configuration file variable of CHECKER. - -Return nil if CHECKER has no associated configuration file -variable." - (get checker 'flycheck-config-file-var)) - -(defun flycheck-checker-option-vars (checker) - "Get the associated option variables of CHECKER. - -Return a (possibly empty) list of variable symbols." - (get checker 'flycheck-option-vars)) - -(defun flycheck-locate-config-file (filename checker) - "Locate the configuration file FILENAME for CHECKER. - -Locate the configuration file using -`flycheck-locate-config-file-functions'. - -Return the absolute path of the configuration file, or nil if no -configuration file was found." - (-when-let (filepath (run-hook-with-args-until-success - 'flycheck-locate-config-file-functions - filename checker)) - (when (file-exists-p filepath) - filepath))) - -(defun flycheck-locate-config-file-absolute-path (filepath _checker) - "Locate a configuration file by a FILEPATH. - -If FILEPATH is a contains a path separator, expand it against the -default directory and return it. Otherwise return nil. - -_CHECKER is ignored." - ;; If the path is just a plain file name, skip it. - (unless (string= (file-name-nondirectory filepath) filepath) - (expand-file-name filepath))) - -(defun flycheck-locate-config-file-ancestor-directories (filename _checker) - "Locate a configuration FILENAME in ancestor directories. - -If the current buffer has a file name, search FILENAME in the -directory of the current buffer and all ancestors thereof (see -`locate-dominating-file'). If the file is found, return its -absolute path. Otherwise return nil. - -_CHECKER is ignored." - (-when-let* ((basefile (buffer-file-name)) - (directory (locate-dominating-file basefile filename))) - (expand-file-name filename directory))) - -(defun flycheck-locate-config-file-home (filename _checker) - "Locate a configuration FILENAME in the home directory. - -Return the absolute path, if FILENAME exists in the user's home -directory, or nil otherwise." - (let ((path (expand-file-name filename "~"))) - (when (file-exists-p path) - path))) - -(mapc (apply-partially #'custom-add-frequent-value - 'flycheck-locate-config-file-functions) - '(flycheck-locate-config-file-absolute-path - flycheck-locate-config-file-ancestor-directories - flycheck-locate-config-file-home)) - -;;;###autoload -(defmacro flycheck-def-option-var (symbol init-value checker docstring - &rest custom-args) - "Define SYMBOL as option variable with INIT-VALUE for CHECKER. - -SYMBOL is declared as customizable variable using `defcustom', to -provide an option for the given syntax CHECKER. INIT-VALUE is -the initial value of the variable, and DOCSTRING is its -docstring. CUSTOM-ARGS are forwarded to `defcustom'. - -Use this together with the `option', `option-list' and -`option-flag' forms in the `:command' argument to -`flycheck-define-checker'." - (declare (indent 3) - (doc-string 4)) - `(progn - (let ((options (flycheck-checker-option-vars ',checker))) - (unless (memq ',symbol options) - (put ',checker 'flycheck-option-vars (cons ',symbol options)))) - (defcustom ,symbol ,init-value - ,(format "%s - -This variable is an option for the syntax checker `%s'." docstring checker) - :group 'flycheck-options - ,@custom-args))) - -(defun flycheck-option-int (value) - "Convert an integral option VALUE to a string. - -If VALUE is nil, return nil. Otherwise return VALUE converted to -a string." - (when value - (number-to-string value))) - -(defun flycheck-option-comma-separated-list (value &optional separator filter) - "Convert VALUE into a list separated by SEPARATOR. - -SEPARATOR is a string to separate items in VALUE, defaulting to -\",\". FILTER is an optional function, which takes a single -argument and returns either a string or nil. - -If VALUE is a list, apply FILTER to each item in VALUE, remove -all nil items, and return a single string of all remaining items -separated by SEPARATOR. - -Otherwise, apply FILTER to VALUE and return the result. -SEPARATOR is ignored in this case." - (let ((filter (or filter #'identity)) - (separator (or separator ","))) - (if (listp value) - (-when-let (value (delq nil (mapcar filter value))) - (string-join value separator)) - (funcall filter value)))) - -(defmacro flycheck-def-args-var (symbol checker &rest custom-args) - "Define SYMBOL as argument variable for CHECKER. - -SYMBOL is declared as customizable, risky and buffer-local -variable using `defcustom' to provide an option for arbitrary -arguments for the given syntax CHECKER. CUSTOM-ARGS is forwarded -to `defcustom'. - -Use the `eval' form to splice this variable into the -`:command'." - (declare (indent 2)) - `(flycheck-def-option-var ,symbol nil ,checker - ,(format "A list of additional arguments for `%s'. - -The value of this variable is a list of strings with additional -command line arguments." checker) - :risky t - :type '(repeat (string :tag "Argument")) - ,@custom-args)) - - -;;; Command syntax checkers as compile commands -(defun flycheck-checker-pattern-to-error-regexp (pattern) - "Convert PATTERN into an error regexp for compile.el. - -Return a list representing PATTERN, suitable as element in -`compilation-error-regexp-alist'." - (let* ((regexp (car pattern)) - (level (cdr pattern)) - (level-no (pcase level - (`error 2) - (`warning 1)))) - (list regexp 1 2 3 level-no))) - -(defun flycheck-checker-compilation-error-regexp-alist (checker) - "Convert error patterns of CHECKER for use with compile.el. - -Return an alist of all error patterns of CHECKER, suitable for -use with `compilation-error-regexp-alist'." - (mapcar #'flycheck-checker-pattern-to-error-regexp - (flycheck-checker-error-patterns checker))) - -(defun flycheck-checker-shell-command (checker) - "Get a shell command for CHECKER. - -Perform substitution in the arguments of CHECKER, but with -`flycheck-substitute-shell-argument'. - -Return the command of CHECKER as single string, suitable for -shell execution." - ;; Note: Do NOT use `combine-and-quote-strings' here. Despite it's name it - ;; does not properly quote shell arguments, and actually breaks for special - ;; characters. See https://github.com/flycheck/flycheck/pull/522 - (mapconcat - #'shell-quote-argument - (cons (flycheck-checker-executable checker) - (apply #'append - (mapcar (lambda (arg) - (if (memq arg '(source source-inplace source-original)) - (list (or (buffer-file-name) "")) - (flycheck-substitute-argument arg checker))) - (flycheck-checker-arguments checker)))) " ")) - -(defun flycheck-compile-name (_name) - "Get a name for a Flycheck compilation buffer. - -_NAME is ignored." - (format "*Flycheck %s*" (buffer-file-name))) - -(defun flycheck-compile (checker) - "Run CHECKER via `compile'. - -CHECKER must be a valid syntax checker. Interactively, prompt -for a syntax checker to run. - -Instead of highlighting errors in the buffer, this command pops -up a separate buffer with the entire output of the syntax checker -tool, just like `compile' (\\[compile])." - (interactive - (let ((default (or flycheck-checker flycheck-last-checker))) - (list (read-flycheck-checker "Run syntax checker as compile command: " - (when (get default 'flycheck-command) default) - 'flycheck-command)))) - (unless (flycheck-valid-checker-p checker) - (user-error "%S is not a valid syntax checker" checker)) - (unless (buffer-file-name) - (user-error "Cannot compile buffers without backing file")) - (unless (flycheck-may-use-checker checker) - (user-error "Cannot use syntax checker %S in this buffer" checker)) - (unless (flycheck-checker-executable checker) - (user-error "Cannot run checker %S as shell command" checker)) - (let* ((command (flycheck-checker-shell-command checker)) - (buffer (compilation-start command nil #'flycheck-compile-name))) - (with-current-buffer buffer - (set (make-local-variable 'compilation-error-regexp-alist) - (flycheck-checker-compilation-error-regexp-alist checker))))) - - -;;; General error parsing for command checkers -(defun flycheck-parse-output (output checker buffer) - "Parse OUTPUT from CHECKER in BUFFER. - -OUTPUT is a string with the output from the checker symbol -CHECKER. BUFFER is the buffer which was checked. - -Return the errors parsed with the error patterns of CHECKER." - (funcall (flycheck-checker-error-parser checker) output checker buffer)) - -(defun flycheck-fix-error-filename (err buffer-files) - "Fix the file name of ERR from BUFFER-FILES. - -Make the file name of ERR absolute. If the absolute file name of -ERR is in BUFFER-FILES, replace it with the return value of the -function `buffer-file-name'." - (flycheck-error-with-buffer err - (-when-let (filename (flycheck-error-filename err)) - (setq filename (expand-file-name filename)) - (when (-any? (apply-partially #'flycheck-same-files-p filename) - buffer-files) - (setq filename (buffer-file-name))) - (setf (flycheck-error-filename err) filename))) - err) - - -;;; Error parsers for command syntax checkers -(defun flycheck-parse-xml-region (beg end) - "Parse the xml region between BEG and END. - -Wrapper around `xml-parse-region' which transforms the return -value of this function into one compatible to -`libxml-parse-xml-region' by simply returning the first element -from the node list." - (car (xml-parse-region beg end))) - -(defvar flycheck-xml-parser - (if (fboundp 'libxml-parse-xml-region) - 'libxml-parse-xml-region 'flycheck-parse-xml-region) - "Parse an xml string from a region. - -Use libxml if Emacs is built with libxml support. Otherwise fall -back to `xml-parse-region', via `flycheck-parse-xml-region'.") - -(defun flycheck-parse-xml-string (xml) - "Parse an XML string. - -Return the document tree parsed from XML in the form `(ROOT ATTRS -BODY...)'. ROOT is a symbol identifying the name of the root -element. ATTRS is an alist of the attributes of the root node. -BODY is zero or more body elements, either as strings (in case of -text nodes) or as XML nodes, in the same for as the root node." - (with-temp-buffer - (insert xml) - (funcall flycheck-xml-parser (point-min) (point-max)))) - -(defun flycheck-parse-checkstyle (output checker buffer) - "Parse Checkstyle errors from OUTPUT. - -Parse Checkstyle-like XML output. Use this error parser for -checkers that have an option to output errors in this format. - -See URL `http://checkstyle.sourceforge.net/' for information -about Checkstyle." - (pcase (flycheck-parse-xml-string output) - (`(checkstyle ,_ . ,file-nodes) - (let (errors) - (dolist (node file-nodes) - (pcase node - (`(file ,file-attrs . ,error-nodes) - (dolist (node error-nodes) - (pcase node - (`(error ,error-attrs . ,_) - (let-alist error-attrs - (push (flycheck-error-new-at - (flycheck-string-to-number-safe .line) - (flycheck-string-to-number-safe .column) - (pcase .severity - (`"error" 'error) - (`"warning" 'warning) - (`"info" 'info) - ;; Default to error for unknown .severity - (_ 'error)) - .message - :checker checker :id .source - :buffer buffer - :filename (cdr (assq 'name file-attrs))) - errors)))))))) - (nreverse errors))))) - -(defun flycheck-parse-cppcheck (output checker buffer) - "Parse Cppcheck errors from OUTPUT. - -Parse Cppcheck XML v2 output. - -See URL `http://cppcheck.sourceforge.net/' for more information -about Cppcheck." - (pcase (flycheck-parse-xml-string output) - (`(results ,_ . ,body) - (let (errors) - (dolist (node body) - (pcase node - (`(errors ,_ . ,error-nodes) - (dolist (node error-nodes) - (pcase node - (`(error ,error-attrs . ,loc-nodes) - (let ((id (cdr (assq 'id error-attrs))) - (message (cdr (assq 'verbose error-attrs))) - (level (pcase (cdr (assq 'severity error-attrs)) - (`"error" 'error) - (`"style" 'info) - (`"information" 'info) - (_ 'warning)))) - (dolist (node loc-nodes) - (pcase node - (`(location ,loc-attrs . ,_) - (let-alist loc-attrs - (push (flycheck-error-new-at - (flycheck-string-to-number-safe .line) - nil - level message - :id id - :checker checker - :buffer buffer - :filename .file) - errors)))))))))))) - (nreverse errors))))) - -(defun flycheck-parse-phpmd (output checker buffer) - "Parse phpmd errors from OUTPUT. - -See URL `http://phpmd.org/' for more information about phpmd." - (pcase (flycheck-parse-xml-string output) - (`(pmd ,_ . ,body) - (let (errors) - (dolist (node body) - (pcase node - (`(file ,file-attrs . ,violation-nodes) - (let ((filename (cdr (assq 'name file-attrs)))) - (dolist (node violation-nodes) - (pcase node - (`(violation ,vio-attrs ,(and message (pred stringp))) - (let-alist vio-attrs - ;; TODO: Map priority to an error level? - ;; TODO: Respect endline - (push - (flycheck-error-new-at - (flycheck-string-to-number-safe .beginline) - nil - 'warning (string-trim message) - :id .rule - :checker checker - :buffer buffer - :filename filename) - errors))))))))) - (nreverse errors))))) - - -;;; Error parsing with regular expressions -(defun flycheck-get-regexp (patterns) - "Create a single regular expression from PATTERNS." - (rx-to-string `(or ,@(mapcar (lambda (p) (list 'regexp (car p))) patterns)) - 'no-group)) - -(defun flycheck-tokenize-output-with-patterns (output patterns) - "Tokenize OUTPUT with PATTERNS. - -Split the output into error tokens, using all regular expressions -from the error PATTERNS. An error token is simply a string -containing a single error from OUTPUT. Such a token can then be -parsed into a structured error by applying the PATTERNS again, -see `flycheck-parse-errors-with-patterns'. - -Return a list of error tokens." - (let ((regexp (flycheck-get-regexp patterns)) - (last-match 0) - errors) - (while (string-match regexp output last-match) - (push (match-string 0 output) errors) - (setq last-match (match-end 0))) - (reverse errors))) - -(defun flycheck-try-parse-error-with-pattern (err pattern checker) - "Try to parse a single ERR with a PATTERN for CHECKER. - -Return the parsed error if PATTERN matched ERR, or nil -otherwise." - (let ((regexp (car pattern)) - (level (cdr pattern))) - (when (string-match regexp err) - (let ((filename (match-string 1 err)) - (line (match-string 2 err)) - (column (match-string 3 err)) - (message (match-string 4 err)) - (id (match-string 5 err))) - (flycheck-error-new-at - (flycheck-string-to-number-safe line) - (flycheck-string-to-number-safe column) - level - (unless (string-empty-p message) message) - :id (unless (string-empty-p id) id) - :checker checker - :filename (if (or (null filename) (string-empty-p filename)) - (buffer-file-name) - filename)))))) - -(defun flycheck-parse-error-with-patterns (err patterns checker) - "Parse a single ERR with error PATTERNS for CHECKER. - -Apply each pattern in PATTERNS to ERR, in the given order, and -return the first parsed error." - ;; Try to parse patterns in the order of declaration to make sure that the - ;; first match wins. - (let (parsed-error) - (while (and patterns - (not (setq parsed-error - (flycheck-try-parse-error-with-pattern - err (car patterns) checker)))) - (setq patterns (cdr patterns))) - parsed-error)) - -(defun flycheck-parse-with-patterns (output checker buffer) - "Parse OUTPUT from CHECKER with error patterns. - -Uses the error patterns of CHECKER to tokenize the output and -tries to parse each error token with all patterns, in the order -of declaration. Hence an error is never matched twice by two -different patterns. The pattern declared first always wins. - -_BUFFER is ignored. - -Return a list of parsed errors and warnings (as `flycheck-error' -objects)." - (with-current-buffer buffer - (let ((patterns (flycheck-checker-error-patterns checker))) - (mapcar (lambda (err) - (flycheck-parse-error-with-patterns err patterns checker)) - (flycheck-tokenize-output-with-patterns output patterns))))) - - -;;; Convenience definition of command-syntax checkers -(defmacro flycheck-define-checker (symbol docstring &rest properties) - "Define SYMBOL as command syntax checker with DOCSTRING and PROPERTIES. - -Like `flycheck-define-command-checker', but PROPERTIES must not -be quoted. Also, implicitly define the executable variable for -SYMBOL with `flycheck-def-executable-var'." - (declare (indent 1) - (doc-string 2)) - (let ((command (plist-get properties :command)) - (parser (plist-get properties :error-parser)) - (filter (plist-get properties :error-filter)) - (predicate (plist-get properties :predicate))) - - `(progn - (flycheck-def-executable-var ,symbol ,(car command)) - - (flycheck-define-command-checker ',symbol - ,docstring - :command ',command - ,@(when parser - `(:error-parser #',parser)) - :error-patterns ',(plist-get properties :error-patterns) - ,@(when filter - `(:error-filter #',filter)) - :modes ',(plist-get properties :modes) - ,@(when predicate - `(:predicate #',predicate)) - :next-checkers ',(plist-get properties :next-checkers))))) - - -;;; Built-in checkers -(flycheck-def-args-var flycheck-gnat-args ada-gnat - :package-version '(flycheck . "0.20")) - -(flycheck-def-option-var flycheck-gnat-include-path nil ada-gnat - "A list of include directories for GNAT. - -The value of this variable is a list of strings, where each -string is a directory to add to the include path of gcc. -Relative paths are relative to the file being checked." - :type '(repeat (directory :tag "Include directory")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.20")) - -(flycheck-def-option-var flycheck-gnat-language-standard "2012" ada-gnat - "The language standard to use in GNAT. - -The value of this variable is either a string denoting a language -standard, or nil, to use the default standard. When non-nil, pass -the language standard via the `-std' option." - :type '(choice (const :tag "Default standard" nil) - (string :tag "Language standard")) - :safe #'stringp - :package-version '(flycheck . "0.20")) - -(flycheck-def-option-var flycheck-gnat-warnings - '("wa") ada-gnat - "A list of additional Ada warnings to enable in GNAT. - -The value of this variable is a list of strings, where each -string is the name of a warning category to enable. By default, -most optional warnings are recommended, as in `-gnata'. - -Refer to Info Node `(gnat_ugn_unw)Warning Message Control' for -more information about GNAT warnings." - :type '(repeat :tag "Warnings" (string :tag "Warning name")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.20")) - -(flycheck-define-checker ada-gnat - "An Ada syntax checker using GNAT. - -Uses the GNAT compiler from GCC. See URL -`https://gcc.gnu.org/onlinedocs/gnat_ugn_unw/'." - :command ("gnatmake" - "-c" ; Just compile, don't bind - "-f" ; Force re-compilation - "-u" ; Compile the main file only - "-gnatf" ; Full error information - "-gnatef" ; Full source file name - "-D" temporary-directory - (option-list "-gnat" flycheck-gnat-warnings concat) - (option-list "-I" flycheck-gnat-include-path concat) - (option "-gnat" flycheck-gnat-language-standard concat) - (eval flycheck-gnat-args) - source) - :error-patterns - ((error line-start - (message "In file included from") " " (file-name) ":" line ":" - column ":" - line-end) - (info line-start (file-name) ":" line ":" column - ": note: " (message) line-end) - (warning line-start (file-name) ":" line ":" column - ": warning: " (message) line-end) - (error line-start (file-name) ":" line ":" column ;no specific error prefix in Ada - ": " (message) line-end)) - :modes ada-mode) - -(flycheck-define-checker asciidoc - "A AsciiDoc syntax checker using the AsciiDoc compiler. - -See URL `http://www.methods.co.nz/asciidoc'." - :command ("asciidoc" source) - :error-patterns - ((error line-start "asciidoc: ERROR: " (file-name) - ": Line " line ": " (message) line-end) - (warning line-start "asciidoc: " (or "WARNING" "DEPRECATED") ": " (file-name) - ": Line " line ": " (message) line-end)) - :modes adoc-mode) - -(flycheck-def-args-var flycheck-clang-args c/c++-clang - :package-version '(flycheck . "0.22")) - -(flycheck-def-option-var flycheck-clang-blocks nil c/c++-clang - "Enable blocks in Clang. - -When non-nil, enable blocks in Clang with `-fblocks'. See URL -`http://clang.llvm.org/docs/BlockLanguageSpec.html' for more -information about blocks." - :type 'boolean - :safe #'booleanp - :package-version '(flycheck . "0.20")) - -(flycheck-def-option-var flycheck-clang-definitions nil c/c++-clang - "Additional preprocessor definitions for Clang. - -The value of this variable is a list of strings, where each -string is an additional definition to pass to Clang, via the `-D' -option." - :type '(repeat (string :tag "Definition")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.15")) - -(flycheck-def-option-var flycheck-clang-include-path nil c/c++-clang - "A list of include directories for Clang. - -The value of this variable is a list of strings, where each -string is a directory to add to the include path of Clang. -Relative paths are relative to the file being checked." - :type '(repeat (directory :tag "Include directory")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.14")) - -(flycheck-def-option-var flycheck-clang-includes nil c/c++-clang - "A list of additional include files for Clang. - -The value of this variable is a list of strings, where each -string is a file to include before syntax checking. Relative -paths are relative to the file being checked." - :type '(repeat (file :tag "Include file")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.15")) - -(flycheck-def-option-var flycheck-clang-language-standard nil c/c++-clang - "The language standard to use in Clang. - -The value of this variable is either a string denoting a language -standard, or nil, to use the default standard. When non-nil, -pass the language standard via the `-std' option." - :type '(choice (const :tag "Default standard" nil) - (string :tag "Language standard")) - :safe #'stringp - :package-version '(flycheck . "0.15")) -(make-variable-buffer-local 'flycheck-clang-language-standard) - -(flycheck-def-option-var flycheck-clang-ms-extensions nil c/c++-clang - "Whether to enable Microsoft extensions to C/C++ in Clang. - -When non-nil, enable Microsoft extensions to C/C++ via -`-fms-extensions'." - :type 'boolean - :safe #'booleanp - :package-version '(flycheck . "0.16")) - -(flycheck-def-option-var flycheck-clang-no-exceptions nil c/c++-clang - "Whether to disable exceptions in Clang. - -When non-nil, disable exceptions for syntax checks, via -`-fno-exceptions'." - :type 'boolean - :safe #'booleanp - :package-version '(flycheck . "0.20")) - -(flycheck-def-option-var flycheck-clang-no-rtti nil c/c++-clang - "Whether to disable RTTI in Clang. - -When non-nil, disable RTTI for syntax checks, via `-fno-rtti'." - :type 'boolean - :safe #'booleanp - :package-version '(flycheck . "0.15")) - -(flycheck-def-option-var flycheck-clang-standard-library nil c/c++-clang - "The standard library to use for Clang. - -The value of this variable is the name of a standard library as -string, or nil to use the default standard library. - -Refer to the Clang manual at URL -`http://clang.llvm.org/docs/UsersManual.html' for more -information about the standard library." - :type '(choice (const "libc++") - (const :tag "GNU libstdc++" "libstdc++") - (string :tag "Library name")) - :safe #'stringp - :package-version '(flycheck . "0.15")) - -(flycheck-def-option-var flycheck-clang-warnings '("all" "extra") c/c++-clang - "A list of additional warnings to enable in Clang. - -The value of this variable is a list of strings, where each string -is the name of a warning category to enable. By default, all -recommended warnings and some extra warnings are enabled (as by -`-Wall' and `-Wextra' respectively). - -Refer to the Clang manual at URL -`http://clang.llvm.org/docs/UsersManual.html' for more -information about warnings." - :type '(choice (const :tag "No additional warnings" nil) - (repeat :tag "Additional warnings" - (string :tag "Warning name"))) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.14")) - -(defun flycheck-c/c++-quoted-include-directory () - "Get the directory for quoted includes. - -C/C++ compiles typicall look up includes with quotation marks in -the directory of the file being compiled. However, since -Flycheck uses temporary copies for syntax checking, it needs to -explicitly determine the directory for quoted includes. - -This function determines the directory by looking at -`buffer-file-name', or if that is nil, at `default-directory'." - (-if-let (fn (buffer-file-name)) - (file-name-directory fn) - ;; If the buffer has no file name, fall back to its default directory - default-directory)) - -(flycheck-define-checker c/c++-clang - "A C/C++ syntax checker using Clang. - -See URL `http://clang.llvm.org/'." - :command ("clang" - "-fsyntax-only" - "-fno-color-diagnostics" ; Do not include color codes in output - "-fno-caret-diagnostics" ; Do not visually indicate the source - ; location - "-fno-diagnostics-show-option" ; Do not show the corresponding - ; warning group - "-iquote" (eval (flycheck-c/c++-quoted-include-directory)) - (option "-std=" flycheck-clang-language-standard concat) - (option "-stdlib=" flycheck-clang-standard-library concat) - (option-flag "-fms-extensions" flycheck-clang-ms-extensions) - (option-flag "-fno-exceptions" flycheck-clang-no-exceptions) - (option-flag "-fno-rtti" flycheck-clang-no-rtti) - (option-flag "-fblocks" flycheck-clang-blocks) - (option-list "-include" flycheck-clang-includes) - (option-list "-W" flycheck-clang-warnings concat) - (option-list "-D" flycheck-clang-definitions concat) - (option-list "-I" flycheck-clang-include-path) - (eval flycheck-clang-args) - "-x" (eval - (pcase major-mode - (`c++-mode "c++") - (`c-mode "c"))) - source) - :error-patterns - ((error line-start - (message "In file included from") " " (file-name) ":" line ":" - line-end) - (info line-start (file-name) ":" line ":" column - ": note: " (optional (message)) line-end) - (warning line-start (file-name) ":" line ":" column - ": warning: " (optional (message)) line-end) - (error line-start (file-name) ":" line ":" column - ": " (or "fatal error" "error") ": " (optional (message)) line-end)) - :error-filter - (lambda (errors) - (let ((errors (flycheck-sanitize-errors errors))) - (dolist (err errors) - ;; Clang will output empty messages for #error/#warning pragmas without - ;; messages. We fill these empty errors with a dummy message to get - ;; them past our error filtering - (setf (flycheck-error-message err) - (or (flycheck-error-message err) "no message"))) - (flycheck-fold-include-levels errors "In file included from"))) - :modes (c-mode c++-mode) - :next-checkers ((warning . c/c++-cppcheck))) - -(flycheck-def-args-var flycheck-gcc-args c/c++-gcc - :package-version '(flycheck . "0.22")) - -(flycheck-def-option-var flycheck-gcc-definitions nil c/c++-gcc - "Additional preprocessor definitions for GCC. - -The value of this variable is a list of strings, where each -string is an additional definition to pass to GCC, via the `-D' -option." - :type '(repeat (string :tag "Definition")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.20")) - -(flycheck-def-option-var flycheck-gcc-include-path nil c/c++-gcc - "A list of include directories for GCC. - -The value of this variable is a list of strings, where each -string is a directory to add to the include path of gcc. -Relative paths are relative to the file being checked." - :type '(repeat (directory :tag "Include directory")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.20")) - -(flycheck-def-option-var flycheck-gcc-includes nil c/c++-gcc - "A list of additional include files for GCC. - -The value of this variable is a list of strings, where each -string is a file to include before syntax checking. Relative -paths are relative to the file being checked." - :type '(repeat (file :tag "Include file")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.20")) - -(flycheck-def-option-var flycheck-gcc-language-standard nil c/c++-gcc - "The language standard to use in GCC. - -The value of this variable is either a string denoting a language -standard, or nil, to use the default standard. When non-nil, -pass the language standard via the `-std' option." - :type '(choice (const :tag "Default standard" nil) - (string :tag "Language standard")) - :safe #'stringp - :package-version '(flycheck . "0.20")) -(make-variable-buffer-local 'flycheck-gcc-language-standard) - -(flycheck-def-option-var flycheck-gcc-no-exceptions nil c/c++-gcc - "Whether to disable exceptions in GCC. - -When non-nil, disable exceptions for syntax checks, via -`-fno-exceptions'." - :type 'boolean - :safe #'booleanp - :package-version '(flycheck . "0.20")) - -(flycheck-def-option-var flycheck-gcc-no-rtti nil c/c++-gcc - "Whether to disable RTTI in GCC. - -When non-nil, disable RTTI for syntax checks, via `-fno-rtti'." - :type 'boolean - :safe #'booleanp - :package-version '(flycheck . "0.20")) - -(flycheck-def-option-var flycheck-gcc-openmp nil c/c++-gcc - "Whether to enable OpenMP in GCC. - -When non-nil, enable OpenMP for syntax checkers, via -`-fopenmp'." - :type 'boolean - :safe #'booleanp - :package-version '(flycheck . "0.21")) - -(flycheck-def-option-var flycheck-gcc-warnings '("all" "extra") c/c++-gcc - "A list of additional warnings to enable in GCC. - -The value of this variable is a list of strings, where each string -is the name of a warning category to enable. By default, all -recommended warnings and some extra warnings are enabled (as by -`-Wall' and `-Wextra' respectively). - -Refer to the gcc manual at URL -`https://gcc.gnu.org/onlinedocs/gcc/' for more information about -warnings." - :type '(choice (const :tag "No additional warnings" nil) - (repeat :tag "Additional warnings" - (string :tag "Warning name"))) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.20")) - -(flycheck-define-checker c/c++-gcc - "A C/C++ syntax checker using GCC. - -Requires GCC 4.8 or newer. See URL `https://gcc.gnu.org/'." - :command ("gcc" - "-fshow-column" - "-fno-diagnostics-show-caret" ; Do not visually indicate the source location - "-fno-diagnostics-show-option" ; Do not show the corresponding - ; warning group - "-iquote" (eval (flycheck-c/c++-quoted-include-directory)) - (option "-std=" flycheck-gcc-language-standard concat) - (option-flag "-fno-exceptions" flycheck-gcc-no-exceptions) - (option-flag "-fno-rtti" flycheck-gcc-no-rtti) - (option-flag "-fopenmp" flycheck-gcc-openmp) - (option-list "-include" flycheck-gcc-includes) - (option-list "-W" flycheck-gcc-warnings concat) - (option-list "-D" flycheck-gcc-definitions concat) - (option-list "-I" flycheck-gcc-include-path) - (eval flycheck-gcc-args) - "-x" (eval - (pcase major-mode - (`c++-mode "c++") - (`c-mode "c"))) - source - ;; GCC performs full checking only when actually compiling, so - ;; `-fsyntax-only' is not enough. Just let it generate assembly - ;; code. - "-S" "-o" null-device) - :error-patterns - ((error line-start - (message "In file included from") " " (file-name) ":" line ":" - column ":" - line-end) - (info line-start (file-name) ":" line ":" column - ": note: " (message) line-end) - (warning line-start (file-name) ":" line ":" column - ": warning: " (message) line-end) - (error line-start (file-name) ":" line ":" column - ": " (or "fatal error" "error") ": " (message) line-end)) - :error-filter - (lambda (errors) - (flycheck-fold-include-levels (flycheck-sanitize-errors errors) - "In file included from")) - :modes (c-mode c++-mode) - :next-checkers ((warning . c/c++-cppcheck))) - -(flycheck-def-option-var flycheck-cppcheck-checks '("style") c/c++-cppcheck - "Enabled checks for Cppcheck. - -The value of this variable is a list of strings, where each -string is the name of an additional check to enable. By default, -all coding style checks are enabled. - -See section \"Enable message\" in the Cppcheck manual at URL -`http://cppcheck.sourceforge.net/manual.pdf', and the -documentation of the `--enable' option for more information, -including a list of supported checks." - :type '(repeat :tag "Additional checks" - (string :tag "Check name")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.14")) - -(flycheck-def-option-var flycheck-cppcheck-inconclusive nil c/c++-cppcheck - "Whether to enable Cppcheck inconclusive checks. - -When non-nil, enable Cppcheck inconclusive checks. This allows Cppcheck to -report warnings it's not certain of, but it may result in false positives. - -This will have no effect when using Cppcheck 1.53 and older." - :type 'boolean - :safe #'booleanp - :package-version '(flycheck . "0.19")) - -(flycheck-define-checker c/c++-cppcheck - "A C/C++ checker using cppcheck. - -See URL `http://cppcheck.sourceforge.net/'." - :command ("cppcheck" "--quiet" "--xml-version=2" "--inline-suppr" - (option "--enable=" flycheck-cppcheck-checks concat - flycheck-option-comma-separated-list) - (option-flag "--inconclusive" flycheck-cppcheck-inconclusive) - source) - :error-parser flycheck-parse-cppcheck - :modes (c-mode c++-mode)) - -(flycheck-define-checker cfengine - "A CFEngine syntax checker using cf-promises. - -See URL `http://cfengine.com/'." - :command ("cf-promises" "-Wall" "-f" - ;; We must stay in the same directory to resolve @include - source-inplace) - :error-patterns - ((warning line-start (file-name) ":" line ":" column - ": warning: " (message) line-end) - (error line-start (file-name) ":" line ":" column - ": error: " (message) line-end)) - :modes (cfengine-mode cfengine3-mode)) - -(flycheck-define-checker chef-foodcritic - "A Chef cookbooks syntax checker using Foodcritic. - -See URL `http://acrmp.github.io/foodcritic/'." - ;; Use `source-inplace' to allow resource discovery with relative paths. - ;; foodcritic interprets these as relative to the source file, so we need to - ;; stay within the source tree. See - ;; https://github.com/flycheck/flycheck/pull/556 - :command ("foodcritic" source-inplace) - :error-patterns - ((error line-start (message) ": " (file-name) ":" line line-end)) - :modes (enh-ruby-mode ruby-mode) - :predicate - (lambda () - (let ((parent-dir (file-name-directory - (directory-file-name - (expand-file-name default-directory))))) - (or - ;; Chef CookBook - ;; http://docs.opscode.com/chef/knife.html#id38 - (locate-dominating-file parent-dir "recipes") - ;; Knife Solo - ;; http://matschaffer.github.io/knife-solo/#label-Init+command - (locate-dominating-file parent-dir "cookbooks"))))) - -(flycheck-define-checker coffee - "A CoffeeScript syntax checker using coffee. - -See URL `http://coffeescript.org/'." - ;; --print suppresses generation of compiled .js files - :command ("coffee" "--compile" "--print" source) - :error-patterns - ((error line-start (file-name) ":" line ":" column - ": error: " (message) line-end)) - :modes coffee-mode - :next-checkers ((warning . coffee-coffeelint))) - -(flycheck-def-config-file-var flycheck-coffeelintrc coffee-coffeelint - ".coffeelint.json" - :safe #'stringp) - -(flycheck-define-checker coffee-coffeelint - "A CoffeeScript style checker using coffeelint. - -This syntax checker requires coffeelint 1.0 or newer. - -See URL `http://www.coffeelint.org/'." - :command - ("coffeelint" - (config-file "--file" flycheck-coffeelintrc) - "--reporter" "checkstyle" source) - :error-parser flycheck-parse-checkstyle - :error-filter (lambda (errors) - (flycheck-remove-error-ids - (flycheck-sanitize-errors errors))) - :modes coffee-mode) - -(flycheck-define-checker coq - "A Coq syntax checker using the Coq compiler. - -See URL `http://coq.inria.fr/'." - ;; We use coqtop in batch mode, because coqc is picky about file names. - :command ("coqtop" "-batch" "-load-vernac-source" source) - :error-patterns - ((error line-start "File \"" (file-name) "\", line " line - ;; TODO: Parse the end column, once Flycheck supports that - ", characters " column "-" (one-or-more digit) ":\n" - (or "Syntax error: " "Error: ") - ;; Most Coq error messages span multiple lines, and end with a dot. - ;; There are simple one-line messages, too, though. - (message (or (and (one-or-more (or not-newline "\n")) ".") - (one-or-more not-newline))) - line-end)) - :error-filter - (lambda (errors) - (dolist (err errors) - (setf (flycheck-error-message err) - (replace-regexp-in-string (rx (1+ (syntax whitespace)) line-end) - "" (flycheck-error-message err) - 'fixedcase 'literal))) - (flycheck-increment-error-columns errors)) - :modes coq-mode) - -(flycheck-define-checker css-csslint - "A CSS syntax and style checker using csslint. - -See URL `https://github.com/CSSLint/csslint'." - :command ("csslint" "--format=checkstyle-xml" source) - :error-parser flycheck-parse-checkstyle - :error-filter flycheck-dequalify-error-ids - :modes css-mode) - -(defconst flycheck-d-module-re - (rx "module" (one-or-more (syntax whitespace)) - (group (one-or-more (not (syntax whitespace)))) - (zero-or-more (syntax whitespace)) - ";") - "Regular expression to match a D module declaration.") - -(defun flycheck-d-base-directory () - "Get the relative base directory path for this module." - (let* ((file-name (buffer-file-name)) - (module-file (if (string= (file-name-nondirectory file-name) - "package.d") - (directory-file-name (file-name-directory file-name)) - file-name))) - (flycheck-module-root-directory - (flycheck-find-in-buffer flycheck-d-module-re) - module-file))) - -(flycheck-def-option-var flycheck-dmd-include-path nil d-dmd - "A list of include directories for dmd. - -The value of this variable is a list of strings, where each -string is a directory to add to the include path of dmd. -Relative paths are relative to the file being checked." - :type '(repeat (directory :tag "Include directory")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.18")) - -(flycheck-define-checker d-dmd - "A D syntax checker using the DMD compiler. - -Requires DMD 2.066 or newer. See URL `http://dlang.org/'." - :command ("dmd" - "-debug" ; Compile in debug mode - "-o-" ; Don't generate an object file - "-vcolumns" ; Add columns in output - "-wi" ; Compilation will continue even if there are warnings - (eval (concat "-I" (flycheck-d-base-directory))) - (option-list "-I" flycheck-dmd-include-path concat) - source) - :error-patterns - ((error line-start - (file-name) "(" line "," column "): Error: " (message) - line-end) - (warning line-start (file-name) "(" line "," column "): " - (or "Warning" "Deprecation") ": " (message) line-end)) - :modes d-mode) - -(flycheck-define-checker elixir - "An Elixir syntax checker using the Elixir interpreter. - -See URL `http://elixir-lang.org/'." - :command ("elixirc" - "-o" temporary-directory ; Move compiler output out of the way - "--ignore-module-conflict" ; Prevent tedious module redefinition - ; warning. - source) - :error-patterns - ;; Elixir compiler errors - ((error line-start "** (" (zero-or-more not-newline) ") " - (file-name) ":" line ": " (message) line-end) - ;; Warnings from Elixir >= 0.12.4 - (warning line-start (file-name) ":" line ": warning:" (message) line-end) - ;; Warnings from older Elixir versions - (warning line-start (file-name) ":" line ": " (message) line-end)) - :modes elixir-mode) - -(defconst flycheck-this-emacs-executable - (concat invocation-directory invocation-name) - "The path to the currently running Emacs executable.") - -(defconst flycheck-emacs-args '("-Q" "--batch") - "Common arguments to Emacs invocations.") - -(defmacro flycheck-prepare-emacs-lisp-form (&rest body) - "Prepare BODY for use as check form in a subprocess." - (declare (indent 0)) - `(flycheck-sexp-to-string - '(progn - (defvar jka-compr-inhibit) - (unwind-protect - ;; Flycheck inhibits compression of temporary files, thus we - ;; must not attempt to decompress. - (let ((jka-compr-inhibit t)) - ;; Strip option-argument separator from arguments, if present - (when (equal (car command-line-args-left) "--") - (setq command-line-args-left (cdr command-line-args-left))) - ,@body) - ;; Prevent Emacs from processing the arguments on its own, see - ;; https://github.com/flycheck/flycheck/issues/319 - (setq command-line-args-left nil))))) - -(defconst flycheck-emacs-lisp-check-form - (flycheck-prepare-emacs-lisp-form - ;; Keep track of the generated bytecode files, to delete them after byte - ;; compilation. - (defvar flycheck-byte-compiled-files nil) - (let ((byte-compile-dest-file-function - (lambda (source) - (let ((temp-file (make-temp-file (file-name-nondirectory source)))) - (push temp-file flycheck-byte-compiled-files) - temp-file)))) - (unwind-protect - (byte-compile-file (car command-line-args-left)) - (mapc (lambda (f) (ignore-errors (delete-file f))) - flycheck-byte-compiled-files))))) - -(flycheck-def-option-var flycheck-emacs-lisp-load-path nil emacs-lisp - "Load path to use in the Emacs Lisp syntax checker. - -When set to `inherit', use the `load-path' of the current Emacs -session during syntax checking. - -When set to a list of strings, add each directory in this list to -the `load-path' before invoking the byte compiler. Relative -paths in this list are expanded against the `default-directory' -of the buffer to check. - -When nil, do not explicitly set the `load-path' during syntax -checking. The syntax check only uses the built-in `load-path' of -Emacs in this case. - -Note that changing this variable can lead to wrong results of the -syntax check, e.g. if an unexpected version of a required library -is used." - :type '(choice (const :tag "Inherit current `load-path'" inherit) - (repeat :tag "Load path" directory)) - :risky t - :package-version '(flycheck . "0.14")) - -(flycheck-def-option-var flycheck-emacs-lisp-initialize-packages - 'auto emacs-lisp - "Whether to initialize packages in the Emacs Lisp syntax checker. - -To initialize packages, call `package-initialize' before -byte-compiling the file to check. - -When nil, never initialize packages. When `auto', initialize -packages only when checking files from `user-emacs-directory'. -For any other non-nil value, always initialize packages." - :type '(choice (const :tag "Do not initialize packages" nil) - (const :tag "Initialize packages for configuration only" auto) - (const :tag "Always initialize packages" t)) - :risky t - :package-version '(flycheck . "0.14")) - -(defconst flycheck-emacs-lisp-package-initialize-form - (flycheck-sexp-to-string - '(with-demoted-errors "Error during package initialization: %S" - (package-initialize))) - "Form used to initialize packages.") - -(defun flycheck-option-emacs-lisp-package-initialize (value) - "Option VALUE filter for `flycheck-emacs-lisp-initialize-packages'." - (let ((shall-initialize - (if (eq value 'auto) - (flycheck-in-user-emacs-directory-p (buffer-file-name)) - value))) - (when shall-initialize - ;; If packages shall be initialized, return the corresponding form, - ;; otherwise make Flycheck ignore the option by returning nil. - flycheck-emacs-lisp-package-initialize-form))) - -(flycheck-def-option-var flycheck-emacs-lisp-package-user-dir nil emacs-lisp - "Package directory for the Emacs Lisp syntax checker. - -When set to a string, set `package-user-dir' to the value of this -variable before initializing packages. - -This variable has no effect, if -`flycheck-emacs-lisp-initialize-packages' is nil." - :type '(choice (const :tag "Default package directory" nil) - (directory :tag "Custom package directory")) - :risky t - :package-version '(flycheck . "0.14")) - -(defun flycheck-option-emacs-lisp-package-user-dir (value) - "Option VALUE filter for `flycheck-emacs-lisp-package-user-dir'." - (unless value - ;; Inherit the package directory from our Emacs session - (setq value (and (boundp 'package-user-dir) package-user-dir))) - (when value - (flycheck-sexp-to-string `(setq package-user-dir ,value)))) - -(flycheck-define-checker emacs-lisp - "An Emacs Lisp syntax checker using the Emacs Lisp Byte compiler. - -See Info Node `(elisp)Byte Compilation'." - :command ("emacs" (eval flycheck-emacs-args) - (eval - (let ((path (pcase flycheck-emacs-lisp-load-path - (`inherit load-path) - (p (mapcar #'expand-file-name p))))) - (flycheck-prepend-with-option "--directory" path))) - (option "--eval" flycheck-emacs-lisp-package-user-dir nil - flycheck-option-emacs-lisp-package-user-dir) - (option "--eval" flycheck-emacs-lisp-initialize-packages nil - flycheck-option-emacs-lisp-package-initialize) - "--eval" (eval flycheck-emacs-lisp-check-form) - "--" - source-inplace) - :error-patterns - ((error line-start (file-name) ":" line ":" column ":Error:" - (message (zero-or-more not-newline) - (zero-or-more "\n " (zero-or-more not-newline))) - line-end) - (warning line-start (file-name) ":" line ":" column ":Warning:" - (message (zero-or-more not-newline) - (zero-or-more "\n " (zero-or-more not-newline))) - line-end)) - :error-filter - (lambda (errors) - (flycheck-collapse-error-message-whitespace - (flycheck-sanitize-errors errors))) - :modes (emacs-lisp-mode lisp-interaction-mode) - :predicate - (lambda () - (and - ;; Ensure that we only check buffers with a backing file. For buffers - ;; without a backing file we cannot guarantee that file names in error - ;; messages are properly resolved, because `byte-compile-file' emits file - ;; names *relative to the directory of the checked file* instead of the - ;; working directory. Hence our backwards-substitution will fail, because - ;; the checker process has a different base directory to resolve relative - ;; file names than the Flycheck code working on the buffer to check. - (buffer-file-name) - ;; Do not check buffers which should not be byte-compiled. The checker - ;; process will refuse to compile these, which would confuse Flycheck - (not (bound-and-true-p no-byte-compile)) - ;; Do not check buffers used for autoloads generation during package - ;; installation. These buffers are too short-lived for being checked, and - ;; doing so causes spurious errors. See - ;; https://github.com/flycheck/flycheck/issues/45 and - ;; https://github.com/bbatsov/prelude/issues/248. We must also not check - ;; compilation buffers, but as these are ephemeral, Flycheck won't check - ;; them anyway. - (not (flycheck-autoloads-file-p)))) - :next-checkers (emacs-lisp-checkdoc)) - -(defconst flycheck-emacs-lisp-checkdoc-form - (flycheck-prepare-emacs-lisp-form - (require 'checkdoc) - - (let ((source (car command-line-args-left)) - ;; Remember the default directory of the process - (process-default-directory default-directory)) - (with-temp-buffer - (insert-file-contents source 'visit) - (setq buffer-file-name source) - ;; And change back to the process default directory to make file-name - ;; back-substutition work - (setq default-directory process-default-directory) - (with-demoted-errors "Error in checkdoc: %S" - (checkdoc-current-buffer t) - (with-current-buffer checkdoc-diagnostic-buffer - (princ (buffer-substring-no-properties (point-min) (point-max))) - (kill-buffer))))))) - -(flycheck-define-checker emacs-lisp-checkdoc - "An Emacs Lisp style checker using CheckDoc. - -The checker runs `checkdoc-current-buffer'." - :command ("emacs" (eval flycheck-emacs-args) - "--eval" (eval flycheck-emacs-lisp-checkdoc-form) - "--" source) - :error-patterns - ((warning line-start (file-name) ":" line ": " (message) line-end)) - :modes (emacs-lisp-mode) - :predicate - (lambda () - ;; Do not check Autoloads, Cask/Carton and dir-locals files. These files - ;; really don't need to follow Checkdoc conventions. - (not (or (flycheck-autoloads-file-p) - (and (buffer-file-name) - (member (file-name-nondirectory (buffer-file-name)) - '("Cask" "Carton" ".dir-locals.el"))))))) - -(progn - ;; Use the currently running Emacs by default. - (setcar (get 'emacs-lisp 'flycheck-command) flycheck-this-emacs-executable) - (setcar (get 'emacs-lisp-checkdoc 'flycheck-command) - flycheck-this-emacs-executable)) - -(flycheck-define-checker erlang - "An Erlang syntax checker using the Erlang interpreter. - -See URL `http://www.erlang.org/'." - :command ("erlc" "-o" temporary-directory "-Wall" source) - :error-patterns - ((warning line-start (file-name) ":" line ": Warning:" (message) line-end) - (error line-start (file-name) ":" line ": " (message) line-end)) - :modes erlang-mode) - -(flycheck-define-checker eruby-erubis - "A eRuby syntax checker using the `erubis' command. - -See URL `http://www.kuwata-lab.com/erubis/'." - :command ("erubis" "-z" source) - :error-patterns - ((error line-start (file-name) ":" line ": " (message) line-end)) - :modes (html-erb-mode rhtml-mode)) - -(flycheck-def-args-var flycheck-gfortran-args fortran-gfortran - :package-version '(flycheck . "0.22")) - -(flycheck-def-option-var flycheck-gfortran-include-path nil fortran-gfortran - "A list of include directories for GCC Fortran. - -The value of this variable is a list of strings, where each -string is a directory to add to the include path of gcc. -Relative paths are relative to the file being checked." - :type '(repeat (directory :tag "Include directory")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.20")) - -(flycheck-def-option-var flycheck-gfortran-language-standard "f95" fortran-gfortran - "The language standard to use in GFortran. - -The value of this variable is either a string denoting a language -standard, or nil, to use the default standard. When non-nil, -pass the language standard via the `-std' option." - :type '(choice (const :tag "Default standard" nil) - (string :tag "Language standard")) - :safe #'stringp - :package-version '(flycheck . "0.20")) - -(flycheck-def-option-var flycheck-gfortran-layout nil fortran-gfortran - "The source code layout to use in GFortran. - -The value of this variable is one of the following symbols: - -nil - Let gfortran determine the layout from the extension - -`free' - Use free form layout - - -`fixed' - Use fixed form layout - -In any other case, an error is signaled.") - -(defun flycheck-option-gfortran-layout (value) - "Option VALUE filter for `flycheck-gfortran-layout'." - (pcase value - (`nil nil) - (`free "free-form") - (`fixed "fixed-form") - (_ (error "Invalid value for flycheck-gfortran-layout: %S" value)))) - -(flycheck-def-option-var flycheck-gfortran-warnings '("all" "extra") - fortran-gfortran - "A list of warnings for GCC Fortran. - -The value of this variable is a list of strings, where each string -is the name of a warning category to enable. By default, all -recommended warnings and some extra warnings are enabled (as by -`-Wall' and `-Wextra' respectively). - -Refer to the gfortran manual at URL -`https://gcc.gnu.org/onlinedocs/gfortran/' for more information -about warnings") - -(flycheck-define-checker fortran-gfortran - "An Fortran syntax checker using GCC. - -Uses GCC's Fortran compiler gfortran. See URL -`https://gcc.gnu.org/onlinedocs/gfortran/'." - :command ("gfortran" - "-fsyntax-only" - "-fshow-column" - "-fno-diagnostics-show-caret" ; Do not visually indicate the source location - "-fno-diagnostics-show-option" ; Do not show the corresponding - ; warning group - ;; Fortran has similar include processing as C/C++ - "-iquote" (eval (flycheck-c/c++-quoted-include-directory)) - (option "-std=" flycheck-gfortran-language-standard concat) - (option "-f" flycheck-gfortran-layout concat - flycheck-option-gfortran-layout) - (option-list "-W" flycheck-gfortran-warnings concat) - (option-list "-I" flycheck-gfortran-include-path concat) - (eval flycheck-gfortran-args) - source) - :error-patterns - ((error line-start (file-name) ":" line "." column ":\n" - (= 3 (zero-or-more not-newline) "\n") - (or "Error" "Fatal Error") ": " (message) line-end) - (warning line-start (file-name) ":" line "." column ":\n" - (= 3 (zero-or-more not-newline) "\n") - "Warning: " (message) line-end)) - :modes (fortran-mode f90-mode)) - -(flycheck-define-checker go-gofmt - "A Go syntax and style checker using the gofmt utility. - -See URL `http://golang.org/cmd/gofmt/'." - :command ("gofmt" source) - :error-patterns - ((error line-start (file-name) ":" line ":" column ": " (message) line-end)) - :modes go-mode - :next-checkers ((warning . go-golint) - ;; Fall back, if go-golint doesn't exist - (warning . go-vet) - ;; Fall back, if go-vet doesn't exist - (warning . go-build) (warning . go-test) - (warning . go-errcheck))) - -(flycheck-define-checker go-golint - "A Go style checker using Golint. - -See URL `https://github.com/golang/lint'." - :command ("golint" source) - :error-patterns - ((warning line-start (file-name) ":" line ":" column ": " (message) line-end)) - :modes go-mode - :next-checkers (go-vet - ;; Fall back, if go-vet doesn't exist - go-build go-test go-errcheck)) - -(flycheck-def-option-var flycheck-go-vet-print-functions nil go-vet - "A comma-separated list of print-like functions for `go tool vet'. - -Go vet will check these functions for format string problems and -issues, such as a mismatch between the number of formats used, -and the number of arguments given. - -Each entry is in the form Name:N where N is the zero-based -argument position of the first argument involved in the print: -either the format or the first print argument for non-formatted -prints. For example, if you have Warn and Warnf functions that -take an io.Writer as their first argument, like Fprintf, --printfuncs=Warn:1,Warnf:1 " - :type '(repeat :tag "print-like functions" - (string :tag "function")) - :safe #'flycheck-string-list-p) - -(flycheck-define-checker go-vet - "A Go syntax checker using the `go tool vet' command. - -See URL `http://golang.org/cmd/go/' and URL -`http://godoc.org/golang.org/x/tools/cmd/vet'." - :command ("go" "tool" "vet" - (option "-printfuncs=" flycheck-go-vet-print-functions concat - flycheck-option-comma-separated-list) - source) - :error-patterns - ((warning line-start (file-name) ":" line ": " (message) line-end)) - :modes go-mode - ;; We must explicitly check whether the "vet" tool is available - :predicate (lambda () - (let ((go (flycheck-checker-executable 'go-vet))) - (member "vet" (ignore-errors (process-lines go "tool"))))) - :next-checkers (go-build - go-test - ;; Fall back if `go build' or `go test' can be used - go-errcheck)) - -(flycheck-define-checker go-build - "A Go syntax and type checker using the `go build' command. - -See URL `http://golang.org/cmd/go'." - ;; We need to use `temporary-file-name' instead of `null-device', because Go - ;; can't write to the null device. It's “too magic”. See - ;; https://code.google.com/p/go/issues/detail?id=4851 for details. - :command ("go" "build" "-o" temporary-file-name) - :error-patterns - ((error line-start (file-name) ":" line ":" - (optional column ":") " " - (message (one-or-more not-newline) - (zero-or-more "\n\t" (one-or-more not-newline))) - line-end)) - :modes go-mode - :predicate (lambda () - (and (flycheck-buffer-saved-p) - (not (string-suffix-p "_test.go" (buffer-file-name))))) - :next-checkers ((warning . go-errcheck))) - -(flycheck-define-checker go-test - "A Go syntax and type checker using the `go test' command. - -See URL `http://golang.org/cmd/go'." - ;; This command builds the test executable and leaves it in the current - ;; directory. Unfortunately 'go test -c' does not have the '-o' option. - :command ("go" "test" "-c") - :error-patterns - ((error line-start (file-name) ":" line ": " - (message (one-or-more not-newline) - (zero-or-more "\n\t" (one-or-more not-newline))) - line-end)) - :modes go-mode - :predicate - (lambda () (and (flycheck-buffer-saved-p) - (string-suffix-p "_test.go" (buffer-file-name)))) - :next-checkers ((warning . go-errcheck))) - -(defun flycheck-go-package-name (&optional file-name gopath) - "Determine the package name for FILE-NAME and GOPATH. - -FILE-NAME defaults to `buffer-file-name'. GOPATH defaults to -$GOPATH. - -Return the package name for FILE-NAME, or nil if FILE-NAME is not -part of any package or if GOPATH is nil." - (-when-let* ((gopath (or gopath (getenv "GOPATH"))) - (file-name (or file-name (buffer-file-name)))) - (let ((gosrc (file-name-as-directory (expand-file-name "src/" gopath))) - (file-name (expand-file-name file-name))) - (when (string-prefix-p gosrc file-name) - ;; The file is part of a package, so determine the package name, as - ;; relative file name to the GO source directory - (directory-file-name ; Remove trailing / - (file-relative-name (file-name-directory file-name) gosrc)))))) - -(flycheck-define-checker go-errcheck - "A Go checker for unchecked errors. - -See URL `https://github.com/kisielk/errcheck'." - :command ("errcheck" (eval (flycheck-go-package-name))) - :error-patterns - ((warning line-start - (file-name) ":" line ":" column (one-or-more "\t") - (message) - line-end)) - :error-filter - (lambda (errors) - (let ((errors (flycheck-sanitize-errors errors)) - (gosrc (expand-file-name "src/" (getenv "GOPATH")))) - (dolist (err errors) - ;; File names are relative to the Go source directory, so we need to - ;; unexpand and re-expand them - (setf (flycheck-error-filename err) - (expand-file-name - ;; Get the relative name back, since Flycheck has already - ;; expanded the name for us - (file-relative-name (flycheck-error-filename err)) - ;; And expand it against the Go source directory - gosrc)) - (-when-let (message (flycheck-error-message err)) - ;; Improve the messages reported by errcheck to make them more clear. - (setf (flycheck-error-message err) - (format "Ignored `error` returned from `%s`" message))))) - errors) - :modes go-mode - :predicate - (lambda () - ;; We need a valid package name, since errcheck only works on entire - ;; packages, and can't check individual Go files. - (and (flycheck-buffer-saved-p) (flycheck-go-package-name)))) - -(flycheck-define-checker haml - "A Haml syntax checker using the Haml compiler. - -See URL `http://haml.info'." - :command ("haml" "-c" source) - :error-patterns - ((error line-start "Syntax error on line " line ": " (message) line-end)) - :modes haml-mode) - -(flycheck-define-checker handlebars - "A Handlebars syntax checker using the Handlebars compiler. - -See URL `http://handlebarsjs.com/'." - :command ("handlebars" source) - :error-patterns - ((error line-start - "Error: Parse error on line " line ":" (optional "\r") "\n" - (zero-or-more not-newline) "\n" (zero-or-more not-newline) "\n" - (message) line-end)) - :modes (handlebars-mode handlebars-sgml-mode)) - -(defconst flycheck-haskell-module-re - (rx line-start (zero-or-more (or "\n" (any space))) - "module" (one-or-more (or "\n" (any space))) - (group (one-or-more (not (any space "\n"))))) - "Regular expression for a Haskell module name.") - -(flycheck-def-args-var flycheck-ghc-args haskell-ghc - :package-version '(flycheck . "0.22")) - -(flycheck-def-option-var flycheck-ghc-no-user-package-database nil haskell-ghc - "Whether to disable the user package database in GHC. - -When non-nil, disable the user package database in GHC, via -`-no-user-package-db'." - :type 'boolean - :safe #'booleanp - :package-version '(flycheck . "0.16")) - -(flycheck-def-option-var flycheck-ghc-package-databases nil haskell-ghc - "Additional module databases for GHC. - -The value of this variable is a list of strings, where each -string is a directory of a package database. Each package -database is given to GHC via `-package-db'." - :type '(repeat (directory :tag "Package database")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.16")) - -(flycheck-def-option-var flycheck-ghc-search-path nil haskell-ghc - "Module search path for GHC. - -The value of this variable is a list of strings, where each -string is a directory containing Haskell modules. Each directory -is added to the GHC search path via `-i'." - :type '(repeat (directory :tag "Module directory")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.16")) - -(flycheck-def-option-var flycheck-ghc-language-extensions nil haskell-ghc - "Language extensions for GHC. - -The value of this variable is a list of strings, where each -string is a Haskell language extension, as in the LANGUAGE -pragma. Each extension is enabled via `-X'." - :type '(repeat (string :tag "Language extension")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.19")) - -(flycheck-define-checker haskell-ghc - "A Haskell syntax and type checker using ghc. - -See URL `http://www.haskell.org/ghc/'." - :command ("ghc" "-Wall" "-fno-code" - (option-flag "-no-user-package-db" - flycheck-ghc-no-user-package-database) - (option-list "-package-db" flycheck-ghc-package-databases) - (option-list "-i" flycheck-ghc-search-path concat) - ;; Include the parent directory of the current module tree, to - ;; properly resolve local imports - (eval (concat - "-i" - (flycheck-module-root-directory - (flycheck-find-in-buffer flycheck-haskell-module-re)))) - (option-list "-X" flycheck-ghc-language-extensions concat) - (eval flycheck-ghc-args) - "-x" (eval - (pcase major-mode - (`haskell-mode "hs") - (`literate-haskell-mode "lhs"))) - source) - :error-patterns - ((warning line-start (file-name) ":" line ":" column ":" - (or " " "\n ") "Warning:" (optional "\n") - (message - (one-or-more " ") (one-or-more not-newline) - (zero-or-more "\n" - (one-or-more " ") - (one-or-more not-newline))) - line-end) - (error line-start (file-name) ":" line ":" column ":" - (or (message (one-or-more not-newline)) - (and "\n" - (message - (one-or-more " ") (one-or-more not-newline) - (zero-or-more "\n" - (one-or-more " ") - (one-or-more not-newline))))) - line-end)) - :error-filter - (lambda (errors) - (flycheck-sanitize-errors (flycheck-dedent-error-messages errors))) - :modes (haskell-mode literate-haskell-mode) - :next-checkers ((warning . haskell-hlint))) - -(flycheck-define-checker haskell-hlint - "A Haskell style checker using hlint. - -See URL `https://github.com/ndmitchell/hlint'." - :command ("hlint" source-inplace) - :error-patterns - ((warning line-start - (file-name) ":" line ":" column - ": Warning: " - (message (one-or-more not-newline) - (one-or-more "\n" (one-or-more not-newline))) - line-end) - (error line-start - (file-name) ":" line ":" column - ": Error: " - (message (one-or-more not-newline) - (one-or-more "\n" (one-or-more not-newline))) - line-end)) - :modes (haskell-mode literate-haskell-mode)) - -(flycheck-def-config-file-var flycheck-tidyrc html-tidy ".tidyrc" - :safe #'stringp) - -(flycheck-define-checker html-tidy - "A HTML syntax and style checker using Tidy. - -See URL `https://github.com/w3c/tidy-html5'." - :command ("tidy" (config-file "-config" flycheck-tidyrc) "-e" "-q" source) - :error-patterns - ((error line-start - "line " line - " column " column - " - Error: " (message) line-end) - (warning line-start - "line " line - " column " column - " - Warning: " (message) line-end)) - :modes (html-mode nxhtml-mode)) - -(flycheck-def-config-file-var flycheck-jshintrc javascript-jshint ".jshintrc" - :safe #'stringp) - -(flycheck-define-checker javascript-jshint - "A JavaScript syntax and style checker using jshint. - -See URL `http://www.jshint.com'." - :command ("jshint" "--checkstyle-reporter" - (config-file "--config" flycheck-jshintrc) - source) - :error-parser flycheck-parse-checkstyle - :error-filter flycheck-dequalify-error-ids - :modes (js-mode js2-mode js3-mode)) - -(flycheck-def-option-var flycheck-eslint-rulesdir nil javascript-eslint - "The directory of custom rules for ESLint. - -The value of this variable is either a string containing the path -to a directory with custom rules, or nil, to not give any custom -rules to ESLint. - -Refer to the ESLint manual at URL -`https://github.com/eslint/eslint/tree/master/docs/command-line-interface#--rulesdir' -for more information about the custom directory." - :type '(choice (const :tag "No custom rules directory" nil) - (directory :tag "Custom rules directory")) - :safe #'stringp - :package-version '(flycheck . "0.16")) - -(flycheck-def-config-file-var flycheck-eslintrc javascript-eslint nil - :safe #'stringp - :package-version '(flycheck . "0.20")) - -(flycheck-define-checker javascript-eslint - "A JavaScript syntax and style checker using eslint. - -See URL `https://github.com/eslint/eslint'." - :command ("eslint" "--format=checkstyle" - (config-file "--config" flycheck-eslintrc) - (option "--rulesdir" flycheck-eslint-rulesdir) - ;; We need to use source-inplace because eslint looks for - ;; configuration files in the directory of the file being checked. - ;; See https://github.com/flycheck/flycheck/issues/447 - source-inplace) - :error-parser flycheck-parse-checkstyle - :error-filter (lambda (errors) - (mapc (lambda (err) - ;; Parse error ID from the error message - (setf (flycheck-error-message err) - (replace-regexp-in-string - (rx " (" - (group (one-or-more (not (any ")")))) - ")" string-end) - (lambda (s) - (setf (flycheck-error-id err) - (match-string 1 s)) - "") - (flycheck-error-message err)))) - (flycheck-sanitize-errors errors)) - errors) - :modes (js-mode js2-mode js3-mode)) - -(flycheck-def-config-file-var flycheck-gjslintrc javascript-gjslint ".gjslintrc" - :safe #'stringp) - -(flycheck-define-checker javascript-gjslint - "A JavaScript syntax and style checker using Closure Linter. - -See URL `https://developers.google.com/closure/utilities'." - :command ("gjslint" "--unix_mode" - (config-file "--flagfile" flycheck-gjslintrc) - source) - :error-patterns ((warning - line-start (file-name) ":" line ":(" - (id (one-or-more digit)) ") " (message) line-end)) - :modes (js-mode js2-mode js3-mode)) - -(flycheck-define-checker json-jsonlint - "A JSON syntax and style checker using jsonlint. - -See URL `https://github.com/zaach/jsonlint'." - :command ("jsonlint" "-c" "-q" source) - :error-patterns - ((error line-start - (file-name) - ": line " line - ", col " column ", " - (message) line-end)) - :predicate - (lambda () - (or - (eq major-mode 'json-mode) - (and (buffer-file-name) - (string= (file-name-extension (buffer-file-name)) "json"))))) - -(flycheck-define-checker less - "A LESS syntax checker using lessc. - -At least version 1.4 of lessc is required. - -See URL `http://lesscss.org'." - :command ("lessc" "--lint" "--no-color" - ;; We need `source-inplace' to resolve relative `data-uri' paths, - ;; see https://github.com/flycheck/flycheck/issues/471 - source-inplace) - :error-patterns - ((error line-start (one-or-more word) ":" - (message) - " in " - (file-name) - - " on line " line - ", column " column ":" - line-end)) - :modes less-css-mode) - -(flycheck-define-checker lua - "A Lua syntax checker using the Lua compiler. - -See URL `http://www.lua.org/'." - :command ("luac" "-p" source) - :error-patterns - ((error line-start - ;; Skip the name of the luac executable. We also skip the file name, - ;; because luac is stupid enough as to abbreviate file names in its - ;; output, which for obvious reasons breaks our file name - ;; detection. See https://github.com/flycheck/flycheck/issues/251 - (minimal-match (zero-or-more not-newline)) - ":" line ": " (message) line-end)) - :modes lua-mode) - -(flycheck-define-checker perl - "A Perl syntax checker using the Perl interpreter. - -See URL `http://www.perl.org'." - :command ("perl" "-w" "-c" source) - :error-patterns - ((error line-start (minimal-match (message)) - " at " (file-name) " line " line - (or "." (and ", " (zero-or-more not-newline))) line-end)) - :modes (perl-mode cperl-mode) - :next-checkers (perl-perlcritic)) - -(flycheck-def-option-var flycheck-perlcritic-severity nil perl-perlcritic - "The message severity for Perl Critic. - -The value of this variable is a severity level as integer, for -the `--severity' option to Perl Critic." - :type '(integer :tag "Severity level") - :safe #'integerp - :package-version '(flycheck . "0.18")) - -(define-obsolete-variable-alias 'flycheck-perlcritic-verbosity - 'flycheck-perlcritic-severity "0.22") - -(flycheck-define-checker perl-perlcritic - "A Perl syntax checker using Perl::Critic. - -See URL `https://metacpan.org/pod/Perl::Critic'." - :command ("perlcritic" "--no-color" "--verbose" "%f/%l/%c/%s/%p/%m (%e)\n" - (option "--severity" flycheck-perlcritic-severity nil - flycheck-option-int) - source) - :error-patterns - ((info line-start - (file-name) "/" line "/" column "/" (any "1") "/" - (id (one-or-more (not (any "/")))) "/" (message) - line-end) - (warning line-start - (file-name) "/" line "/" column "/" (any "234") "/" - (id (one-or-more (not (any "/")))) "/" (message) - line-end) - (error line-start - (file-name) "/" line "/" column "/" (any "5") "/" - (id (one-or-more (not (any "/")))) "/" (message) - line-end)) - :modes (cperl-mode perl-mode)) - -(flycheck-define-checker php - "A PHP syntax checker using the PHP command line interpreter. - -See URL `http://php.net/manual/en/features.commandline.php'." - :command ("php" "-l" "-d" "error_reporting=E_ALL" "-d" "display_errors=1" - "-d" "log_errors=0" source) - :error-patterns - ((error line-start (or "Parse" "Fatal" "syntax") " error" (any ":" ",") " " - (message) " in " (file-name) " on line " line line-end)) - :modes (php-mode php+-mode) - :next-checkers ((warning . php-phpmd) - (warning . php-phpcs))) - -(flycheck-def-option-var flycheck-phpmd-rulesets - '("cleancode" "codesize" "controversial" "design" "naming" "unusedcode") - php-phpmd - "The rule sets for PHP Mess Detector. - -Set default rule sets and custom rule set files. - -See section \"Using multiple rule sets\" in the PHP Mess Detector -manual at URL `http://phpmd.org/documentation/index.html'." - :type '(repeat :tag "rule sets" - (string :tag "A filename or rule set")) - :safe #'flycheck-string-list-p) - -(flycheck-define-checker php-phpmd - "A PHP style checker using PHP Mess Detector. - -See URL `http://phpmd.org/'." - :command ("phpmd" source "xml" - (eval (flycheck-option-comma-separated-list - flycheck-phpmd-rulesets))) - :error-parser flycheck-parse-phpmd - :modes (php-mode php+-mode) - :next-checkers (php-phpcs)) - -(flycheck-def-option-var flycheck-phpcs-standard nil php-phpcs - "The coding standard for PHP CodeSniffer. - -When nil, use the default standard from the global PHP -CodeSniffer configuration. When set to a string, pass the string -to PHP CodeSniffer which will interpret it as name as a standard, -or as path to a standard specification." - :type '(choice (const :tag "Default standard" nil) - (string :tag "Standard name or file")) - :safe #'stringp) - -(flycheck-define-checker php-phpcs - "A PHP style checker using PHP_CodeSniffer. - -See URL `http://pear.php.net/package/PHP_CodeSniffer/'." - :command ("phpcs" "--report=checkstyle" - (option "--standard=" flycheck-phpcs-standard concat) - source) - :error-parser flycheck-parse-checkstyle - :modes (php-mode php+-mode)) - -(flycheck-define-checker puppet-parser - "A Puppet DSL syntax checker using puppet's own parser. - -See URL `http://puppetlabs.com/'." - :command ("puppet" "parser" "validate" "--color=false" source) - :error-patterns - ((error line-start - ;; Skip over the path of the Puppet executable - (minimal-match (zero-or-more not-newline)) - ": Could not parse for environment " (one-or-more word) - ": " (message (minimal-match (zero-or-more anything))) - " at " (file-name "/" (zero-or-more not-newline)) ":" line line-end)) - :modes puppet-mode - :next-checkers ((warning . puppet-lint))) - -(flycheck-define-checker puppet-lint - "A Puppet DSL style checker using puppet-lint. - -See URL `http://puppet-lint.com/'." - ;; We must check the original file, because Puppetlint is quite picky on the - ;; names of files and there place in the directory structure, to comply with - ;; Puppet's autoload directory layout. For instance, a class foo::bar is - ;; required to be in a file foo/bar.pp. Any other place, such as a Flycheck - ;; temporary file will cause an error. - :command ("puppet-lint" - "--log-format" "%{path}:%{linenumber}:%{kind}: %{message} (%{check})" - source-original) - :error-patterns - ((warning line-start (file-name) ":" line ":warning: " (message) line-end) - (error line-start (file-name) ":" line ":error: " (message) line-end)) - :modes puppet-mode - ;; Since we check the original file, we can only use this syntax checker if - ;; the buffer is actually linked to a file, and if it is not modified. - :predicate flycheck-buffer-saved-p) - -(flycheck-def-config-file-var flycheck-flake8rc python-flake8 ".flake8rc" - :safe #'stringp) - -(flycheck-def-option-var flycheck-flake8-error-level-alist - '(("^E9.*$" . error) ; Syntax errors from pep8 - ("^F82.*$" . error) ; undefined variables from pyflakes - ("^F83.*$" . error) ; Duplicate arguments from flake8 - ("^N.*$" . info) ; Naming issues from naming - ) - python-flake8 - "An alist mapping flake8 error IDs to Flycheck error levels. - -Each item in this list is a cons cell `(PATTERN . LEVEL)' where -PATTERN is a regular expression matched against the error ID, and -LEVEL is a Flycheck error level symbol. - -Each PATTERN is matched in the order of appearance in this list -against the error ID. If it matches the ID, the level of the -corresponding error is set to LEVEL. An error that is not -matched by any PATTERN defaults to warning level. - -This option exists because flake8 categorises errors by the -underlying tool that produced them (e.g. F for pyflakes messages, -E for pep8 messages, etc.). These categorisations do not map -directly to Flycheck error levels. Hence, this option exists to -allow for a custom mapping. The default value handles all of the -built-in tools of flake8, and naming errors from pep8-naming." - :type '(repeat (cons (regexp :tag "Error ID pattern") - (symbol :tag "Error level"))) - :package-version '(flycheck . "0.22")) - -(flycheck-def-option-var flycheck-flake8-maximum-complexity nil python-flake8 - "The maximum McCabe complexity of methods. - -If nil, do not check the complexity of methods. If set to an -integer, report any complexity greater than the value of this -variable as warning. - -If set to an integer, this variable overrules any similar setting -in the configuration file denoted by `flycheck-flake8rc'." - :type '(choice (const :tag "Do not check McCabe complexity" nil) - (integer :tag "Maximum complexity")) - :safe #'integerp) - -(flycheck-def-option-var flycheck-flake8-maximum-line-length nil python-flake8 - "The maximum length of lines. - -If set to an integer, the value of this variable denotes the -maximum length of lines, overruling any similar setting in the -configuration file denoted by `flycheck-flake8rc'. An error will -be reported for any line longer than the value of this variable. - -If set to nil, use the maximum line length from the configuration -file denoted by `flycheck-flake8rc', or the PEP 8 recommendation -of 79 characters if there is no configuration with this setting." - :type '(choice (const :tag "Default value") - (integer :tag "Maximum line length in characters")) - :safe #'integerp) - -(defun flycheck-flake8-fix-error-level (err) - "Fix the error level of ERR. - -Update the error level of ERR according to -`flycheck-flake8-error-level-alist'." - (pcase-dolist (`(,pattern . ,level) flycheck-flake8-error-level-alist) - (when (string-match-p pattern (flycheck-error-id err)) - (setf (flycheck-error-level err) level))) - err) - -(flycheck-define-checker python-flake8 - "A Python syntax and style checker using Flake8. - -Requires Flake8 2.0 or newer. See URL -`https://pypi.python.org/pypi/flake8'." - :command ("flake8" - (config-file "--config" flycheck-flake8rc) - (option "--max-complexity" flycheck-flake8-maximum-complexity nil - flycheck-option-int) - (option "--max-line-length" flycheck-flake8-maximum-line-length nil - flycheck-option-int) - source) - :error-filter (lambda (errors) - (let ((errors (flycheck-sanitize-errors errors))) - (mapc #'flycheck-flake8-fix-error-level errors) - errors)) - :error-patterns - ((warning line-start - (file-name) ":" line ":" (optional column ":") " " - (id (one-or-more (any alpha)) (one-or-more digit)) " " - (message (one-or-more not-newline)) - line-end)) - :modes python-mode) - -(flycheck-def-config-file-var flycheck-pylintrc python-pylint - ".pylintrc" - :safe #'stringp) - -(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_id}:{msg}" - (config-file "--rcfile" flycheck-pylintrc) - ;; Need `source-inplace' for relative imports (e.g. `from .foo - ;; import bar'), see https://github.com/flycheck/flycheck/issues/280 - source-inplace) - :error-filter - (lambda (errors) - (flycheck-sanitize-errors (flycheck-increment-error-columns errors))) - :error-patterns - ((error line-start (file-name) ":" line ":" column ":" - (or "E" "F") ":" - (id (one-or-more (not (any ":")))) ":" - (message) line-end) - (warning line-start (file-name) ":" line ":" column ":" - (or "W" "R") ":" - (id (one-or-more (not (any ":")))) ":" - (message) line-end) - (info line-start (file-name) ":" line ":" column ":" - "C:" (id (one-or-more (not (any ":")))) ":" - (message) line-end)) - :modes python-mode) - -(flycheck-define-checker python-pycompile - "A Python syntax checker using Python's builtin compiler. - -See URL `https://docs.python.org/3.4/library/py_compile.html'." - :command ("python" "-m" "py_compile" source) - :error-patterns - ;; Python 2.7 - ((error line-start " File \"" (file-name) "\", line " line "\n" - (= 2 (zero-or-more not-newline) "\n") - "SyntaxError: " (message) line-end) - ;; 2.6 - (error line-start "SyntaxError: ('" (message (one-or-more (not (any "'")))) - "', ('" (file-name (one-or-more (not (any "'")))) "', " - line ", " column ", " (one-or-more not-newline) line-end)) - :modes python-mode) - -(flycheck-def-option-var flycheck-lintr-caching t r-lintr - "Whether to enable caching in lintr. - -By default, lintr caches all expressions in a file and re-checks -only those that have changed. Setting this option to nil -disables caching in case there are problems." - :type 'boolean - :safe #'booleanp - :package-version '(flycheck . "0.23")) - -(flycheck-def-option-var flycheck-lintr-linters "default_linters" r-lintr - "Linters to use with lintr. - -The value of this variable is a string containing an R -expression, which selects linters for lintr." - :type 'string - :risky t - :package-version '(flycheck . "0.23")) - -(flycheck-define-checker r-lintr - "An R style and syntax checker using the lintr package. - -See URL `https://github.com/jimhester/lintr'." - :command ("R" "--slave" "--restore" "--no-save" "-e" - (eval (concat - "library(lintr);" - "try(lint(commandArgs(TRUE)" - ", cache=" (if flycheck-lintr-caching "TRUE" "FALSE") - ", " flycheck-lintr-linters - "))")) - "--args" source) - :error-patterns - ((info line-start (file-name) ":" line ":" column ": style: " (message) - line-end) - (warning line-start (file-name) ":" line ":" column ": warning: " (message) - line-end) - (error line-start (file-name) ":" line ":" column ": error: " (message) - line-end)) - :modes ess-mode) - -(flycheck-define-checker racket - "A Racket syntax checker using the Racket compiler. - -See URL `http://racket-lang.org/'." - :command ("racket" "-f" source-inplace) - :error-patterns - ((error line-start (file-name) ":" line ":" column ":" (message) line-end)) - :modes racket-mode) - -(flycheck-define-checker rpm-rpmlint - "A RPM SPEC file syntax checker using rpmlint. - -See URL `http://sourceforge.net/projects/rpmlint/'." - :command ("rpmlint" source) - :error-patterns - ((error line-start - (file-name) ":" (optional line ":") " E: " (message) - line-end) - (warning line-start - (file-name) ":" (optional line ":") " W: " (message) - line-end)) - :error-filter - ;; Add fake line numbers if they are missing in the lint output - (lambda (errors) - (dolist (err errors) - (unless (flycheck-error-line err) - (setf (flycheck-error-line err) 1))) - errors) - :modes (sh-mode rpm-spec-mode) - :predicate (lambda () (or (not (eq major-mode 'sh-mode)) - ;; In `sh-mode', we need the proper shell - (eq sh-shell 'rpm)))) - -(defun flycheck-locate-sphinx-source-directory () - "Locate the Sphinx source directory for the current buffer. - -Return the source directory, or nil, if the current buffer is not -part of a Sphinx project." - (-when-let* ((filename (buffer-file-name)) - (dir (locate-dominating-file filename "conf.py"))) - (expand-file-name dir))) - -(flycheck-define-checker rst - "A ReStructuredText (RST) syntax checker using Docutils. - -See URL `http://docutils.sourceforge.net/'." - ;; We need to use source-inplace to properly resolve relative paths in - ;; include:: directives - :command ("rst2pseudoxml.py" "--report=2" "--halt=5" source-inplace) - :error-patterns - ((warning line-start (file-name) ":" line ": (WARNING/2) " (message) line-end) - (error line-start - (file-name) ":" line - ": (" (or "ERROR/3" "SEVERE/4") ") " - (message) line-end)) - :modes rst-mode - ;; Don't use the generic ReST checker in Sphinx projects, because it'll - ;; produce a lot of false positives. - :predicate (lambda () (not (flycheck-locate-sphinx-source-directory)))) - -(flycheck-def-option-var flycheck-sphinx-warn-on-missing-references t rst-sphinx - "Whether to warn about missing references in Sphinx. - -When non-nil (the default), warn about all missing references in -Sphinx via `-n'." - :type 'boolean - :safe #'booleanp - :package-version '(flycheck . "0.17")) - -(flycheck-define-checker rst-sphinx - "A ReStructuredText (RST) syntax checker using Sphinx. - -Requires Sphinx 1.2 or newer. See URL `http://sphinx-doc.org'." - :command ("sphinx-build" "-b" "pseudoxml" - "-q" "-N" ; Reduced output and no colors - (option-flag "-n" flycheck-sphinx-warn-on-missing-references) - (eval (flycheck-locate-sphinx-source-directory)) - temporary-directory ; Redirect the output to a temporary - ; directory - source-original) ; Sphinx needs the original document - :error-patterns - ((warning line-start (file-name) ":" line ": WARNING: " (message) line-end) - (error line-start - (file-name) ":" line - ": " (or "ERROR" "SEVERE") ": " - (message) line-end)) - :modes rst-mode - :predicate (lambda () (and (flycheck-buffer-saved-p) - (flycheck-locate-sphinx-source-directory)))) - -(flycheck-def-config-file-var flycheck-rubocoprc ruby-rubocop ".rubocop.yml" - :safe #'stringp) - -(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 - :package-version '(flycheck . "0.16")) - -(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) - source) - :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))) - -;; Default to `nil' to let Rubylint find its configuration file by itself, and -;; to maintain backwards compatibility with older Rubylint and Flycheck releases -(flycheck-def-config-file-var flycheck-rubylintrc ruby-rubylint nil - :safe #'stringp) - -(flycheck-define-checker ruby-rubylint - "A Ruby syntax and code analysis checker using ruby-lint. - -Requires ruby-lint 2.0 or newer. To use `flycheck-rubylintrc', -ruby-lint 2.0.2 or newer is required. See URL -`https://github.com/YorickPeterse/ruby-lint'." - :command ("ruby-lint" "--presenter=syntastic" - (config-file "--config" flycheck-rubylintrc) - source) - :error-patterns - ((info line-start - (file-name) ":I:" line ":" column ": " (message) line-end) - (warning line-start - (file-name) ":W:" line ":" column ": " (message) line-end) - (error line-start - (file-name) ":E:" line ":" column ": " (message) line-end)) - :modes (enh-ruby-mode ruby-mode)) - -(flycheck-define-checker ruby - "A Ruby syntax checker using the standard Ruby interpreter. - -Please note that the output of different Ruby versions and -implementations varies wildly. This syntax checker supports -current versions of MRI and JRuby, but may break when used with -other implementations or future versions of these -implementations. - -Please consider using `ruby-rubocop' or `ruby-rubylint' instead. - -See URL `https://www.ruby-lang.org/'." - :command ("ruby" "-w" "-c" source) - :error-patterns - ;; These patterns support output from JRuby, too, to deal with RVM or Rbenv - ((error line-start - "SyntaxError in " (file-name) ":" line ": " (message) - line-end) - (warning line-start - (file-name) ":" line ":" (optional column ":") - " warning: " (message) line-end) - (error line-start (file-name) ":" line ": " (message) line-end)) - :modes (enh-ruby-mode ruby-mode) - :next-checkers ((warning . ruby-rubylint))) - -(flycheck-define-checker ruby-jruby - "A Ruby syntax checker using the JRuby interpreter. - -This syntax checker is very primitive, and may break on future -versions of JRuby. - -Please consider using `ruby-rubocop' or `ruby-rubylint' instead. - -See URL `http://jruby.org/'." - :command ("jruby" "-w" "-c" source) - :error-patterns - ((error line-start - "SyntaxError in " (file-name) ":" line ": " (message) - line-end) - (warning line-start (file-name) ":" line " warning: " (message) line-end) - (error line-start (file-name) ":" line ": " (message) line-end)) - :modes (enh-ruby-mode ruby-mode) - :next-checkers ((warning . ruby-rubylint))) - -(flycheck-def-option-var flycheck-rust-check-tests t rust - "Whether to check test code in Rust. - -When non-nil, `rustc' is passed the `--test' flag, which will -check any code marked with the `#[cfg(test)]' attribute and any -functions marked with `#[test]'. Otherwise, `rustc' is not passed -`--test' and test code will not be checked. Skipping `--test' is -necessary when using `#![no_std]', because compiling the test -runner requires `std'." - :type 'boolean - :safe #'booleanp - :package-version '("flycheck" . "0.19")) - -(flycheck-def-option-var flycheck-rust-crate-root nil rust - "A path to the crate root for the current buffer. - -The value of this variable is either a string with the path to -the crate root for the current buffer, or nil if the current buffer -is a crate. A relative path is relative to the current buffer. - -If this variable is non nil the current buffer will only be checked -if it is not modified, i.e. after it has been saved." - :type 'string - :package-version '(flycheck . "0.20") - :safe #'stringp) -(make-variable-buffer-local 'flycheck-rust-crate-root) - -(flycheck-def-option-var flycheck-rust-crate-type "lib" rust - "The type of the Rust Crate to check. - -The value of this variable is a string denoting the crate type, -for the `--crate-type' flag." - :type 'string - :safe #'stringp - :package-version '("flycheck" . "0.20")) -(make-variable-buffer-local 'flycheck-rust-crate-type) - -(flycheck-def-option-var flycheck-rust-library-path nil rust - "A list of library directories for Rust. - -The value of this variable is a list of strings, where each -string is a directory to add to the library path of Rust. -Relative paths are relative to the file being checked." - :type '(repeat (directory :tag "Library directory")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.18")) - -(flycheck-define-checker rust - "A Rust syntax checker using Rust compiler. - -This syntax checker needs Rust 1.0.0 alpha or newer. - -See URL `http://www.rust-lang.org'." - :command ("rustc" "-Z" "no-trans" - (option "--crate-type" flycheck-rust-crate-type) - (option-flag "--test" flycheck-rust-check-tests) - (option-list "-L" flycheck-rust-library-path concat) - (eval (or flycheck-rust-crate-root - (flycheck-substitute-argument 'source-inplace 'rust)))) - :error-patterns - ((error line-start (file-name) ":" line ":" column ": " - (one-or-more digit) ":" (one-or-more digit) " error: " - (message) line-end) - (warning line-start (file-name) ":" line ":" column ": " - (one-or-more digit) ":" (one-or-more digit) " warning: " - (message) line-end) - (info line-start (file-name) ":" line ":" column ": " - (one-or-more digit) ":" (one-or-more digit) " " (or "note" "help") ": " - (message) line-end)) - :modes rust-mode - :predicate (lambda () - (or (not flycheck-rust-crate-root) (flycheck-buffer-saved-p)))) - -(defvar flycheck-sass-scss-cache-directory nil - "The cache directory for `sass' and `scss'.") - -(defun flycheck-sass-scss-cache-location () - "Get the cache location for `sass' and `scss'. - -If no cache directory exists yet, create one and return it. -Otherwise return the previously used cache directory." - (setq flycheck-sass-scss-cache-directory - (or flycheck-sass-scss-cache-directory - (make-temp-file "flycheck-sass-scss-cache" 'directory)))) - -(flycheck-def-option-var flycheck-sass-compass nil sass - "Whether to enable the Compass CSS framework. - -When non-nil, enable the Compass CSS framework, via `--compass'." - :type 'boolean - :safe #'booleanp - :package-version '(flycheck . "0.16")) - -(flycheck-define-checker sass - "A Sass syntax checker using the Sass compiler. - -See URL `http://sass-lang.com'." - :command ("sass" - "--cache-location" (eval (flycheck-sass-scss-cache-location)) - (option-flag "--compass" flycheck-sass-compass) - "-c" source) - :error-patterns - ((error line-start "Syntax error on line " line ": " (message)) - (warning line-start "WARNING on line " line " of " (file-name) - ":" (optional "\r") "\n" (message) line-end) - (error line-start - (or "Syntax error: " "Error: ") - (message (one-or-more not-newline) - (zero-or-more "\n" - (one-or-more " ") - (one-or-more not-newline))) - (optional "\r") "\n on line " line " of " (file-name) - line-end)) - :modes sass-mode) - -(flycheck-define-checker scala - "A Scala syntax checker using the Scala compiler. - -See URL `http://www.scala-lang.org/'." - :command ("scalac" "-Ystop-after:parser" source) - :error-patterns - ((error line-start (file-name) ":" line ": error: " (message) line-end)) - :modes scala-mode - :next-checkers ((warning . scala-scalastyle))) - -(flycheck-def-config-file-var flycheck-scalastylerc scala-scalastyle nil - :safe #'stringp - :package-version '(flycheck . "0.20")) - -(flycheck-def-option-var flycheck-scalastyle-jar nil scala-scalastyle - "The path to the main JAR file of Scalastyle. - -If this option is nil, or points to a non-existing file, -`scala-scalastyle' can not be used." - :type '(file :must-match t) - :safe #'stringp - :package-version '(flycheck . "0.20")) - -(flycheck-define-checker scala-scalastyle - "A Scala style checker using scalastyle. - -Note that this syntax checker is not used if -`flycheck-scalastyle-jar' or `flycheck-scalastylerc' are nil or -point to non-existing files. - -See URL `http://www.scalastyle.org'." - :command ("java" - (option "-jar" flycheck-scalastyle-jar) - (config-file "-c" flycheck-scalastylerc) - source) - :error-patterns - ((error line-start "error file=" (file-name) " message=" - (message) " line=" line (optional " column=" column) line-end) - (warning line-start "warning file=" (file-name) " message=" - (message) " line=" line (optional " column=" column) line-end)) - :modes scala-mode - :predicate - ;; Inhibit this syntax checker if the JAR or the configuration are unset or - ;; missing - (lambda () (and flycheck-scalastyle-jar flycheck-scalastylerc - (file-exists-p flycheck-scalastyle-jar) - (file-exists-p (flycheck-locate-config-file - flycheck-scalastylerc 'scala-scalastyle))))) - -(flycheck-def-option-var flycheck-scss-compass nil scss - "Whether to enable the Compass CSS framework. - -When non-nil, enable the Compass CSS framework, via `--compass'." - :type 'boolean - :safe #'booleanp - :package-version '(flycheck . "0.16")) - -(flycheck-define-checker scss - "A SCSS syntax checker using the SCSS compiler. - -See URL `http://sass-lang.com'." - :command ("scss" - "--cache-location" (eval (flycheck-sass-scss-cache-location)) - (option-flag "--compass" flycheck-scss-compass) - "-c" source) - :error-patterns - ((error line-start "Syntax error on line " line ": " (message)) - (warning line-start "WARNING on line " line " of " (file-name) - ":" (optional "\r") "\n" (message) line-end) - (error line-start - (or "Syntax error: " "Error: ") - (message (one-or-more not-newline) - (zero-or-more "\n" - (one-or-more " ") - (one-or-more not-newline))) - (optional "\r") "\n" (one-or-more " ") "on line " line " of " (file-name) - line-end)) - :modes scss-mode) - -(flycheck-define-checker sh-bash - "A Bash syntax checker using the Bash shell. - -See URL `http://www.gnu.org/software/bash/'." - :command ("bash" "--norc" "-n" "--" source) - :error-patterns ((error line-start - (file-name) ":" (one-or-more (not (any digit))) - line (zero-or-more " ") ":" (zero-or-more " ") - (message) line-end)) - :modes sh-mode - :predicate (lambda () (eq sh-shell 'bash)) - :next-checkers ((warning . sh-shellcheck))) - -(flycheck-define-checker sh-posix-dash - "A POSIX Shell syntax checker using the Dash shell. - -See URL `http://gondor.apana.org.au/~herbert/dash/'." - :command ("dash" "-n" source) - :error-patterns - ((error line-start (file-name) ": " line ": " (backref 1) ": " (message))) - :modes sh-mode - :predicate (lambda () (eq sh-shell 'sh)) - :next-checkers ((warning . sh-shellcheck))) - -(flycheck-define-checker sh-posix-bash - "A POSIX Shell syntax checker using the Bash shell. - -See URL `http://www.gnu.org/software/bash/'." - :command ("bash" "--posix" "--norc" "-n" "--" source) - :error-patterns - ((error line-start - (file-name) ":" (one-or-more (not (any digit))) - line (zero-or-more " ") ":" (zero-or-more " ") - (message) line-end)) - :modes sh-mode - :predicate (lambda () (eq sh-shell 'sh)) - :next-checkers ((warning . sh-shellcheck))) - -(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)) - :next-checkers ((warning . sh-shellcheck))) - -(defconst flycheck-shellcheck-supported-shells '(bash ksh88 sh zsh) - "Shells supported by ShellCheck.") - -(flycheck-def-option-var flycheck-shellcheck-excluded-warnings nil sh-shellcheck - "A list of excluded warnings for ShellCheck. - -The value of this variable is a list of strings, where each -string is a warning code to be excluded from ShellCheck reports. -By default, no warnings are excluded." - :type '(repeat :tag "Excluded warnings" - (string :tag "Warning code")) - :safe #'flycheck-string-list-p - :package-version '(flycheck . "0.21")) - -(flycheck-define-checker sh-shellcheck - "A shell script syntax and style checker using Shellcheck. - -See URL `https://github.com/koalaman/shellcheck/'." - :command ("shellcheck" - "--format" "checkstyle" - "--shell" (eval (symbol-name sh-shell)) - (option "--exclude" flycheck-shellcheck-excluded-warnings list - flycheck-option-comma-separated-list) - source) - :error-parser flycheck-parse-checkstyle - :error-filter flycheck-dequalify-error-ids - :modes sh-mode - :predicate (lambda () (memq sh-shell flycheck-shellcheck-supported-shells))) - -(flycheck-define-checker slim - "A Slim syntax checker using the Slim compiler. - -See URL `http://slim-lang.com'." - :command ("slimrb" "-c" source) - :error-patterns - ((error line-start - "Slim::Parser::SyntaxError:" (message) (optional "\r") "\n " - (file-name) ", Line " line (optional ", Column " column) - line-end)) - :modes slim-mode) - -(flycheck-def-config-file-var flycheck-chktexrc tex-chktex ".chktexrc" - :safe #'stringp) - -(flycheck-define-checker tex-chktex - "A TeX and LaTeX syntax and style checker using chktex. - -See URL `http://www.nongnu.org/chktex/'." - :command ("chktex" (config-file "-l" flycheck-chktexrc) "-v0" "-q" "-I" - source-inplace) - :error-patterns - ((warning line-start (file-name) ":" line ":" column ":" - (id (one-or-more digit)) ":" (message) line-end)) - :error-filter - (lambda (errors) - (flycheck-sanitize-errors (flycheck-increment-error-columns errors))) - :modes (latex-mode plain-tex-mode)) - -(flycheck-define-checker tex-lacheck - "A LaTeX syntax and style checker using lacheck. - -See URL `http://www.ctan.org/pkg/lacheck'." - :command ("lacheck" source-inplace) - :error-patterns - ((warning line-start - "\"" (file-name) "\", line " line ": " (message) - line-end)) - :modes latex-mode) - -(flycheck-define-checker texinfo - "A Texinfo syntax checker using makeinfo. - -See URL `http://www.gnu.org/software/texinfo/'." - :command ("makeinfo" "-o" null-device source-inplace) - :error-patterns - ((warning line-start (file-name) ":" - line (optional ":" column) ": " - "warning: " (message) line-end) - (error line-start (file-name) ":" - line (optional ":" column) ": " - (message) line-end)) - :modes texinfo-mode) - -(flycheck-define-checker verilog-verilator - "A Verilog syntax checker using the Verilator Verilog HDL simulator. - -See URL `http://www.veripool.org/wiki/verilator'." - :command ("verilator" "--lint-only" "-Wall" source) - :error-patterns - ((warning line-start "%Warning-" (zero-or-more not-newline) ": " - (file-name) ":" line ": " (message) line-end) - (error line-start "%Error: " (file-name) ":" - line ": " (message) line-end)) - :modes verilog-mode) - -(flycheck-define-checker xml-xmlstarlet - "A XML syntax checker and validator using the xmlstarlet utility. - -See URL `http://xmlstar.sourceforge.net/'." - :command ("xmlstarlet" "val" "-e" "-q" source) - :error-patterns - ((error line-start (file-name) ":" line "." column ": " (message) line-end)) - :modes (xml-mode nxml-mode)) - -(flycheck-define-checker xml-xmllint - "A XML syntax checker and validator using the xmllint utility. - -The xmllint is part of libxml2, see URL -`http://www.xmlsoft.org/'." - :command ("xmllint" "--noout" source) - :error-patterns - ((error line-start (file-name) ":" line ": " (message) line-end)) - :modes (xml-mode nxml-mode)) - -(flycheck-define-checker yaml-jsyaml - "A YAML syntax checker using JS-YAML. - -See URL `https://github.com/nodeca/js-yaml'." - :command ("js-yaml" source) - :error-patterns - ((error line-start - "JS-YAML: " (message) " at line " line ", column " column ":" - line-end)) - :modes yaml-mode) - -(flycheck-define-checker yaml-ruby - "A YAML syntax checker using Ruby's YAML parser. - -This syntax checker uses the YAML parser from Ruby's standard -library. - -See URL `http://www.ruby-doc.org/stdlib-2.0.0/libdoc/yaml/rdoc/YAML.html'." - :command ("ruby" "-ryaml" "-e" "begin; - file_name = ARGV[0]; \ - YAML.load(ARGF); \ - rescue Exception => e; \ - STDERR.puts \"#{file_name}:#{e}\"; \ - end" source) - :error-patterns - (;; Syck (Ruby <= 1.9.2, unmaintained) - (error line-start (file-name) - ":syntax error on line " line ", col " column ": `" (message) "'" line-end) - ;; Psych (Ruby >= 1.9.3) - (error line-start (file-name) ":" (zero-or-more not-newline) ":" (message) - "at line " line " column " column line-end)) - :modes yaml-mode) - -(provide 'flycheck) - -;; Local Variables: -;; coding: utf-8 -;; indent-tabs-mode: nil -;; End: - -;;; flycheck.el ends here diff --git a/elpa/flycheck-20150125.601/flycheck.info b/elpa/flycheck-20150125.601/flycheck.info deleted file mode 100644 index 8819b135..00000000 --- a/elpa/flycheck-20150125.601/flycheck.info +++ /dev/null @@ -1,2183 +0,0 @@ -This is flycheck.info, produced by makeinfo version 5.2 from -flycheck.texi. - -This manual is for Flycheck version 0.23-cvs. - -Copyright © 2014-2015 Sebastian Wiesner - - Permission is granted to copy, distribute and/or modify this - documentation 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.”. - - 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 - . - -INFO-DIR-SECTION Emacs -START-INFO-DIR-ENTRY -* flycheck: (flycheck.info). On the fly syntax checking for GNU Emacs -END-INFO-DIR-ENTRY - - - Generated by Sphinx 1.2.3. - - -Indirect: -flycheck.info-1: 1040 -flycheck.info-2: 301299 - -Tag Table: -(Indirect) -Node: Top1040 -Ref: index doc1924 -Ref: 01924 -Node: Introduction10527 -Ref: guide/introduction introduction10625 -Ref: 110625 -Ref: guide/introduction doc10625 -Ref: 210625 -Node: Features11067 -Ref: guide/introduction features11155 -Ref: 311155 -Ref: guide/introduction id111155 -Ref: 411155 -Node: 3rd party extensions11633 -Ref: guide/introduction rd-party-extensions11721 -Ref: b11721 -Ref: guide/introduction id211721 -Ref: c11721 -Ref: 3rd party extensions-Footnote-113145 -Ref: 3rd party extensions-Footnote-213195 -Ref: 3rd party extensions-Footnote-313232 -Ref: 3rd party extensions-Footnote-413293 -Ref: 3rd party extensions-Footnote-513349 -Ref: 3rd party extensions-Footnote-613409 -Ref: 3rd party extensions-Footnote-713462 -Ref: 3rd party extensions-Footnote-813517 -Ref: 3rd party extensions-Footnote-913560 -Ref: 3rd party extensions-Footnote-1013610 -Ref: 3rd party extensions-Footnote-1113657 -Ref: 3rd party extensions-Footnote-1213709 -Ref: 3rd party extensions-Footnote-1313741 -Ref: 3rd party extensions-Footnote-1413795 -Ref: 3rd party extensions-Footnote-1513828 -Ref: 3rd party extensions-Footnote-1613880 -Ref: 3rd party extensions-Footnote-1713934 -Ref: 3rd party extensions-Footnote-1813988 -Node: Flycheck versus Flymake14039 -Ref: guide/flycheck-versus-flymake flycheck-versus-flymake14146 -Ref: d14146 -Ref: guide/flycheck-versus-flymake doc14146 -Ref: e14146 -Ref: guide/flycheck-versus-flymake flycheck-rust14146 -Ref: f14146 -Ref: guide/flycheck-versus-flymake id114146 -Ref: 1014146 -Ref: Flycheck versus Flymake-Footnote-114918 -Ref: Flycheck versus Flymake-Footnote-214968 -Ref: Flycheck versus Flymake-Footnote-315016 -Node: Overview15073 -Ref: guide/flycheck-versus-flymake overview15167 -Ref: 1115167 -Ref: Overview-Footnote-121229 -Ref: Overview-Footnote-221290 -Ref: Overview-Footnote-321421 -Ref: Overview-Footnote-421534 -Ref: Overview-Footnote-521959 -Ref: Overview-Footnote-622117 -Ref: Overview-Footnote-722218 -Ref: Overview-Footnote-822368 -Ref: Overview-Footnote-922520 -Node: Detailed review22672 -Ref: guide/flycheck-versus-flymake detailed-review22766 -Ref: 1222766 -Node: Relation to Emacs23138 -Ref: guide/flycheck-versus-flymake relation-to-emacs23242 -Ref: 1323242 -Ref: Relation to Emacs-Footnote-123825 -Node: Enabling syntax checking23870 -Ref: guide/flycheck-versus-flymake enabling-syntax-checking23998 -Ref: 1423998 -Ref: Enabling syntax checking-Footnote-125202 -Node: Syntax checkers25250 -Ref: guide/flycheck-versus-flymake syntax-checkers25389 -Ref: 1625389 -Node: Built-in syntax checkers25513 -Ref: guide/flycheck-versus-flymake built-in-syntax-checkers25633 -Ref: 1725633 -Ref: Built-in syntax checkers-Footnote-126301 -Ref: Built-in syntax checkers-Footnote-226351 -Ref: Built-in syntax checkers-Footnote-326398 -Node: Definition of new syntax checkers26424 -Ref: guide/flycheck-versus-flymake definition-of-new-syntax-checkers26544 -Ref: 1826544 -Ref: Definition of new syntax checkers-Footnote-128812 -Ref: Definition of new syntax checkers-Footnote-228860 -Node: Functions as syntax checkers28959 -Ref: guide/flycheck-versus-flymake functions-as-syntax-checkers29106 -Ref: 1a29106 -Ref: Functions as syntax checkers-Footnote-129820 -Ref: Functions as syntax checkers-Footnote-229871 -Node: Customization of syntax checkers29923 -Ref: guide/flycheck-versus-flymake customization-of-syntax-checkers30079 -Ref: 1c30079 -Node: Executables of syntax checkers30869 -Ref: guide/flycheck-versus-flymake executables-of-syntax-checkers30970 -Ref: 1e30970 -Node: Syntax checker selection31377 -Ref: guide/flycheck-versus-flymake syntax-checker-selection31517 -Ref: 2031517 -Node: Custom predicates32337 -Ref: guide/flycheck-versus-flymake custom-predicates32442 -Ref: 2132442 -Ref: Custom predicates-Footnote-133373 -Node: Manual selection33421 -Ref: guide/flycheck-versus-flymake manual-selection33570 -Ref: 2233570 -Node: Multiple syntax checkers per buffer33960 -Ref: guide/flycheck-versus-flymake multiple-syntax-checkers-per-buffer34083 -Ref: 2534083 -Node: Error levels34877 -Ref: guide/flycheck-versus-flymake error-levels35002 -Ref: 2635002 -Ref: Error levels-Footnote-135764 -Node: Error identifiers35814 -Ref: guide/flycheck-versus-flymake error-identifiers35928 -Ref: 2835928 -Node: Error parsing36367 -Ref: guide/flycheck-versus-flymake error-parsing36490 -Ref: 2936490 -Ref: Error parsing-Footnote-137471 -Node: Error message display37519 -Ref: guide/flycheck-versus-flymake error-message-display37635 -Ref: 2a37635 -Ref: Error message display-Footnote-138302 -Node: Error list38359 -Ref: guide/flycheck-versus-flymake error-list38482 -Ref: 2c38482 -Node: Resource consumption38761 -Ref: guide/flycheck-versus-flymake resource-consumption38873 -Ref: 2d38873 -Node: Syntax checking38987 -Ref: guide/flycheck-versus-flymake syntax-checking39090 -Ref: 2e39090 -Ref: Syntax checking-Footnote-139975 -Node: Checking for changes40025 -Ref: guide/flycheck-versus-flymake checking-for-changes40128 -Ref: 2f40128 -Ref: Checking for changes-Footnote-141090 -Node: Unit tests41140 -Ref: guide/flycheck-versus-flymake unit-tests41233 -Ref: 3041233 -Ref: Unit tests-Footnote-141580 -Node: Installation41628 -Ref: guide/installation installation41733 -Ref: 3141733 -Ref: guide/installation merlin41733 -Ref: 3241733 -Ref: guide/installation doc41733 -Ref: 3341733 -Ref: guide/installation id141733 -Ref: 3441733 -Node: Prerequisites41830 -Ref: guide/installation prerequisites41923 -Ref: 3541923 -Node: Emacs42030 -Ref: guide/installation emacs42112 -Ref: 3642112 -Node: Operating system42551 -Ref: guide/installation operating-system42663 -Ref: 3742663 -Node: Syntax checking tools43249 -Ref: guide/installation syntax-checking-tools43347 -Ref: 3843347 -Ref: Syntax checking tools-Footnote-144253 -Ref: Syntax checking tools-Footnote-244293 -Ref: Syntax checking tools-Footnote-344324 -Node: Package installation44348 -Ref: guide/installation homebrew44455 -Ref: 3b44455 -Ref: guide/installation package-installation44455 -Ref: 3c44455 -Node: Manual44538 -Ref: guide/installation manual44616 -Ref: 3d44616 -Ref: Manual-Footnote-145334 -Ref: Manual-Footnote-245359 -Ref: Manual-Footnote-345391 -Node: Cask45427 -Ref: guide/installation cask45505 -Ref: 3e45505 -Node: Setup45701 -Ref: guide/installation setup45786 -Ref: 3f45786 -Node: Quickstart46101 -Ref: guide/quickstart marmalade46188 -Ref: 4046188 -Ref: guide/quickstart doc46188 -Ref: 4146188 -Ref: guide/quickstart quickstart46188 -Ref: 4246188 -Node: Enable Flycheck46388 -Ref: guide/quickstart enable-flycheck46494 -Ref: 4346494 -Node: Install some syntax checker tools46684 -Ref: guide/quickstart install-some-syntax-checker-tools46823 -Ref: 4446823 -Node: Check syntax in a buffer47475 -Ref: guide/quickstart check-syntax-in-a-buffer47623 -Ref: 4647623 -Node: Navigate and list errors48224 -Ref: guide/quickstart navigate-and-list-errors48355 -Ref: 4848355 -Node: Explore the menu49066 -Ref: guide/quickstart explore-the-menu49188 -Ref: 4c49188 -Node: Further reading49460 -Ref: guide/quickstart further-reading49549 -Ref: 4d49549 -Node: Usage49807 -Ref: guide/usage usage49901 -Ref: 949901 -Ref: guide/usage doc49901 -Ref: 4e49901 -Ref: guide/usage id149901 -Ref: 4f49901 -Ref: guide/usage el variable flycheck-keymap-prefix50269 -Ref: 5050269 -Node: Enabling syntax checking<2>51488 -Ref: guide/usage enabling-syntax-checking51584 -Ref: 5151584 -Ref: guide/usage id251584 -Ref: 5251584 -Ref: guide/usage el function global-flycheck-mode51734 -Ref: 1551734 -Ref: guide/usage el variable global-flycheck-mode52412 -Ref: 5552412 -Ref: guide/usage el function flycheck-mode52928 -Ref: 5452928 -Ref: guide/usage el variable flycheck-mode53012 -Ref: 5653012 -Node: Checking buffers53117 -Ref: guide/usage id353247 -Ref: 5753247 -Ref: guide/usage checking-buffers53247 -Ref: 653247 -Ref: guide/usage el variable flycheck-check-syntax-automatically53666 -Ref: 5953666 -Ref: guide/usage el variable flycheck-idle-change-delay55056 -Ref: 5855056 -Ref: guide/usage el function flycheck-buffer55864 -Ref: 4755864 -Ref: guide/usage el function flycheck-verify-setup56181 -Ref: 5a56181 -Ref: guide/usage el variable flycheck-temp-prefix56657 -Ref: 5b56657 -Node: Selecting syntax checkers56973 -Ref: guide/usage id457103 -Ref: 5c57103 -Ref: guide/usage selecting-syntax-checkers57103 -Ref: 5d57103 -Ref: guide/usage el variable flycheck-checkers57283 -Ref: 5e57283 -Ref: guide/usage el variable flycheck-disabled-checkers58309 -Ref: 5f58309 -Ref: guide/usage el function flycheck-select-checker60173 -Ref: 2460173 -Ref: guide/usage el variable flycheck-completion-system61724 -Ref: 6561724 -Ref: guide/usage el variable flycheck-checker63139 -Ref: 2363139 -Ref: guide/usage el function flycheck-describe-checker64591 -Ref: 3a64591 -Ref: Selecting syntax checkers-Footnote-164722 -Ref: Selecting syntax checkers-Footnote-264760 -Node: Configuring syntax checkers64801 -Ref: guide/usage configuring-syntax-checkers64930 -Ref: 864930 -Ref: guide/usage id564930 -Ref: 6764930 -Node: Syntax checker executables65105 -Ref: guide/usage id665228 -Ref: 6865228 -Ref: guide/usage syntax-checker-executables65228 -Ref: 6965228 -Ref: guide/usage el function flycheck-set-checker-executable66017 -Ref: 1f66017 -Node: Syntax checker options66486 -Ref: guide/usage id766652 -Ref: 6a66652 -Ref: guide/usage syntax-checker-options66652 -Ref: 4566652 -Node: Syntax checker configuration files67194 -Ref: guide/usage syntax-checker-configuration-files67325 -Ref: 6b67325 -Ref: guide/usage id867325 -Ref: 6c67325 -Ref: guide/usage el variable flycheck-locate-config-file-functions68066 -Ref: 6d68066 -Node: Error reporting69467 -Ref: guide/usage error-reporting69585 -Ref: 769585 -Ref: guide/usage id969585 -Ref: 6e69585 -Ref: guide/usage el variable flycheck-checker-error-threshold70256 -Ref: 7170256 -Ref: guide/usage el variable flycheck-highlighting-mode71156 -Ref: 6f71156 -Ref: guide/usage el face flycheck-error72433 -Ref: 7272433 -Ref: guide/usage el face flycheck-warning72459 -Ref: 7372459 -Ref: guide/usage el face flycheck-info72487 -Ref: 7472487 -Ref: guide/usage el variable flycheck-indication-mode73107 -Ref: 7073107 -Ref: guide/usage el face flycheck-fringe-error73785 -Ref: 7573785 -Ref: guide/usage el face flycheck-fringe-warning73818 -Ref: 7673818 -Ref: guide/usage el face flycheck-fringe-info73853 -Ref: 7773853 -Ref: guide/usage el variable flycheck-display-errors-delay74227 -Ref: 7874227 -Ref: guide/usage el variable flycheck-display-errors-function74855 -Ref: 2b74855 -Ref: guide/usage el function flycheck-display-error-messages75343 -Ref: 7975343 -Ref: guide/usage el function flycheck-display-error-messages-unless-error-list75900 -Ref: 7a75900 -Ref: guide/usage el function flycheck-clear76714 -Ref: 7c76714 -Ref: Error reporting-Footnote-176962 -Ref: Error reporting-Footnote-277013 -Ref: Error reporting-Footnote-377062 -Node: Listing errors77115 -Ref: guide/usage id1077228 -Ref: 7d77228 -Ref: guide/usage listing-errors77228 -Ref: 7b77228 -Ref: guide/usage el function flycheck-list-errors77392 -Ref: 4b77392 -Ref: guide/usage el variable flycheck-error-list-after-refresh-hook77845 -Ref: 7e77845 -Ref: guide/usage el face flycheck-error-list-highlight78498 -Ref: 7f78498 -Ref: guide/usage el face flycheck-error-list-line-number78808 -Ref: 8078808 -Ref: guide/usage el face flycheck-error-list-column-number79011 -Ref: 8179011 -Ref: guide/usage el face flycheck-error-list-checker-name79216 -Ref: 8279216 -Node: Copying killing errors79431 -Ref: guide/usage killing-errors79561 -Ref: 8379561 -Ref: guide/usage copying-killing-errors79561 -Ref: 8479561 -Ref: guide/usage el function flycheck-copy-errors-as-kill79753 -Ref: 8579753 -Node: Navigating and jumping to errors80481 -Ref: guide/usage navigating-errors80616 -Ref: 8680616 -Ref: guide/usage navigating-and-jumping-to-errors80616 -Ref: 8780616 -Ref: guide/usage el variable flycheck-standard-error-navigation81414 -Ref: 8881414 -Ref: guide/usage el function flycheck-next-error82684 -Ref: 4982684 -Ref: guide/usage el function flycheck-previous-error82966 -Ref: 4a82966 -Ref: guide/usage el function flycheck-first-error83244 -Ref: 8983244 -Ref: guide/usage el variable flycheck-navigation-minimum-level83828 -Ref: 8a83828 -Node: Mode line reporting84358 -Ref: guide/usage id1184462 -Ref: 8c84462 -Ref: guide/usage mode-line-reporting84462 -Ref: 6384462 -Ref: guide/usage el variable flycheck-mode-line85476 -Ref: 8e85476 -Ref: Mode line reporting-Footnote-186896 -Node: Supported languages86957 -Ref: guide/languages flycheck-color-mode-line87049 -Ref: 9387049 -Ref: guide/languages id187049 -Ref: 9487049 -Ref: guide/languages doc87049 -Ref: 3987049 -Ref: guide/languages supported-languages87049 -Ref: 587049 -Ref: Supported languages-Footnote-188288 -Ref: Supported languages-Footnote-288339 -Ref: Supported languages-Footnote-388370 -Ref: Supported languages-Footnote-488423 -Ref: Supported languages-Footnote-588455 -Ref: Supported languages-Footnote-688506 -Node: Ada88558 -Ref: guide/languages ada88636 -Ref: 9588636 -Ref: guide/languages el flycheck-checker ada-gnat88653 -Ref: 9688653 -Ref: guide/languages el variable flycheck-gnat-args88868 -Ref: 9788868 -Ref: guide/languages el variable flycheck-gnat-include-path89298 -Ref: 9889298 -Ref: guide/languages el variable flycheck-gnat-language-standard89996 -Ref: 9a89996 -Ref: guide/languages el variable flycheck-gnat-warnings90689 -Ref: 9b90689 -Ref: Ada-Footnote-191574 -Node: AsciiDoc91627 -Ref: guide/languages asciidoc91719 -Ref: 9c91719 -Ref: guide/languages el flycheck-checker asciidoc91746 -Ref: 9d91746 -Ref: AsciiDoc-Footnote-191940 -Node: C/C++91982 -Ref: guide/languages c-c92079 -Ref: 9e92079 -Ref: guide/languages el flycheck-checker c/c++-clang92100 -Ref: 9f92100 -Ref: guide/languages el variable flycheck-clang-args92547 -Ref: a292547 -Ref: guide/languages el variable flycheck-clang-blocks92984 -Ref: a392984 -Ref: guide/languages el variable flycheck-clang-definitions93637 -Ref: a493637 -Ref: guide/languages el variable flycheck-clang-include-path94313 -Ref: a594313 -Ref: guide/languages el variable flycheck-clang-includes95018 -Ref: a695018 -Ref: guide/languages el variable flycheck-clang-language-standard95718 -Ref: a795718 -Ref: guide/languages el variable flycheck-clang-ms-extensions96463 -Ref: a896463 -Ref: guide/languages el variable flycheck-clang-no-exceptions97064 -Ref: a997064 -Ref: guide/languages el variable flycheck-clang-no-rtti97648 -Ref: aa97648 -Ref: guide/languages el variable flycheck-clang-standard-library98198 -Ref: ab98198 -Ref: guide/languages el variable flycheck-clang-warnings98984 -Ref: 1d98984 -Ref: guide/languages el flycheck-checker c/c++-gcc99926 -Ref: ac99926 -Ref: guide/languages el variable flycheck-gcc-args100395 -Ref: ad100395 -Ref: guide/languages el variable flycheck-gcc-definitions100826 -Ref: ae100826 -Ref: guide/languages el variable flycheck-gcc-include-path101494 -Ref: af101494 -Ref: guide/languages el variable flycheck-gcc-includes102191 -Ref: b0102191 -Ref: guide/languages el variable flycheck-gcc-language-standard102885 -Ref: b1102885 -Ref: guide/languages el variable flycheck-gcc-no-exceptions103624 -Ref: b2103624 -Ref: guide/languages el variable flycheck-gcc-no-rtti104202 -Ref: b3104202 -Ref: guide/languages el variable flycheck-gcc-openmp104746 -Ref: b4104746 -Ref: guide/languages el variable flycheck-gcc-warnings105302 -Ref: b5105302 -Ref: guide/languages el flycheck-checker c/c++-cppcheck106228 -Ref: a1106228 -Ref: guide/languages el variable flycheck-cppcheck-checks106396 -Ref: b6106396 -Ref: guide/languages el variable flycheck-cppcheck-inconclusive107344 -Ref: b7107344 -Ref: C/C++-Footnote-1108373 -Ref: C/C++-Footnote-2108404 -Ref: C/C++-Footnote-3108462 -Ref: C/C++-Footnote-4108514 -Ref: C/C++-Footnote-5108566 -Ref: C/C++-Footnote-6108595 -Ref: C/C++-Footnote-7108639 -Ref: C/C++-Footnote-8108680 -Ref: C/C++-Footnote-9108731 -Ref: C/C++-Footnote-10108781 -Ref: C/C++-Footnote-11108828 -Node: CFEngine108889 -Ref: guide/languages cfengine108982 -Ref: b8108982 -Ref: guide/languages flycheck-google-cpplint108982 -Ref: b9108982 -Ref: guide/languages el flycheck-checker cfengine109009 -Ref: ba109009 -Ref: CFEngine-Footnote-1109180 -Node: Chef109209 -Ref: guide/languages chef109309 -Ref: bb109309 -Ref: guide/languages el flycheck-checker chef-foodcritic109356 -Ref: bc109356 -Ref: Chef-Footnote-1109554 -Ref: Chef-Footnote-2109592 -Node: Coffeescript109635 -Ref: guide/languages coffeescript109730 -Ref: bd109730 -Ref: guide/languages id3109730 -Ref: be109730 -Ref: guide/languages el flycheck-checker coffee109765 -Ref: bf109765 -Ref: guide/languages el flycheck-checker coffee-coffeelint110192 -Ref: c0110192 -Ref: guide/languages el variable flycheck-coffeelintrc110454 -Ref: c1110454 -Ref: Coffeescript-Footnote-1110763 -Ref: Coffeescript-Footnote-2110796 -Node: Coq110831 -Ref: guide/languages coq110925 -Ref: c2110925 -Ref: guide/languages el flycheck-checker coq110942 -Ref: c3110942 -Ref: Coq-Footnote-1111108 -Node: CSS111137 -Ref: guide/languages css111220 -Ref: c4111220 -Ref: guide/languages el flycheck-checker css-csslint111237 -Ref: c5111237 -Ref: CSS-Footnote-1111427 -Node: D111470 -Ref: guide/languages d111556 -Ref: c6111556 -Ref: guide/languages el flycheck-checker d-dmd111569 -Ref: c7111569 -Ref: guide/languages el variable flycheck-dmd-include-path111754 -Ref: c8111754 -Ref: D-Footnote-1112597 -Ref: D-Footnote-2112623 -Node: Elixir112679 -Ref: guide/languages flycheck-d-unittest112772 -Ref: c9112772 -Ref: guide/languages elixir112772 -Ref: ca112772 -Ref: guide/languages el flycheck-checker elixir112797 -Ref: cb112797 -Ref: Elixir-Footnote-1112979 -Node: Emacs Lisp113011 -Ref: guide/languages emacs-lisp113109 -Ref: cc113109 -Ref: guide/languages el flycheck-checker emacs-lisp113196 -Ref: cd113196 -Ref: guide/languages el variable flycheck-emacs-lisp-initialize-packages113618 -Ref: cf113618 -Ref: guide/languages el variable flycheck-emacs-lisp-load-path114424 -Ref: d0114424 -Ref: guide/languages el variable flycheck-emacs-lisp-package-user-dir115623 -Ref: d1115623 -Ref: guide/languages el flycheck-checker emacs-lisp-checkdoc116468 -Ref: ce116468 -Ref: Emacs Lisp-Footnote-1116730 -Ref: Emacs Lisp-Footnote-2116773 -Ref: Emacs Lisp-Footnote-3116850 -Ref: Emacs Lisp-Footnote-4116900 -Node: Erlang116937 -Ref: guide/languages erlang117034 -Ref: d2117034 -Ref: guide/languages cask117034 -Ref: d3117034 -Ref: guide/languages el flycheck-checker erlang117059 -Ref: d4117059 -Ref: Erlang-Footnote-1117240 -Node: ERuby117271 -Ref: guide/languages eruby117365 -Ref: d5117365 -Ref: guide/languages el flycheck-checker eruby-erubis117388 -Ref: d6117388 -Ref: ERuby-Footnote-1117589 -Node: Fortran117631 -Ref: guide/languages fortran117721 -Ref: d7117721 -Ref: guide/languages el flycheck-checker fortran-gfortran117748 -Ref: d8117748 -Ref: guide/languages el variable flycheck-gfortran-args117977 -Ref: d9117977 -Ref: guide/languages el variable flycheck-gfortran-include-path118427 -Ref: da118427 -Ref: guide/languages el variable flycheck-gfortran-language-standard119144 -Ref: db119144 -Ref: guide/languages el variable flycheck-gfortran-layout119854 -Ref: dc119854 -Ref: guide/languages el variable flycheck-gfortran-warnings120373 -Ref: dd120373 -Ref: Fortran-Footnote-1121030 -Ref: Fortran-Footnote-2121079 -Node: Go121128 -Ref: guide/languages go121217 -Ref: de121217 -Ref: guide/languages el flycheck-checker go-gofmt121234 -Ref: df121234 -Ref: guide/languages el flycheck-checker go-golint122071 -Ref: e0122071 -Ref: guide/languages el flycheck-checker go-vet122532 -Ref: e1122532 -Ref: guide/languages el variable flycheck-go-vet-print-functions123076 -Ref: e5123076 -Ref: guide/languages el flycheck-checker go-build124064 -Ref: e2124064 -Ref: guide/languages el flycheck-checker go-test124507 -Ref: e3124507 -Ref: guide/languages el flycheck-checker go-errcheck124948 -Ref: e4124948 -Ref: Go-Footnote-1125128 -Ref: Go-Footnote-2125165 -Ref: Go-Footnote-3125204 -Ref: Go-Footnote-4125238 -Ref: Go-Footnote-5125298 -Ref: Go-Footnote-6125331 -Ref: Go-Footnote-7125364 -Node: Haml125408 -Ref: guide/languages haml125500 -Ref: e6125500 -Ref: guide/languages el flycheck-checker haml125521 -Ref: e7125521 -Ref: Haml-Footnote-1125686 -Node: Handlebars125711 -Ref: guide/languages handlebars125808 -Ref: e8125808 -Ref: guide/languages el flycheck-checker handlebars125841 -Ref: e9125841 -Ref: Handlebars-Footnote-1126032 -Node: Haskell126065 -Ref: guide/languages haskell126162 -Ref: ea126162 -Ref: guide/languages el flycheck-checker haskell-ghc126189 -Ref: eb126189 -Ref: guide/languages el variable flycheck-ghc-args126649 -Ref: ed126649 -Ref: guide/languages el variable flycheck-ghc-language-extensions127084 -Ref: ee127084 -Ref: guide/languages el variable flycheck-ghc-no-user-package-database127778 -Ref: ef127778 -Ref: guide/languages el variable flycheck-ghc-package-databases128392 -Ref: f0128392 -Ref: guide/languages el variable flycheck-ghc-search-path129091 -Ref: f1129091 -Ref: guide/languages el flycheck-checker haskell-hlint129962 -Ref: ec129962 -Ref: Haskell-Footnote-1130252 -Ref: Haskell-Footnote-2130288 -Ref: Haskell-Footnote-3130341 -Ref: Haskell-Footnote-4130385 -Ref: Haskell-Footnote-5130440 -Node: HTML130483 -Ref: guide/languages hdevtools130580 -Ref: f2130580 -Ref: guide/languages html130580 -Ref: f3130580 -Ref: guide/languages el flycheck-checker html-tidy130601 -Ref: f4130601 -Ref: guide/languages el variable flycheck-tidyrc130799 -Ref: f5130799 -Ref: HTML-Footnote-1131094 -Node: Javascript131136 -Ref: guide/languages javascript131230 -Ref: f6131230 -Ref: guide/languages el flycheck-checker javascript-jshint131263 -Ref: f7131263 -Ref: guide/languages el variable flycheck-jshintrc131465 -Ref: f8131465 -Ref: guide/languages el flycheck-checker javascript-eslint131734 -Ref: f9131734 -Ref: guide/languages el variable flycheck-eslint-rulesdir131925 -Ref: fa131925 -Ref: guide/languages el variable flycheck-eslintrc132846 -Ref: fb132846 -Ref: guide/languages el flycheck-checker javascript-gjslint133244 -Ref: fc133244 -Ref: guide/languages el variable flycheck-gjslintrc133481 -Ref: fd133481 -Ref: Javascript-Footnote-1133788 -Ref: Javascript-Footnote-2133818 -Ref: Javascript-Footnote-3133859 -Ref: Javascript-Footnote-4133953 -Node: JSON134009 -Ref: guide/languages json134103 -Ref: fe134103 -Ref: guide/languages el flycheck-checker json-jsonlint134124 -Ref: ff134124 -Ref: JSON-Footnote-1134317 -Node: LESS134359 -Ref: guide/languages less134446 -Ref: 100134446 -Ref: guide/languages el flycheck-checker less134467 -Ref: 101134467 -Ref: LESS-Footnote-1134671 -Node: Lua134698 -Ref: guide/languages lua134785 -Ref: 102134785 -Ref: guide/languages el flycheck-checker lua134804 -Ref: 103134804 -Ref: Lua-Footnote-1134969 -Node: Make134997 -Ref: guide/languages make135084 -Ref: 104135084 -Ref: guide/languages el flycheck-checker make135105 -Ref: 105135105 -Ref: Make-Footnote-1135438 -Ref: Make-Footnote-2135515 -Ref: Make-Footnote-3135557 -Ref: Make-Footnote-4135623 -Ref: Make-Footnote-5135687 -Node: Perl135745 -Ref: guide/languages openbsd-make135832 -Ref: 106135832 -Ref: guide/languages perl135832 -Ref: 107135832 -Ref: guide/languages el flycheck-checker perl135853 -Ref: 108135853 -Ref: guide/languages el flycheck-checker perl-perlcritic136214 -Ref: 109136214 -Ref: guide/languages el variable flycheck-perlcritic-severity136398 -Ref: 10a136398 -Ref: Perl-Footnote-1137048 -Ref: Perl-Footnote-2137076 -Node: PHP137122 -Ref: guide/languages php137211 -Ref: 10b137211 -Ref: guide/languages el flycheck-checker php137230 -Ref: 10c137230 -Ref: guide/languages el flycheck-checker php-phpmd137791 -Ref: 10d137791 -Ref: guide/languages el variable flycheck-phpmd-rulesets138172 -Ref: 10f138172 -Ref: guide/languages el flycheck-checker php-phpcs138744 -Ref: 10e138744 -Ref: guide/languages el variable flycheck-phpcs-standard138930 -Ref: 110138930 -Ref: PHP-Footnote-1139580 -Ref: PHP-Footnote-2139638 -Ref: PHP-Footnote-3139664 -Ref: PHP-Footnote-4139714 -Node: Puppet139767 -Ref: guide/languages puppet139858 -Ref: 111139858 -Ref: guide/languages el flycheck-checker puppet-parser139883 -Ref: 112139883 -Ref: guide/languages el flycheck-checker puppet-lint140324 -Ref: 113140324 -Ref: Puppet-Footnote-1140503 -Ref: Puppet-Footnote-2140534 -Node: Python140566 -Ref: guide/languages python140655 -Ref: 114140655 -Ref: guide/languages el flycheck-checker python-flake8140680 -Ref: 115140680 -Ref: guide/languages el variable flycheck-flake8-error-level-alist140901 -Ref: 116140901 -Ref: guide/languages el variable flycheck-flake8-maximum-complexity142166 -Ref: 117142166 -Ref: guide/languages el variable flycheck-flake8-maximum-line-length142865 -Ref: 119142865 -Ref: guide/languages el variable flycheck-flake8rc143818 -Ref: 118143818 -Ref: guide/languages el flycheck-checker python-pylint144083 -Ref: 11a144083 -Ref: guide/languages el variable flycheck-pylintrc144334 -Ref: 11b144334 -Ref: guide/languages el flycheck-checker python-pycompile144599 -Ref: 11c144599 -Ref: Python-Footnote-1144910 -Ref: Python-Footnote-2144954 -Ref: Python-Footnote-3144985 -Ref: Python-Footnote-4145045 -Node: R145098 -Ref: guide/languages flycheck-pyflakes145187 -Ref: 11d145187 -Ref: guide/languages r145187 -Ref: 11e145187 -Ref: guide/languages el flycheck-checker r-lintr145202 -Ref: 11f145202 -Ref: guide/languages el variable flycheck-lintr-caching145388 -Ref: 120145388 -Ref: guide/languages el variable flycheck-lintr-linters146055 -Ref: 121146055 -Ref: R-Footnote-1146617 -Node: Racket146660 -Ref: guide/languages racket146751 -Ref: 122146751 -Ref: guide/languages el flycheck-checker racket146776 -Ref: 123146776 -Ref: Racket-Footnote-1146954 -Node: RPM SPEC146986 -Ref: guide/languages rpm-spec147092 -Ref: 124147092 -Ref: guide/languages el flycheck-checker rpm-rpmlint147121 -Ref: 125147121 -Ref: RPM SPEC-Footnote-1147317 -Node: ReStructuredText147366 -Ref: guide/languages restructuredtext147470 -Ref: 126147470 -Ref: guide/languages el flycheck-checker rst147515 -Ref: 127147515 -Ref: guide/languages el flycheck-checker rst-sphinx147668 -Ref: 128147668 -Ref: guide/languages el variable flycheck-sphinx-warn-on-missing-references147874 -Ref: 129147874 -Ref: ReStructuredText-Footnote-1148526 -Ref: ReStructuredText-Footnote-2148567 -Node: Ruby148597 -Ref: guide/languages ruby148697 -Ref: 12a148697 -Ref: guide/languages el flycheck-checker ruby-rubocop148718 -Ref: 12b148718 -Ref: guide/languages el variable flycheck-rubocop-lint-only149190 -Ref: 12d149190 -Ref: guide/languages el variable flycheck-rubocoprc149857 -Ref: 12e149857 -Ref: guide/languages el flycheck-checker ruby-rubylint150122 -Ref: 12c150122 -Ref: guide/languages el variable flycheck-rubylintrc150474 -Ref: 12f150474 -Ref: guide/languages el flycheck-checker ruby150845 -Ref: 130150845 -Ref: guide/languages el flycheck-checker ruby-jruby151644 -Ref: 131151644 -Ref: Ruby-Footnote-1152285 -Ref: Ruby-Footnote-2152320 -Ref: Ruby-Footnote-3152371 -Ref: Ruby-Footnote-4152406 -Node: Rust152432 -Ref: guide/languages rust152520 -Ref: 132152520 -Ref: guide/languages el flycheck-checker rust152541 -Ref: 133152541 -Ref: guide/languages el variable flycheck-rust-check-tests152753 -Ref: 134152753 -Ref: guide/languages el variable flycheck-rust-crate-root153544 -Ref: 135153544 -Ref: guide/languages el variable flycheck-rust-crate-type154437 -Ref: 136154437 -Ref: guide/languages el variable flycheck-rust-library-path154941 -Ref: 137154941 -Ref: Rust-Footnote-1155826 -Ref: Rust-Footnote-2155859 -Node: Sass155909 -Ref: guide/languages flycheck-rust155998 -Ref: 138155998 -Ref: guide/languages sass155998 -Ref: 139155998 -Ref: guide/languages el flycheck-checker sass156019 -Ref: 13a156019 -Ref: guide/languages el variable flycheck-sass-compass156179 -Ref: 13b156179 -Ref: Sass-Footnote-1156770 -Node: Scala156799 -Ref: guide/languages scala156888 -Ref: 13c156888 -Ref: guide/languages el flycheck-checker scala156911 -Ref: 13d156911 -Ref: guide/languages el flycheck-checker scala-scalastyle157344 -Ref: 13e157344 -Ref: guide/languages el variable flycheck-scalastyle-jar157701 -Ref: 13f157701 -Ref: guide/languages el variable flycheck-scalastylerc158356 -Ref: 140158356 -Ref: Scala-Footnote-1158793 -Ref: Scala-Footnote-2158828 -Node: Scss158862 -Ref: guide/languages scss158969 -Ref: 141158969 -Ref: guide/languages el flycheck-checker scss158990 -Ref: 142158990 -Ref: guide/languages el variable flycheck-scss-compass159150 -Ref: 143159150 -Ref: Scss-Footnote-1159741 -Node: Shell script languages159770 -Ref: guide/languages shell-script-languages159876 -Ref: 144159876 -Ref: guide/languages el flycheck-checker sh-bash159933 -Ref: 145159933 -Ref: guide/languages el flycheck-checker sh-posix-dash160368 -Ref: 147160368 -Ref: guide/languages el flycheck-checker sh-posix-bash160891 -Ref: 148160891 -Ref: guide/languages el flycheck-checker sh-zsh161430 -Ref: 149161430 -Ref: guide/languages el flycheck-checker sh-shellcheck161848 -Ref: 146161848 -Ref: guide/languages el variable flycheck-shellcheck-excluded-warnings162048 -Ref: 14a162048 -Ref: Shell script languages-Footnote-1162793 -Ref: Shell script languages-Footnote-2162835 -Ref: Shell script languages-Footnote-3162885 -Ref: Shell script languages-Footnote-4162967 -Ref: Shell script languages-Footnote-5163009 -Ref: Shell script languages-Footnote-6163105 -Ref: Shell script languages-Footnote-7163187 -Ref: Shell script languages-Footnote-8163215 -Node: Slim163263 -Ref: guide/languages gnu-bash-posix-mode163374 -Ref: 14b163374 -Ref: guide/languages slim163374 -Ref: 14c163374 -Ref: guide/languages el flycheck-checker slim163395 -Ref: 14d163395 -Ref: Slim-Footnote-1163564 -Node: TeX/LaTeX163593 -Ref: guide/languages tex-latex163689 -Ref: 14e163689 -Ref: guide/languages el flycheck-checker tex-chktex163762 -Ref: 14f163762 -Ref: guide/languages el variable flycheck-chktexrc163968 -Ref: 150163968 -Ref: guide/languages el flycheck-checker tex-lacheck164230 -Ref: 151164230 -Ref: TeX/LaTeX-Footnote-1164419 -Ref: TeX/LaTeX-Footnote-2164457 -Ref: TeX/LaTeX-Footnote-3164493 -Ref: TeX/LaTeX-Footnote-4164531 -Node: Texinfo164571 -Ref: guide/languages tex-live164670 -Ref: 152164670 -Ref: guide/languages texinfo164670 -Ref: 153164670 -Ref: guide/languages el flycheck-checker texinfo164697 -Ref: 154164697 -Ref: Texinfo-Footnote-1164879 -Node: Verilog164924 -Ref: guide/languages verilog165017 -Ref: 155165017 -Ref: guide/languages el flycheck-checker verilog-verilator165044 -Ref: 156165044 -Ref: Verilog-Footnote-1165266 -Node: XML165313 -Ref: guide/languages xml165403 -Ref: 157165403 -Ref: guide/languages el flycheck-checker xml-xmlstarlet165422 -Ref: 158165422 -Ref: guide/languages el flycheck-checker xml-xmllint165595 -Ref: 159165595 -Ref: XML-Footnote-1165827 -Ref: XML-Footnote-2165867 -Node: YAML165899 -Ref: guide/languages yaml165973 -Ref: 15a165973 -Ref: guide/languages el flycheck-checker yaml-jsyaml165994 -Ref: 15b165994 -Ref: guide/languages el flycheck-checker yaml-ruby166138 -Ref: 15c166138 -Ref: YAML-Footnote-1166443 -Ref: YAML-Footnote-2166485 -Node: Glossary166557 -Ref: guide/glossary glossary166661 -Ref: 15d166661 -Ref: guide/glossary doc166661 -Ref: 15e166661 -Ref: guide/glossary term-syntax-checker166684 -Ref: 64166684 -Ref: guide/glossary term-registered-syntax-checker166793 -Ref: 60166793 -Ref: guide/glossary term-disabled-syntax-checker166949 -Ref: 15f166949 -Ref: guide/glossary term-enabled-syntax-checker167129 -Ref: 62167129 -Ref: guide/glossary term-suitable-syntax-checker167254 -Ref: 53167254 -Ref: guide/glossary term-chaining167548 -Ref: a0167548 -Node: Flycheck releases168135 -Ref: guide/releases/index flycheck-releases168238 -Ref: 160168238 -Ref: guide/releases/index doc168238 -Ref: 161168238 -Node: Release announcements168423 -Ref: guide/releases/index release-announcements168518 -Ref: 162168518 -Node: Flycheck 0 22168845 -Ref: guide/releases/flycheck-0 22 doc168940 -Ref: 163168940 -Ref: guide/releases/flycheck-0 22 flycheck-0-22168940 -Ref: 164168940 -Node: Breaking changes169539 -Ref: guide/releases/flycheck-0 22 breaking-changes169624 -Ref: 166169624 -Node: Setup<2>171090 -Ref: guide/releases/flycheck-0 22 setup171200 -Ref: 16a171200 -Node: Language support171435 -Ref: guide/releases/flycheck-0 22 language-support171557 -Ref: 16b171557 -Node: Ada<2>171800 -Ref: guide/releases/flycheck-0 22 ada171878 -Ref: 16c171878 -Node: C/C++<2>172007 -Ref: guide/releases/flycheck-0 22 c-c172107 -Ref: 16d172107 -Node: Emacs Lisp<2>172496 -Ref: guide/releases/flycheck-0 22 emacs-lisp172600 -Ref: 16e172600 -Node: Haskell<2>173075 -Ref: guide/releases/flycheck-0 22 haskell173181 -Ref: 16f173181 -Node: Fortran<2>173394 -Ref: guide/releases/flycheck-0 22 fortran173496 -Ref: 170173496 -Node: Python<2>173645 -Ref: guide/releases/flycheck-0 22 python173744 -Ref: 171173744 -Node: Rust<2>174384 -Ref: guide/releases/flycheck-0 22 rust174485 -Ref: 172174485 -Node: TeX/LaTeX<2>174589 -Ref: guide/releases/flycheck-0 22 tex-latex174672 -Ref: 173174672 -Node: Syntax checking improvements174774 -Ref: guide/releases/flycheck-0 22 syntax-checking-improvements174911 -Ref: 174174911 -Node: Error list improvements175339 -Ref: guide/releases/flycheck-0 22 error-list-improvements175483 -Ref: 175175483 -Node: Generic syntax checkers175730 -Ref: guide/releases/flycheck-0 22 generic-syntax-checkers175855 -Ref: 176175855 -Node: Error IDs176572 -Ref: guide/releases/flycheck-0 22 error-ids176704 -Ref: 178176704 -Node: Unit test library for Flycheck177805 -Ref: guide/releases/flycheck-0 22 unit-test-library-for-flycheck177905 -Ref: 17d177905 -Node: Flycheck 0 21178314 -Ref: guide/releases/flycheck-0 21 doc178431 -Ref: 17f178431 -Ref: guide/releases/flycheck-0 21 flycheck-0-21178431 -Ref: 180178431 -Node: Breaking changes<2>178979 -Ref: guide/releases/flycheck-0 21 breaking-changes179078 -Ref: 181179078 -Node: Language support<2>180096 -Ref: guide/releases/flycheck-0 21 language-support180222 -Ref: 182180222 -Node: C/C++<3>180527 -Ref: guide/releases/flycheck-0 21 c-c180606 -Ref: 183180606 -Node: D<2>180966 -Ref: guide/releases/flycheck-0 21 d181059 -Ref: 184181059 -Node: Go<2>181248 -Ref: guide/releases/flycheck-0 21 go181340 -Ref: 185181340 -Node: HTML<2>181448 -Ref: guide/releases/flycheck-0 21 html181540 -Ref: 186181540 -Node: Less181630 -Ref: guide/releases/flycheck-0 21 less181730 -Ref: 187181730 -Node: Shell scripts181832 -Ref: guide/releases/flycheck-0 21 shell-scripts181916 -Ref: 188181916 -Node: Error list changes182307 -Ref: guide/releases/flycheck-0 21 error-list-changes182442 -Ref: 189182442 -Node: Error navigation and display183317 -Ref: guide/releases/flycheck-0 21 error-navigation-and-display183472 -Ref: 18a183472 -Node: Syntax checker definition and extension184152 -Ref: guide/releases/flycheck-0 21 syntax-checker-definition-and-extension184314 -Ref: 18b184314 -Node: Obtaining the new release185060 -Ref: guide/releases/flycheck-0 21 obtaining-the-new-release185185 -Ref: 18d185185 -Node: Flycheck 0 20185391 -Ref: guide/releases/flycheck-0 20 flycheck-0-20185508 -Ref: 18e185508 -Ref: guide/releases/flycheck-0 20 doc185508 -Ref: 18f185508 -Node: Breaking changes<3>186080 -Ref: guide/releases/flycheck-0 20 breaking-changes186179 -Ref: 190186179 -Node: Language support<3>187056 -Ref: guide/releases/flycheck-0 20 language-support187190 -Ref: 191187190 -Node: C/C++<4>187482 -Ref: guide/releases/flycheck-0 20 c-c187564 -Ref: 192187564 -Node: Rust<3>188078 -Ref: guide/releases/flycheck-0 20 rust188177 -Ref: 193188177 -Node: Scala<2>188573 -Ref: guide/releases/flycheck-0 20 scala188673 -Ref: 194188673 -Ref: Scala<2>-Footnote-1188809 -Node: Sass/SCSS188844 -Ref: guide/releases/flycheck-0 20 scalastyle188950 -Ref: 195188950 -Ref: guide/releases/flycheck-0 20 sass-scss188950 -Ref: 196188950 -Node: Javascript<2>189121 -Ref: guide/releases/flycheck-0 20 javascript189226 -Ref: 197189226 -Ref: Javascript<2>-Footnote-1189507 -Ref: Javascript<2>-Footnote-2189534 -Node: Ruby<2>189578 -Ref: guide/releases/flycheck-0 20 ruby189665 -Ref: 198189665 -Ref: guide/releases/flycheck-0 20 configuring-eslint189665 -Ref: 199189665 -Node: Error list improvements<2>189830 -Ref: guide/releases/flycheck-0 20 error-list-improvements189972 -Ref: 19a189972 -Node: User interface improvements190643 -Ref: guide/releases/flycheck-0 20 user-interface-improvements190792 -Ref: 19b190792 -Node: Miscellaneous new features191605 -Ref: guide/releases/flycheck-0 20 miscellaneous-new-features191747 -Ref: 19d191747 -Node: Miscellaneous fixes192087 -Ref: guide/releases/flycheck-0 20 miscellaneous-fixes192208 -Ref: 19f192208 -Node: Get it192430 -Ref: guide/releases/flycheck-0 20 get-it192516 -Ref: 1a0192516 -Node: Flycheck 0 19192684 -Ref: guide/releases/flycheck-0 19 flycheck-0-19192801 -Ref: 1a1192801 -Ref: guide/releases/flycheck-0 19 doc192801 -Ref: 1a2192801 -Node: Breaking changes<4>193077 -Ref: guide/releases/flycheck-0 19 breaking-changes193166 -Ref: 1a3193166 -Node: Languages193350 -Ref: guide/releases/flycheck-0 19 languages193460 -Ref: 1a4193460 -Node: C/C++<5>193613 -Ref: guide/releases/flycheck-0 19 c-c193691 -Ref: 1a5193691 -Node: Emacs Lisp<3>194032 -Ref: guide/releases/flycheck-0 19 emacs-lisp194124 -Ref: 1a6194124 -Node: Go<3>194282 -Ref: guide/releases/flycheck-0 19 go194376 -Ref: 1a7194376 -Node: Haskell<3>194608 -Ref: guide/releases/flycheck-0 19 haskell194696 -Ref: 1a8194696 -Node: Rust<4>194859 -Ref: guide/releases/flycheck-0 19 rust194933 -Ref: 1a9194933 -Node: New features195075 -Ref: guide/releases/flycheck-0 19 new-features195175 -Ref: 1aa195175 -Node: Bug fixes196284 -Ref: guide/releases/flycheck-0 19 bug-fixes196387 -Ref: 1ab196387 -Node: Misc changes196646 -Ref: guide/releases/flycheck-0 19 misc-changes196746 -Ref: 1ac196746 -Ref: Misc changes-Footnote-1196957 -Node: Get it<2>196994 -Ref: guide/releases/flycheck-0 19 get-it197076 -Ref: 1ad197076 -Ref: guide/releases/flycheck-0 19 github-profile197076 -Ref: 1ae197076 -Node: Flycheck 0 18197138 -Ref: guide/releases/flycheck-0 18 doc197255 -Ref: 1af197255 -Ref: guide/releases/flycheck-0 18 flycheck-0-18197255 -Ref: 1b0197255 -Node: Breaking changes<5>197672 -Ref: guide/releases/flycheck-0 18 breaking-changes197770 -Ref: 1b1197770 -Node: Syntax checkers<2>198495 -Ref: guide/releases/flycheck-0 18 syntax-checkers198614 -Ref: 1b2198614 -Ref: Syntax checkers<2>-Footnote-1199776 -Ref: Syntax checkers<2>-Footnote-2199815 -Ref: Syntax checkers<2>-Footnote-3199861 -Node: Bug fixes<2>199908 -Ref: guide/releases/flycheck-0 18 shellcheck200017 -Ref: 1b3200017 -Ref: guide/releases/flycheck-0 18 bug-fixes200017 -Ref: 1b4200017 -Node: Get it<3>200693 -Ref: guide/releases/flycheck-0 18 get-it200775 -Ref: 1b5200775 -Node: Flycheck 0 17200835 -Ref: guide/releases/flycheck-0 17 flycheck-0-17200952 -Ref: 1b6200952 -Ref: guide/releases/flycheck-0 17 doc200952 -Ref: 1b7200952 -Node: Breaking changes<6>201338 -Ref: guide/releases/flycheck-0 17 breaking-changes201435 -Ref: 1b8201435 -Node: New online manual202060 -Ref: guide/releases/flycheck-0 17 new-online-manual202184 -Ref: 1b9202184 -Ref: New online manual-Footnote-1204074 -Ref: New online manual-Footnote-2204104 -Ref: New online manual-Footnote-3204149 -Ref: New online manual-Footnote-4204198 -Ref: New online manual-Footnote-5204243 -Node: Syntax checkers<3>204273 -Ref: guide/releases/flycheck-0 17 syntax-checkers204403 -Ref: 1ba204403 -Ref: guide/releases/flycheck-0 17 llvm-documentation204403 -Ref: 1bb204403 -Ref: Syntax checkers<3>-Footnote-1205028 -Node: Extending syntax checkers205084 -Ref: guide/releases/flycheck-0 17 extending-syntax-checkers205229 -Ref: 1bc205229 -Node: Other bug fixes and improvements205298 -Ref: guide/releases/flycheck-0 17 other-bug-fixes-and-improvements205416 -Ref: 1bd205416 -Ref: Other bug fixes and improvements-Footnote-1206078 -Ref: Other bug fixes and improvements-Footnote-2206134 -Ref: Other bug fixes and improvements-Footnote-3206190 -Node: Flycheck 0 16206246 -Ref: guide/releases/flycheck-0 16 flycheck-0-16206363 -Ref: 1be206363 -Ref: guide/releases/flycheck-0 16 doc206363 -Ref: 1bf206363 -Node: Breaking changes<7>206982 -Ref: guide/releases/flycheck-0 16 breaking-changes207080 -Ref: 1c0207080 -Ref: Breaking changes<7>-Footnote-1207366 -Ref: Breaking changes<7>-Footnote-2207421 -Node: Syntax checkers<4>207477 -Ref: guide/releases/flycheck-0 16 syntax-checkers207599 -Ref: 1c1207599 -Ref: guide/releases/flycheck-0 16 flycheck-hdevtools207599 -Ref: 1c2207599 -Node: New languages and checkers207749 -Ref: guide/releases/flycheck-0 16 new-languages-and-checkers207863 -Ref: 1c3207863 -Ref: New languages and checkers-Footnote-1208239 -Ref: New languages and checkers-Footnote-2208268 -Ref: New languages and checkers-Footnote-3208297 -Ref: New languages and checkers-Footnote-4208330 -Ref: New languages and checkers-Footnote-5208372 -Ref: New languages and checkers-Footnote-6208405 -Ref: New languages and checkers-Footnote-7208437 -Ref: New languages and checkers-Footnote-8208482 -Ref: New languages and checkers-Footnote-9208528 -Ref: New languages and checkers-Footnote-10208569 -Ref: New languages and checkers-Footnote-11208621 -Node: Better Haskell support208664 -Ref: guide/releases/flycheck-0 16 js-yaml208812 -Ref: 1c4208812 -Ref: guide/releases/flycheck-0 16 better-haskell-support208812 -Ref: 1c5208812 -Ref: Better Haskell support-Footnote-1209420 -Node: Miscellaneous new options209473 -Ref: guide/releases/flycheck-0 16 miscellaneous-new-options209586 -Ref: 1c6209586 -Ref: guide/releases/flycheck-0 16 flycheck-haskell209586 -Ref: 1c7209586 -Node: New features<2>210032 -Ref: guide/releases/flycheck-0 16 new-features210154 -Ref: 1c8210154 -Node: Syntax checker executables<2>210305 -Ref: guide/releases/flycheck-0 16 syntax-checker-executables210427 -Ref: 1c9210427 -Node: Disable syntax checkers easily210612 -Ref: guide/releases/flycheck-0 16 disable-syntax-checkers-easily210734 -Ref: 1ca210734 -Node: Improved error list211623 -Ref: guide/releases/flycheck-0 16 improved-error-list211736 -Ref: 1cb211736 -Ref: Improved error list-Footnote-1212322 -Node: Get it<4>212378 -Ref: guide/releases/flycheck-0 16 get-it212467 -Ref: 1cc212467 -Node: Flycheck 0 15212529 -Ref: guide/releases/flycheck-0 15 flycheck-0-15212624 -Ref: 1cd212624 -Ref: guide/releases/flycheck-0 15 doc212624 -Ref: 1ce212624 -Node: Breaking changes<8>213278 -Ref: guide/releases/flycheck-0 15 breaking-changes213377 -Ref: 1cf213377 -Node: New syntax checkers214216 -Ref: guide/releases/flycheck-0 15 new-syntax-checkers214338 -Ref: 1d1214338 -Ref: New syntax checkers-Footnote-1214873 -Ref: New syntax checkers-Footnote-2214902 -Ref: New syntax checkers-Footnote-3214952 -Node: New error list214978 -Ref: guide/releases/flycheck-0 15 new-error-list215094 -Ref: 1d0215094 -Ref: guide/releases/flycheck-0 15 id1215094 -Ref: 1d2215094 -Node: C/C++ support215863 -Ref: guide/releases/flycheck-0 15 c-c-support215983 -Ref: 1d3215983 -Node: New info level messages217327 -Ref: guide/releases/flycheck-0 15 new-info-level-messages217452 -Ref: 1d4217452 -Ref: New info level messages-Footnote-1218672 -Ref: New info level messages-Footnote-2218723 -Node: Custom error levels218772 -Ref: guide/releases/flycheck-0 15 custom-error-levels218902 -Ref: 1d5218902 -Ref: guide/releases/flycheck-0 15 id2218902 -Ref: 1d6218902 -Node: Other improvements219613 -Ref: guide/releases/flycheck-0 15 other-improvements219729 -Ref: 1d7219729 -Node: Get it<5>220717 -Ref: guide/releases/flycheck-0 15 get-it220805 -Ref: 1d8220805 -Node: Changelog220865 -Ref: guide/releases/index id1220960 -Ref: 1d9220960 -Ref: guide/releases/index changelog220960 -Ref: 165220960 -Node: master in development222086 -Ref: guide/releases/index master-in-development222180 -Ref: 1da222180 -Ref: master in development-Footnote-1222758 -Ref: master in development-Footnote-2222814 -Ref: master in development-Footnote-3222870 -Ref: master in development-Footnote-4222926 -Ref: master in development-Footnote-5222982 -Node: 0 22 Dec 23 2014223038 -Ref: guide/releases/index dec-23-2014223157 -Ref: 1db223157 -Ref: 0 22 Dec 23 2014-Footnote-1226492 -Ref: 0 22 Dec 23 2014-Footnote-2226548 -Ref: 0 22 Dec 23 2014-Footnote-3226604 -Ref: 0 22 Dec 23 2014-Footnote-4226660 -Ref: 0 22 Dec 23 2014-Footnote-5226716 -Ref: 0 22 Dec 23 2014-Footnote-6226772 -Ref: 0 22 Dec 23 2014-Footnote-7226828 -Ref: 0 22 Dec 23 2014-Footnote-8226884 -Ref: 0 22 Dec 23 2014-Footnote-9226940 -Ref: 0 22 Dec 23 2014-Footnote-10226996 -Ref: 0 22 Dec 23 2014-Footnote-11227053 -Ref: 0 22 Dec 23 2014-Footnote-12227110 -Ref: 0 22 Dec 23 2014-Footnote-13227167 -Ref: 0 22 Dec 23 2014-Footnote-14227224 -Ref: 0 22 Dec 23 2014-Footnote-15227281 -Ref: 0 22 Dec 23 2014-Footnote-16227338 -Ref: 0 22 Dec 23 2014-Footnote-17227395 -Ref: 0 22 Dec 23 2014-Footnote-18227452 -Ref: 0 22 Dec 23 2014-Footnote-19227509 -Ref: 0 22 Dec 23 2014-Footnote-20227566 -Ref: 0 22 Dec 23 2014-Footnote-21227623 -Ref: 0 22 Dec 23 2014-Footnote-22227680 -Ref: 0 22 Dec 23 2014-Footnote-23227737 -Ref: 0 22 Dec 23 2014-Footnote-24227794 -Ref: 0 22 Dec 23 2014-Footnote-25227851 -Node: 0 21 Oct 26 2014227908 -Ref: guide/releases/index oct-26-2014228022 -Ref: 1dc228022 -Ref: 0 21 Oct 26 2014-Footnote-1230565 -Ref: 0 21 Oct 26 2014-Footnote-2230621 -Ref: 0 21 Oct 26 2014-Footnote-3230677 -Ref: 0 21 Oct 26 2014-Footnote-4230733 -Ref: 0 21 Oct 26 2014-Footnote-5230789 -Ref: 0 21 Oct 26 2014-Footnote-6230845 -Ref: 0 21 Oct 26 2014-Footnote-7230901 -Ref: 0 21 Oct 26 2014-Footnote-8230957 -Ref: 0 21 Oct 26 2014-Footnote-9231013 -Ref: 0 21 Oct 26 2014-Footnote-10231069 -Ref: 0 21 Oct 26 2014-Footnote-11231126 -Ref: 0 21 Oct 26 2014-Footnote-12231183 -Ref: 0 21 Oct 26 2014-Footnote-13231240 -Ref: 0 21 Oct 26 2014-Footnote-14231297 -Ref: 0 21 Oct 26 2014-Footnote-15231354 -Ref: 0 21 Oct 26 2014-Footnote-16231411 -Ref: 0 21 Oct 26 2014-Footnote-17231468 -Ref: 0 21 Oct 26 2014-Footnote-18231525 -Ref: 0 21 Oct 26 2014-Footnote-19231582 -Ref: 0 21 Oct 26 2014-Footnote-20231639 -Ref: 0 21 Oct 26 2014-Footnote-21231696 -Node: 0 20 Aug 12 2014231753 -Ref: guide/releases/index aug-12-2014231867 -Ref: 1dd231867 -Ref: 0 20 Aug 12 2014-Footnote-1235447 -Ref: 0 20 Aug 12 2014-Footnote-2235503 -Ref: 0 20 Aug 12 2014-Footnote-3235559 -Ref: 0 20 Aug 12 2014-Footnote-4235615 -Ref: 0 20 Aug 12 2014-Footnote-5235671 -Ref: 0 20 Aug 12 2014-Footnote-6235727 -Ref: 0 20 Aug 12 2014-Footnote-7235783 -Ref: 0 20 Aug 12 2014-Footnote-8235839 -Ref: 0 20 Aug 12 2014-Footnote-9235895 -Ref: 0 20 Aug 12 2014-Footnote-10235951 -Ref: 0 20 Aug 12 2014-Footnote-11236008 -Ref: 0 20 Aug 12 2014-Footnote-12236065 -Ref: 0 20 Aug 12 2014-Footnote-13236122 -Ref: 0 20 Aug 12 2014-Footnote-14236179 -Ref: 0 20 Aug 12 2014-Footnote-15236236 -Ref: 0 20 Aug 12 2014-Footnote-16236293 -Ref: 0 20 Aug 12 2014-Footnote-17236350 -Ref: 0 20 Aug 12 2014-Footnote-18236407 -Ref: 0 20 Aug 12 2014-Footnote-19236464 -Ref: 0 20 Aug 12 2014-Footnote-20236521 -Ref: 0 20 Aug 12 2014-Footnote-21236578 -Ref: 0 20 Aug 12 2014-Footnote-22236635 -Ref: 0 20 Aug 12 2014-Footnote-23236692 -Ref: 0 20 Aug 12 2014-Footnote-24236749 -Ref: 0 20 Aug 12 2014-Footnote-25236806 -Ref: 0 20 Aug 12 2014-Footnote-26236863 -Ref: 0 20 Aug 12 2014-Footnote-27236920 -Ref: 0 20 Aug 12 2014-Footnote-28236977 -Node: 0 19 Jun 12 2014237034 -Ref: guide/releases/index jun-12-2014237148 -Ref: 1de237148 -Ref: 0 19 Jun 12 2014-Footnote-1239018 -Ref: 0 19 Jun 12 2014-Footnote-2239074 -Ref: 0 19 Jun 12 2014-Footnote-3239130 -Ref: 0 19 Jun 12 2014-Footnote-4239186 -Ref: 0 19 Jun 12 2014-Footnote-5239242 -Ref: 0 19 Jun 12 2014-Footnote-6239298 -Ref: 0 19 Jun 12 2014-Footnote-7239354 -Ref: 0 19 Jun 12 2014-Footnote-8239410 -Ref: 0 19 Jun 12 2014-Footnote-9239466 -Ref: 0 19 Jun 12 2014-Footnote-10239522 -Ref: 0 19 Jun 12 2014-Footnote-11239579 -Ref: 0 19 Jun 12 2014-Footnote-12239636 -Ref: 0 19 Jun 12 2014-Footnote-13239693 -Ref: 0 19 Jun 12 2014-Footnote-14239750 -Node: 0 18 Mar 24 2014239807 -Ref: guide/releases/index mar-24-2014239920 -Ref: 1df239920 -Ref: 0 18 Mar 24 2014-Footnote-1241936 -Ref: 0 18 Mar 24 2014-Footnote-2241992 -Ref: 0 18 Mar 24 2014-Footnote-3242047 -Ref: 0 18 Mar 24 2014-Footnote-4242103 -Ref: 0 18 Mar 24 2014-Footnote-5242159 -Ref: 0 18 Mar 24 2014-Footnote-6242215 -Ref: 0 18 Mar 24 2014-Footnote-7242271 -Ref: 0 18 Mar 24 2014-Footnote-8242327 -Ref: 0 18 Mar 24 2014-Footnote-9242383 -Ref: 0 18 Mar 24 2014-Footnote-10242439 -Node: 0 17 Feb 1 2014242496 -Ref: guide/releases/index feb-1-2014242609 -Ref: 1e0242609 -Ref: 0 17 Feb 1 2014-Footnote-1244303 -Ref: 0 17 Feb 1 2014-Footnote-2244333 -Ref: 0 17 Feb 1 2014-Footnote-3244389 -Ref: 0 17 Feb 1 2014-Footnote-4244445 -Ref: 0 17 Feb 1 2014-Footnote-5244501 -Ref: 0 17 Feb 1 2014-Footnote-6244557 -Ref: 0 17 Feb 1 2014-Footnote-7244613 -Ref: 0 17 Feb 1 2014-Footnote-8244669 -Ref: 0 17 Feb 1 2014-Footnote-9244725 -Node: 0 16 Jan 11 2014244781 -Ref: guide/releases/index sphinx244894 -Ref: 1e1244894 -Ref: guide/releases/index jan-11-2014244894 -Ref: 1e2244894 -Ref: 0 16 Jan 11 2014-Footnote-1247726 -Ref: 0 16 Jan 11 2014-Footnote-2247781 -Ref: 0 16 Jan 11 2014-Footnote-3247837 -Ref: 0 16 Jan 11 2014-Footnote-4247893 -Ref: 0 16 Jan 11 2014-Footnote-5247949 -Ref: 0 16 Jan 11 2014-Footnote-6248005 -Ref: 0 16 Jan 11 2014-Footnote-7248061 -Ref: 0 16 Jan 11 2014-Footnote-8248117 -Ref: 0 16 Jan 11 2014-Footnote-9248173 -Ref: 0 16 Jan 11 2014-Footnote-10248229 -Ref: 0 16 Jan 11 2014-Footnote-11248286 -Ref: 0 16 Jan 11 2014-Footnote-12248343 -Ref: 0 16 Jan 11 2014-Footnote-13248400 -Ref: 0 16 Jan 11 2014-Footnote-14248457 -Ref: 0 16 Jan 11 2014-Footnote-15248514 -Ref: 0 16 Jan 11 2014-Footnote-16248571 -Ref: 0 16 Jan 11 2014-Footnote-17248628 -Ref: 0 16 Jan 11 2014-Footnote-18248685 -Ref: 0 16 Jan 11 2014-Footnote-19248742 -Ref: 0 16 Jan 11 2014-Footnote-20248799 -Ref: 0 16 Jan 11 2014-Footnote-21248856 -Ref: 0 16 Jan 11 2014-Footnote-22248913 -Node: 0 15 Nov 15 2013248970 -Ref: guide/releases/index nov-15-2013249086 -Ref: 1e3249086 -Ref: guide/releases/index flycheck-hdevtools249086 -Ref: 1e4249086 -Ref: 0 15 Nov 15 2013-Footnote-1253294 -Ref: 0 15 Nov 15 2013-Footnote-2253350 -Ref: 0 15 Nov 15 2013-Footnote-3253406 -Ref: 0 15 Nov 15 2013-Footnote-4253462 -Ref: 0 15 Nov 15 2013-Footnote-5253518 -Ref: 0 15 Nov 15 2013-Footnote-6253574 -Ref: 0 15 Nov 15 2013-Footnote-7253630 -Ref: 0 15 Nov 15 2013-Footnote-8253671 -Ref: 0 15 Nov 15 2013-Footnote-9253727 -Ref: 0 15 Nov 15 2013-Footnote-10253783 -Ref: 0 15 Nov 15 2013-Footnote-11253840 -Ref: 0 15 Nov 15 2013-Footnote-12253897 -Ref: 0 15 Nov 15 2013-Footnote-13253954 -Ref: 0 15 Nov 15 2013-Footnote-14254011 -Ref: 0 15 Nov 15 2013-Footnote-15254068 -Ref: 0 15 Nov 15 2013-Footnote-16254125 -Ref: 0 15 Nov 15 2013-Footnote-17254182 -Ref: 0 15 Nov 15 2013-Footnote-18254239 -Ref: 0 15 Nov 15 2013-Footnote-19254296 -Ref: 0 15 Nov 15 2013-Footnote-20254353 -Ref: 0 15 Nov 15 2013-Footnote-21254410 -Ref: 0 15 Nov 15 2013-Footnote-22254467 -Ref: 0 15 Nov 15 2013-Footnote-23254524 -Ref: 0 15 Nov 15 2013-Footnote-24254581 -Ref: 0 15 Nov 15 2013-Footnote-25254638 -Ref: 0 15 Nov 15 2013-Footnote-26254695 -Ref: 0 15 Nov 15 2013-Footnote-27254752 -Ref: 0 15 Nov 15 2013-Footnote-28254809 -Ref: 0 15 Nov 15 2013-Footnote-29254866 -Ref: 0 15 Nov 15 2013-Footnote-30254923 -Node: 0 14 1 Aug 16 2013254980 -Ref: guide/releases/index grizzl255096 -Ref: 1e5255096 -Ref: guide/releases/index aug-16-2013255096 -Ref: 1e6255096 -Ref: 0 14 1 Aug 16 2013-Footnote-1255256 -Node: 0 14 Aug 15 2013255312 -Ref: guide/releases/index aug-15-2013255428 -Ref: 1e7255428 -Ref: 0 14 Aug 15 2013-Footnote-1258398 -Ref: 0 14 Aug 15 2013-Footnote-2258454 -Ref: 0 14 Aug 15 2013-Footnote-3258510 -Ref: 0 14 Aug 15 2013-Footnote-4258566 -Ref: 0 14 Aug 15 2013-Footnote-5258622 -Ref: 0 14 Aug 15 2013-Footnote-6258678 -Ref: 0 14 Aug 15 2013-Footnote-7258734 -Ref: 0 14 Aug 15 2013-Footnote-8258790 -Ref: 0 14 Aug 15 2013-Footnote-9258846 -Ref: 0 14 Aug 15 2013-Footnote-10258902 -Ref: 0 14 Aug 15 2013-Footnote-11258959 -Ref: 0 14 Aug 15 2013-Footnote-12259016 -Ref: 0 14 Aug 15 2013-Footnote-13259073 -Ref: 0 14 Aug 15 2013-Footnote-14259130 -Ref: 0 14 Aug 15 2013-Footnote-15259187 -Ref: 0 14 Aug 15 2013-Footnote-16259244 -Ref: 0 14 Aug 15 2013-Footnote-17259301 -Ref: 0 14 Aug 15 2013-Footnote-18259358 -Ref: 0 14 Aug 15 2013-Footnote-19259415 -Ref: 0 14 Aug 15 2013-Footnote-20259472 -Ref: 0 14 Aug 15 2013-Footnote-21259529 -Ref: 0 14 Aug 15 2013-Footnote-22259586 -Node: 0 13 Jun 28 2013259643 -Ref: guide/releases/index jun-28-2013259757 -Ref: 1e8259757 -Ref: 0 13 Jun 28 2013-Footnote-1262377 -Ref: 0 13 Jun 28 2013-Footnote-2262433 -Ref: 0 13 Jun 28 2013-Footnote-3262489 -Ref: 0 13 Jun 28 2013-Footnote-4262545 -Ref: 0 13 Jun 28 2013-Footnote-5262601 -Ref: 0 13 Jun 28 2013-Footnote-6262657 -Ref: 0 13 Jun 28 2013-Footnote-7262713 -Node: 0 12 May 18 2013262769 -Ref: guide/releases/index may-18-2013262883 -Ref: 1e9262883 -Ref: 0 12 May 18 2013-Footnote-1263712 -Ref: 0 12 May 18 2013-Footnote-2263768 -Ref: 0 12 May 18 2013-Footnote-3263824 -Ref: 0 12 May 18 2013-Footnote-4263880 -Node: 0 11 May 01 2013263936 -Ref: guide/releases/index may-01-2013264050 -Ref: 1ea264050 -Ref: 0 11 May 01 2013-Footnote-1265016 -Ref: 0 11 May 01 2013-Footnote-2265072 -Ref: 0 11 May 01 2013-Footnote-3265128 -Ref: 0 11 May 01 2013-Footnote-4265184 -Ref: 0 11 May 01 2013-Footnote-5265230 -Node: 0 10 Apr 21 2013265286 -Ref: guide/releases/index apr-21-2013265399 -Ref: 1eb265399 -Ref: guide/releases/index projectile265399 -Ref: 1ec265399 -Ref: 0 10 Apr 21 2013-Footnote-1267052 -Ref: 0 10 Apr 21 2013-Footnote-2267108 -Ref: 0 10 Apr 21 2013-Footnote-3267164 -Ref: 0 10 Apr 21 2013-Footnote-4267220 -Ref: 0 10 Apr 21 2013-Footnote-5267276 -Ref: 0 10 Apr 21 2013-Footnote-6267332 -Ref: 0 10 Apr 21 2013-Footnote-7267390 -Ref: 0 10 Apr 21 2013-Footnote-8267446 -Ref: 0 10 Apr 21 2013-Footnote-9267501 -Node: 0 9 Apr 13 2013267557 -Ref: guide/releases/index apr-13-2013267668 -Ref: 1ed267668 -Ref: guide/releases/index google-this267668 -Ref: 1ee267668 -Ref: 0 9 Apr 13 2013-Footnote-1268056 -Ref: 0 9 Apr 13 2013-Footnote-2268112 -Node: 0 8 Apr 9 2013268168 -Ref: guide/releases/index apr-9-2013268280 -Ref: 1ef268280 -Ref: 0 8 Apr 9 2013-Footnote-1269408 -Ref: 0 8 Apr 9 2013-Footnote-2269463 -Ref: 0 8 Apr 9 2013-Footnote-3269519 -Ref: 0 8 Apr 9 2013-Footnote-4269574 -Ref: 0 8 Apr 9 2013-Footnote-5269629 -Ref: 0 8 Apr 9 2013-Footnote-6269684 -Ref: 0 8 Apr 9 2013-Footnote-7269739 -Ref: 0 8 Apr 9 2013-Footnote-8269794 -Node: 0 7 1 Feb 23 2013269850 -Ref: guide/releases/index feb-23-2013269962 -Ref: 1f0269962 -Ref: 0 7 1 Feb 23 2013-Footnote-1270589 -Ref: 0 7 1 Feb 23 2013-Footnote-2270644 -Node: 0 7 Feb 14 2013270699 -Ref: guide/releases/index feb-14-2013270814 -Ref: 1f1270814 -Ref: 0 7 Feb 14 2013-Footnote-1271572 -Ref: 0 7 Feb 14 2013-Footnote-2271627 -Ref: 0 7 Feb 14 2013-Footnote-3271682 -Ref: 0 7 Feb 14 2013-Footnote-4271737 -Ref: 0 7 Feb 14 2013-Footnote-5271792 -Node: 0 6 1 Jan 30 2013271847 -Ref: guide/releases/index jan-30-2013271960 -Ref: 1f2271960 -Node: 0 6 Jan 29 2013272048 -Ref: guide/releases/index jan-29-2013272161 -Ref: 1f3272161 -Ref: 0 6 Jan 29 2013-Footnote-1274183 -Ref: 0 6 Jan 29 2013-Footnote-2274238 -Ref: 0 6 Jan 29 2013-Footnote-3274293 -Ref: 0 6 Jan 29 2013-Footnote-4274348 -Ref: 0 6 Jan 29 2013-Footnote-5274403 -Ref: 0 6 Jan 29 2013-Footnote-6274458 -Ref: 0 6 Jan 29 2013-Footnote-7274513 -Ref: 0 6 Jan 29 2013-Footnote-8274568 -Ref: 0 6 Jan 29 2013-Footnote-9274623 -Ref: 0 6 Jan 29 2013-Footnote-10274678 -Ref: 0 6 Jan 29 2013-Footnote-11274734 -Ref: 0 6 Jan 29 2013-Footnote-12274790 -Ref: 0 6 Jan 29 2013-Footnote-13274846 -Ref: 0 6 Jan 29 2013-Footnote-14274902 -Ref: 0 6 Jan 29 2013-Footnote-15274958 -Ref: 0 6 Jan 29 2013-Footnote-16275014 -Ref: 0 6 Jan 29 2013-Footnote-17275070 -Ref: 0 6 Jan 29 2013-Footnote-18275126 -Ref: 0 6 Jan 29 2013-Footnote-19275182 -Node: 0 5 Dec 28 2012275238 -Ref: guide/releases/index dec-28-2012275349 -Ref: 1f4275349 -Ref: 0 5 Dec 28 2012-Footnote-1276170 -Ref: 0 5 Dec 28 2012-Footnote-2276225 -Ref: 0 5 Dec 28 2012-Footnote-3276280 -Ref: 0 5 Dec 28 2012-Footnote-4276335 -Ref: 0 5 Dec 28 2012-Footnote-5276390 -Ref: 0 5 Dec 28 2012-Footnote-6276445 -Ref: 0 5 Dec 28 2012-Footnote-7276500 -Ref: 0 5 Dec 28 2012-Footnote-8276555 -Ref: 0 5 Dec 28 2012-Footnote-9276610 -Node: 0 4 Nov 21 2012276665 -Ref: guide/releases/index nov-21-2012276776 -Ref: 1f5276776 -Ref: guide/releases/index flymake-cursor276776 -Ref: 1f6276776 -Ref: 0 4 Nov 21 2012-Footnote-1277240 -Ref: 0 4 Nov 21 2012-Footnote-2277294 -Ref: 0 4 Nov 21 2012-Footnote-3277348 -Ref: 0 4 Nov 21 2012-Footnote-4277402 -Ref: 0 4 Nov 21 2012-Footnote-5277456 -Ref: 0 4 Nov 21 2012-Footnote-6277511 -Ref: 0 4 Nov 21 2012-Footnote-7277566 -Node: 0 3 Nov 21 2012277621 -Ref: guide/releases/index id2277732 -Ref: 1f7277732 -Ref: 0 3 Nov 21 2012-Footnote-1277910 -Node: 0 2 Oct 25 2012277964 -Ref: guide/releases/index oct-25-2012278075 -Ref: 1f8278075 -Ref: 0 2 Oct 25 2012-Footnote-1278283 -Node: 0 1 Oct 11 2012278337 -Ref: guide/releases/index oct-11-2012278424 -Ref: 1f9278424 -Node: Extending Flycheck278667 -Ref: dev/extending doc278774 -Ref: 1fa278774 -Ref: dev/extending extending-flycheck278774 -Ref: 1fb278774 -Node: Defining new syntax checkers279655 -Ref: dev/extending defining-new-syntax-checkers279784 -Ref: a279784 -Ref: dev/extending id1279784 -Ref: 1ff279784 -Ref: Defining new syntax checkers-Footnote-1284145 -Node: Finding the right error patterns284176 -Ref: dev/extending pylint284311 -Ref: 202284311 -Ref: dev/extending finding-the-right-error-patterns284311 -Ref: 203284311 -Ref: dev/extending el function flycheck-compile284896 -Ref: 19c284896 -Node: Trying a new syntax checker285541 -Ref: dev/extending trying-a-new-syntax-checker285716 -Ref: 205285716 -Node: Registering new syntax checkers286254 -Ref: dev/extending registering-new-syntax-checkers286388 -Ref: 206286388 -Ref: dev/extending id2286388 -Ref: 207286388 -Node: Advanced syntax checker definitions287888 -Ref: dev/extending advanced-syntax-checker-definitions288055 -Ref: 208288055 -Node: Parsing structured output format288336 -Ref: dev/extending id3288509 -Ref: 209288509 -Ref: dev/extending parsing-structured-output-format288509 -Ref: 204288509 -Ref: Parsing structured output format-Footnote-1289643 -Node: Passing options and configuration files to syntax checkers289674 -Ref: dev/extending passing-options-and-configuration-files-to-syntax-checkers289895 -Ref: 20b289895 -Ref: dev/extending jshint289895 -Ref: 20c289895 -Ref: Passing options and configuration files to syntax checkers-Footnote-1293139 -Ref: Passing options and configuration files to syntax checkers-Footnote-2293182 -Node: Controlling the use of a syntax checker293213 -Ref: dev/extending rubocop293439 -Ref: 20f293439 -Ref: dev/extending controlling-the-use-of-a-syntax-checker293439 -Ref: 210293439 -Node: Applying more than one syntax checker294370 -Ref: dev/extending applying-more-than-one-syntax-checker294529 -Ref: 211294529 -Ref: Applying more than one syntax checker-Footnote-1297837 -Node: Other ways to extend Flycheck297885 -Ref: dev/extending shellcheck298015 -Ref: 213298015 -Ref: dev/extending other-ways-to-extend-flycheck298015 -Ref: 214298015 -Node: Use arbitrary functions to check buffers298167 -Ref: dev/extending use-arbitrary-functions-to-check-buffers298305 -Ref: 215298305 -Node: Hooking into Flycheck298528 -Ref: dev/extending hooking-into-flycheck298666 -Ref: 216298666 -Node: Status changes298873 -Ref: dev/extending status-changes298972 -Ref: 217298972 -Ref: Status changes-Footnote-1299573 -Node: Error processing299634 -Ref: dev/extending error-processing299755 -Ref: 219299755 -Node: Error display301299 -Ref: dev/extending error-display301397 -Ref: 21c301397 -Ref: Error display-Footnote-1301683 -Node: Flycheck API301736 -Ref: dev/api flycheck-pos-tip301842 -Ref: 21d301842 -Ref: dev/api doc301842 -Ref: 21e301842 -Ref: dev/api flycheck-api301842 -Ref: 1fc301842 -Ref: dev/api id1301842 -Ref: 21f301842 -Node: Syntax checks302379 -Ref: dev/api syntax-checks302478 -Ref: 220302478 -Ref: dev/api api-syntax-checks302478 -Ref: 221302478 -Ref: dev/api el variable flycheck-after-syntax-check-hook303216 -Ref: 222303216 -Ref: dev/api el variable flycheck-before-syntax-check-hook304001 -Ref: 218304001 -Ref: dev/api el variable flycheck-syntax-check-failed-hook304588 -Ref: 223304588 -Node: Generic syntax checkers<2>305111 -Ref: dev/api generic-syntax-checkers305242 -Ref: 224305242 -Ref: dev/api api-generic-syntax-checkers305242 -Ref: 225305242 -Ref: dev/api el function flycheck-define-generic-checker305452 -Ref: 1b305452 -Ref: dev/api el function flycheck-registered-checker-p313293 -Ref: 66313293 -Ref: dev/api el function flycheck-add-mode313577 -Ref: 18c313577 -Ref: dev/api el function flycheck-add-next-checker313874 -Ref: 212313874 -Node: Status callback protocol314717 -Ref: dev/api status-callback-protocol314845 -Ref: 227314845 -Ref: dev/api api-status-callback-protocol314845 -Ref: 226314845 -Ref: dev/api el function status-callback315080 -Ref: 228315080 -Node: Predicates for syntax checkers316299 -Ref: dev/api predicates-for-syntax-checkers316449 -Ref: 229316449 -Ref: dev/api el function flycheck-buffer-saved-p316596 -Ref: 22a316596 -Node: Error filters316897 -Ref: dev/api error-filters317014 -Ref: 22b317014 -Ref: dev/api el function flycheck-sanitize-errors317135 -Ref: 22c317135 -Ref: dev/api el function flycheck-increment-error-columns317399 -Ref: 22d317399 -Ref: dev/api el function flycheck-collapse-error-message-whitespace317611 -Ref: 22e317611 -Ref: dev/api el function flycheck-dedent-error-messages317751 -Ref: 22f317751 -Ref: dev/api el function flycheck-fold-include-levels318056 -Ref: 230318056 -Ref: dev/api el function flycheck-dequalify-error-ids318536 -Ref: 17b318536 -Ref: dev/api el function flycheck-remove-error-ids319008 -Ref: 17c319008 -Node: Command syntax checkers319097 -Ref: dev/api api-command-syntax-checkers319221 -Ref: 231319221 -Ref: dev/api command-syntax-checkers319221 -Ref: 232319221 -Ref: dev/api el function flycheck-define-command-checker319523 -Ref: 177319523 -Ref: dev/api el function flycheck-def-executable-var322997 -Ref: 233322997 -Ref: dev/api el function flycheck-define-checker323796 -Ref: 19323796 -Node: Command arguments324351 -Ref: dev/api command-arguments324474 -Ref: 235324474 -Ref: dev/api el function flycheck-substitute-argument324768 -Ref: 201324768 -Node: Options for command syntax checkers329816 -Ref: dev/api options-for-command-syntax-checkers329995 -Ref: 237329995 -Ref: dev/api el function flycheck-def-option-var330183 -Ref: 20d330183 -Ref: dev/api el function flycheck-def-args-var330810 -Ref: 238330810 -Ref: dev/api el function flycheck-option-int331315 -Ref: 239331315 -Ref: dev/api el function flycheck-option-comma-separated-list331496 -Ref: 23a331496 -Node: Configuration files for command syntax checkers332102 -Ref: dev/api configuration-files-for-command-syntax-checkers332302 -Ref: 23b332302 -Ref: dev/api api-configuration-files332302 -Ref: 20e332302 -Ref: dev/api el function flycheck-def-config-file-var332503 -Ref: 23c332503 -Ref: dev/api el function flycheck-locate-config-file333287 -Ref: 236333287 -Node: Error parsing with regular expressions333614 -Ref: dev/api error-parsing-with-regular-expressions333792 -Ref: 23d333792 -Ref: dev/api el function flycheck-rx-to-string334189 -Ref: 200334189 -Ref: dev/api el function flycheck-parse-with-patterns335060 -Ref: 234335060 -Node: Error parsers335568 -Ref: dev/api error-parsers335690 -Ref: 23e335690 -Ref: dev/api api-error-parsers335690 -Ref: 20a335690 -Ref: dev/api el function flycheck-parse-checkstyle335915 -Ref: 17a335915 -Ref: dev/api el function flycheck-error-parser336358 -Ref: 23f336358 -Ref: dev/api el function flycheck-parse-xml-string336666 -Ref: 240336666 -Ref: Error parsers-Footnote-1337126 -Node: Errors337169 -Ref: dev/api errors337289 -Ref: 241337289 -Ref: dev/api api-errors337289 -Ref: 242337289 -Ref: dev/api el variable flycheck-current-errors337414 -Ref: 91337414 -Ref: dev/api el struct flycheck-error337754 -Ref: 169337754 -Ref: dev/api el function flycheck-error-buffer337879 -Ref: 167337879 -Ref: dev/api el function flycheck-error-checker337988 -Ref: 168337988 -Ref: dev/api el function flycheck-error-filename338068 -Ref: 243338068 -Ref: dev/api el function flycheck-error-line338158 -Ref: 244338158 -Ref: dev/api el function flycheck-error-column338241 -Ref: 245338241 -Ref: dev/api el function flycheck-error-message339101 -Ref: 246339101 -Ref: dev/api el function flycheck-error-level339180 -Ref: 247339180 -Ref: dev/api el function flycheck-error-id339341 -Ref: 179339341 -Ref: dev/api el function flycheck-error-new-at339618 -Ref: 248339618 -Ref: dev/api el function flycheck-error-new340644 -Ref: 249340644 -Ref: dev/api el function flycheck-error-with-buffer341106 -Ref: 24a341106 -Ref: dev/api el function flycheck-error-line-region341296 -Ref: 24b341296 -Ref: dev/api el function flycheck-error-column-region341615 -Ref: 24c341615 -Ref: dev/api el function flycheck-error-thing-region341954 -Ref: 24d341954 -Ref: dev/api el function flycheck-error-pos342437 -Ref: 24e342437 -Ref: dev/api el function flycheck-error-format342728 -Ref: 24f342728 -Ref: dev/api el function flycheck-error-<342938 -Ref: 250342938 -Ref: dev/api el function flycheck-error-level-<343113 -Ref: 251343113 -Node: Error processing<2>343496 -Ref: dev/api error-processing343583 -Ref: 252343583 -Ref: dev/api el variable flycheck-process-error-functions343632 -Ref: 21a343632 -Ref: dev/api el function flycheck-add-overlay343677 -Ref: 21b343677 -Node: Error analysis343714 -Ref: dev/api error-analysis343825 -Ref: 253343825 -Ref: dev/api el function flycheck-count-errors343936 -Ref: 92343936 -Ref: dev/api el function flycheck-has-errors-p344196 -Ref: 254344196 -Ref: dev/api el function flycheck-has-max-errors-p344299 -Ref: 255344299 -Ref: dev/api el function auto344340 -Ref: 256344340 -Node: Error levels<2>344361 -Ref: dev/api error-levels344444 -Ref: 257344444 -Ref: dev/api el function flycheck-define-error-level344771 -Ref: 27344771 -Ref: dev/api el function flycheck-error-level-p346548 -Ref: 8b346548 -Node: Flycheck buffer status346650 -Ref: dev/api api-flycheck-buffer-status346756 -Ref: 258346756 -Ref: dev/api flycheck-buffer-status346756 -Ref: 259346756 -Ref: dev/api el variable flycheck-status-changed-functions346813 -Ref: 19e346813 -Ref: dev/api el function flycheck-report-status347413 -Ref: 25a347413 -Ref: dev/api el variable flycheck-last-status-change348297 -Ref: 90348297 -Ref: dev/api el function flycheck-mode-line-status-text348480 -Ref: 8f348480 -Node: Utilities348699 -Ref: dev/api utilities348790 -Ref: 25b348790 -Ref: dev/api api-utilities348790 -Ref: 25c348790 -Ref: dev/api el function flycheck-string-list-p348821 -Ref: 99348821 -Ref: dev/api el function flycheck-symbol-list-p348909 -Ref: 61348909 -Node: Flycheck ERT API348997 -Ref: dev/test-api flycheck-ert-api349108 -Ref: 25d349108 -Ref: dev/test-api doc349108 -Ref: 25e349108 -Ref: dev/test-api flycheck-ert349108 -Ref: 17e349108 -Node: Compatibility349432 -Ref: dev/test-api compatibility349533 -Ref: 25f349533 -Node: Loading and initializing350003 -Ref: dev/test-api loading-and-initializing350125 -Ref: 260350125 -Ref: dev/test-api el function flycheck-ert-initialize350691 -Ref: 262350691 -Node: Utilities<2>350921 -Ref: dev/test-api utilities351049 -Ref: 264351049 -Node: Creating temporary buffers351230 -Ref: dev/test-api creating-temporary-buffers351339 -Ref: 265351339 -Ref: dev/test-api el function flycheck-ert-with-temp-buffer351408 -Ref: 266351408 -Ref: dev/test-api el function flycheck-ert-with-file-buffer351697 -Ref: 267351697 -Node: Scoping resource access351914 -Ref: dev/test-api scoping-resource-access352056 -Ref: 268352056 -Ref: dev/test-api el function flycheck-ert-with-help-buffer352119 -Ref: 269352119 -Ref: dev/test-api el function flycheck-ert-with-env352295 -Ref: 26a352295 -Ref: dev/test-api el function flycheck-ert-with-global-mode352661 -Ref: 26b352661 -Node: Accessing test resources352834 -Ref: dev/test-api test-resources352993 -Ref: 261352993 -Ref: dev/test-api accessing-test-resources352993 -Ref: 26c352993 -Ref: dev/test-api el function flycheck-ert-resource-filename353173 -Ref: 263353173 -Ref: dev/test-api el function flycheck-ert-with-resource-buffer353387 -Ref: 26d353387 -Ref: dev/test-api el function flycheck-ert-locate-config-file353644 -Ref: 26e353644 -Node: Obtaining information about the environment353792 -Ref: dev/test-api obtaining-information-about-the-environment353919 -Ref: 26f353919 -Ref: dev/test-api el variable flycheck-ert-user-error-type354022 -Ref: 270354022 -Ref: dev/test-api el function flycheck-ert-travis-ci-p354119 -Ref: 271354119 -Ref: dev/test-api el function flycheck-ert-check-gpg354213 -Ref: 272354213 -Ref: dev/test-api el function flycheck-ert-extract-version-command354290 -Ref: 273354290 -Node: Defining test cases354659 -Ref: dev/test-api defining-test-cases354754 -Ref: 274354754 -Ref: dev/test-api el function flycheck-ert-def-checker-test354930 -Ref: 275354930 -Node: Checking results of test cases356149 -Ref: dev/test-api checking-results-of-test-cases356284 -Ref: 276356284 -Ref: dev/test-api el function flycheck-ert-syntax-check-timed-out-p356484 -Ref: 277356484 -Node: Invoking syntax checkers in test cases356635 -Ref: dev/test-api invoking-syntax-checkers-in-test-cases356797 -Ref: 278356797 -Ref: dev/test-api el function flycheck-ert-buffer-sync356890 -Ref: 279356890 -Ref: dev/test-api el function flycheck-ert-ensure-clear356994 -Ref: 27a356994 -Node: Writing assertions357138 -Ref: dev/test-api writing-assertions357261 -Ref: 27b357261 -Ref: dev/test-api el function flycheck-ert-should-overlay357314 -Ref: 27c357314 -Ref: dev/test-api el function flycheck-ert-should-errors357470 -Ref: 27d357470 -Ref: dev/test-api el function flycheck-ert-should-syntax-check358111 -Ref: 27e358111 -Ref: dev/test-api el function flycheck-ert-at-nth-error359291 -Ref: 27f359291 -Node: Contribution guidelines359515 -Ref: contrib/guidelines doc359630 -Ref: 280359630 -Ref: contrib/guidelines contribution-guidelines359630 -Ref: 281359630 -Ref: Contribution guidelines-Footnote-1360017 -Node: Reporting issues360069 -Ref: contrib/guidelines id1360173 -Ref: 282360173 -Ref: contrib/guidelines reporting-issues360173 -Ref: 8d360173 -Ref: Reporting issues-Footnote-1360780 -Node: Contributing code360832 -Ref: contrib/guidelines id2360936 -Ref: 283360936 -Ref: contrib/guidelines contributing-code360936 -Ref: 1fd360936 -Node: General361224 -Ref: contrib/guidelines general361306 -Ref: 284361306 -Node: Code style361431 -Ref: contrib/guidelines code-style361537 -Ref: 285361537 -Node: Commit messages361964 -Ref: contrib/guidelines commit-messages362091 -Ref: 286362091 -Ref: Commit messages-Footnote-1363883 -Ref: Commit messages-Footnote-2363961 -Ref: Commit messages-Footnote-3364005 -Node: Contributing syntax checkers364045 -Ref: contrib/guidelines contributing-syntax-checkers364175 -Ref: 1fe364175 -Ref: contrib/guidelines id3364175 -Ref: 287364175 -Node: Pull requests364959 -Ref: contrib/guidelines id4365065 -Ref: 288365065 -Ref: contrib/guidelines pull-requests365065 -Ref: 289365065 -Ref: Pull requests-Footnote-1365660 -Node: Testing Flycheck365721 -Ref: contrib/testing testing-flycheck365841 -Ref: 28a365841 -Ref: contrib/testing doc365841 -Ref: 28b365841 -Ref: contrib/testing pull-request365841 -Ref: 28c365841 -Node: Test suite layout366176 -Ref: contrib/testing test-suite-layout366269 -Ref: 28d366269 -Node: Test running367121 -Ref: contrib/testing test-running367247 -Ref: 28e367247 -Ref: contrib/testing id1367247 -Ref: 28f367247 -Ref: Test running-Footnote-1368403 -Node: Virtual test environment368439 -Ref: contrib/testing id2368557 -Ref: 291368557 -Ref: contrib/testing virtual-test-environment368557 -Ref: 290368557 -Ref: Virtual test environment-Footnote-1370662 -Ref: Virtual test environment-Footnote-2370698 -Ref: Virtual test environment-Footnote-3370734 -Ref: Virtual test environment-Footnote-4370769 -Ref: Virtual test environment-Footnote-5370805 -Node: Travis CI370829 -Ref: contrib/testing homebrew370926 -Ref: 292370926 -Ref: contrib/testing travis-ci370926 -Ref: 293370926 -Node: Writing documentation371451 -Ref: contrib/docs writing-documentation371565 -Ref: 294371565 -Ref: contrib/docs doc371565 -Ref: 295371565 -Node: Build environment setup371792 -Ref: contrib/docs doc-build-env371909 -Ref: 296371909 -Ref: contrib/docs build-environment-setup371909 -Ref: 297371909 -Ref: Build environment setup-Footnote-1373056 -Ref: Build environment setup-Footnote-2373086 -Ref: Build environment setup-Footnote-3373148 -Ref: Build environment setup-Footnote-4373201 -Ref: Build environment setup-Footnote-5373230 -Node: Building HTML and Texinfo373284 -Ref: contrib/docs building-docs373430 -Ref: 298373430 -Ref: contrib/docs building-html-and-texinfo373430 -Ref: 299373430 -Ref: Building HTML and Texinfo-Footnote-1374171 -Node: Verifying references374197 -Ref: contrib/docs verifying-references374311 -Ref: 29a374311 -Node: Maintenance tasks374671 -Ref: contrib/maintenance maintenance-tasks374795 -Ref: 29b374795 -Ref: contrib/maintenance doc374795 -Ref: 29c374795 -Node: Rebuilding the Texinfo375031 -Ref: contrib/maintenance rebuilding-the-texinfo375139 -Ref: 29d375139 -Ref: Rebuilding the Texinfo-Footnote-1375642 -Node: Rasterized logo files375668 -Ref: contrib/maintenance rasterized-logo-files375776 -Ref: 29e375776 -Ref: contrib/maintenance melpa375776 -Ref: 29f375776 -Ref: Rasterized logo files-Footnote-1376552 -Ref: Rasterized logo files-Footnote-2376588 -Node: GNU General Public License376622 -Ref: gpl gnu-general-public-license376755 -Ref: 2a0376755 -Ref: gpl doc376755 -Ref: 2a1376755 -Ref: gpl inkscape376755 -Ref: 2a2376755 -Node: GNU Free Documentation License414729 -Ref: fdl doc414850 -Ref: 2a3414850 -Ref: fdl gnu-free-documentation-license414850 -Ref: 2a4414850 -Node: Index439738 - -End Tag Table - - -Local Variables: -coding: utf-8 -End: diff --git a/elpa/flycheck-20150125.601/flycheck.info-1 b/elpa/flycheck-20150125.601/flycheck.info-1 deleted file mode 100644 index 568c1f68..00000000 --- a/elpa/flycheck-20150125.601/flycheck.info-1 +++ /dev/null @@ -1,9340 +0,0 @@ -This is flycheck.info, produced by makeinfo version 5.2 from -flycheck.texi. - -This manual is for Flycheck version 0.23-cvs. - -Copyright © 2014-2015 Sebastian Wiesner - - Permission is granted to copy, distribute and/or modify this - documentation 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.”. - - 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 - . - -INFO-DIR-SECTION Emacs -START-INFO-DIR-ENTRY -* flycheck: (flycheck.info). On the fly syntax checking for GNU Emacs -END-INFO-DIR-ENTRY - - - Generated by Sphinx 1.2.3. - - -File: flycheck.info, Node: Top, Next: Introduction, Up: (dir) - -Flycheck -******** - -This manual is for Flycheck version 0.23-cvs. - -Copyright © 2014-2015 Sebastian Wiesner - - Permission is granted to copy, distribute and/or modify this - documentation 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.”. - - 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 - . - -* Menu: - -* Introduction:: -* Flycheck versus Flymake:: -* Installation:: -* Quickstart:: -* Usage:: -* Supported languages:: -* Glossary:: -* Flycheck releases:: -* Extending Flycheck:: -* Flycheck API:: -* Flycheck ERT API:: -* Contribution guidelines:: -* Testing Flycheck:: -* Writing documentation:: -* Maintenance tasks:: -* GNU General Public License:: -* GNU Free Documentation License:: -* Index:: - - — The Detailed Node Listing — - -Introduction - -* Features:: -* 3rd party extensions:: - -Flycheck versus Flymake - -* Overview:: -* Detailed review:: - -Detailed review - -* Relation to Emacs:: -* Enabling syntax checking:: -* Syntax checkers:: -* Functions as syntax checkers:: -* Customization of syntax checkers:: -* Syntax checker selection:: -* Error levels:: -* Error identifiers:: -* Error parsing:: -* Error message display:: -* Error list:: -* Resource consumption:: -* Unit tests:: - -Syntax checkers - -* Built-in syntax checkers:: -* Definition of new syntax checkers:: - -Customization of syntax checkers - -* Executables of syntax checkers:: - -Syntax checker selection - -* Custom predicates:: -* Manual selection:: -* Multiple syntax checkers per buffer:: - -Resource consumption - -* Syntax checking:: -* Checking for changes:: - -Installation - -* Prerequisites:: -* Package installation:: -* Setup:: - -Prerequisites - -* Emacs:: -* Operating system:: -* Syntax checking tools:: - -Package installation - -* Manual:: -* Cask:: - -Quickstart - -* Enable Flycheck:: -* Install some syntax checker tools:: -* Check syntax in a buffer:: -* Navigate and list errors:: -* Explore the menu:: -* Further reading:: - -Usage - -* Enabling syntax checking: Enabling syntax checking<2>. -* Checking buffers:: -* Selecting syntax checkers:: -* Configuring syntax checkers:: -* Error reporting:: -* Listing errors:: -* Copying (killing) errors: Copying killing errors. -* Navigating and jumping to errors:: -* Mode line reporting:: - -Configuring syntax checkers - -* Syntax checker executables:: -* Syntax checker options:: -* Syntax checker configuration files:: - -Supported languages - -* Ada:: -* AsciiDoc:: -* C/C++:: -* CFEngine:: -* Chef:: -* Coffeescript:: -* Coq:: -* CSS:: -* D:: -* Elixir:: -* Emacs Lisp:: -* Erlang:: -* ERuby:: -* Fortran:: -* Go:: -* Haml:: -* Handlebars:: -* Haskell:: -* HTML:: -* Javascript:: -* JSON:: -* LESS:: -* Lua:: -* Make:: -* Perl:: -* PHP:: -* Puppet:: -* Python:: -* R:: -* Racket:: -* RPM SPEC:: -* ReStructuredText:: -* Ruby:: -* Rust:: -* Sass:: -* Scala:: -* Scss:: -* Shell script languages:: -* Slim:: -* TeX/LaTeX:: -* Texinfo:: -* Verilog:: -* XML:: -* YAML:: - -Flycheck releases - -* Release announcements:: -* Changelog:: - -Release announcements - -* Flycheck 0.22: Flycheck 0 22. -* Flycheck 0.21: Flycheck 0 21. -* Flycheck 0.20: Flycheck 0 20. -* Flycheck 0.19: Flycheck 0 19. -* Flycheck 0.18: Flycheck 0 18. -* Flycheck 0.17: Flycheck 0 17. -* Flycheck 0.16: Flycheck 0 16. -* Flycheck 0.15: Flycheck 0 15. - -Flycheck 0.22 - -* Breaking changes:: -* Setup: Setup<2>. -* Language support:: -* Syntax checking improvements:: -* Error list improvements:: -* Generic syntax checkers:: -* Error IDs:: -* Unit test library for Flycheck:: - -Language support - -* Ada: Ada<2>. -* C/C++: C/C++<2>. -* Emacs Lisp: Emacs Lisp<2>. -* Haskell: Haskell<2>. -* Fortran: Fortran<2>. -* Python: Python<2>. -* Rust: Rust<2>. -* TeX/LaTeX: TeX/LaTeX<2>. - -Flycheck 0.21 - -* Breaking changes: Breaking changes<2>. -* Language support: Language support<2>. -* Error list changes:: -* Error navigation and display:: -* Syntax checker definition and extension:: -* Obtaining the new release:: - -Language support - -* C/C++: C/C++<3>. -* D: D<2>. -* Go: Go<2>. -* HTML: HTML<2>. -* Less:: -* Shell scripts:: - -Flycheck 0.20 - -* Breaking changes: Breaking changes<3>. -* Language support: Language support<3>. -* Error list improvements: Error list improvements<2>. -* User interface improvements:: -* Miscellaneous new features:: -* Miscellaneous fixes:: -* Get it:: - -Language support - -* C/C++: C/C++<4>. -* Rust: Rust<3>. -* Scala: Scala<2>. -* Sass/SCSS:: -* Javascript: Javascript<2>. -* Ruby: Ruby<2>. - -Flycheck 0.19 - -* Breaking changes: Breaking changes<4>. -* Languages:: -* New features:: -* Bug fixes:: -* Misc changes:: -* Get it: Get it<2>. - -Languages - -* C/C++: C/C++<5>. -* Emacs Lisp: Emacs Lisp<3>. -* Go: Go<3>. -* Haskell: Haskell<3>. -* Rust: Rust<4>. - -Flycheck 0.18 - -* Breaking changes: Breaking changes<5>. -* Syntax checkers: Syntax checkers<2>. -* Bug fixes: Bug fixes<2>. -* Get it: Get it<3>. - -Flycheck 0.17 - -* Breaking changes: Breaking changes<6>. -* New online manual:: -* Syntax checkers: Syntax checkers<3>. -* Extending syntax checkers:: -* Other bug fixes and improvements:: - -Flycheck 0.16 - -* Breaking changes: Breaking changes<7>. -* Syntax checkers: Syntax checkers<4>. -* New features: New features<2>. -* Improved error list:: -* Get it: Get it<4>. - -Syntax checkers - -* New languages and checkers:: -* Better Haskell support:: -* Miscellaneous new options:: - -New features - -* Syntax checker executables: Syntax checker executables<2>. -* Disable syntax checkers easily:: - -Flycheck 0.15 - -* Breaking changes: Breaking changes<8>. -* New syntax checkers:: -* New error list:: -* C/C++ support:: -* New info level messages:: -* Custom error levels:: -* Other improvements:: -* Get it: Get it<5>. - -Changelog - -* master (in development): master in development. -* 0.22 (Dec 23, 2014): 0 22 Dec 23 2014. -* 0.21 (Oct 26, 2014): 0 21 Oct 26 2014. -* 0.20 (Aug 12, 2014): 0 20 Aug 12 2014. -* 0.19 (Jun 12, 2014): 0 19 Jun 12 2014. -* 0.18 (Mar 24, 2014): 0 18 Mar 24 2014. -* 0.17 (Feb 1, 2014): 0 17 Feb 1 2014. -* 0.16 (Jan 11, 2014): 0 16 Jan 11 2014. -* 0.15 (Nov 15, 2013): 0 15 Nov 15 2013. -* 0.14.1 (Aug 16, 2013): 0 14 1 Aug 16 2013. -* 0.14 (Aug 15, 2013): 0 14 Aug 15 2013. -* 0.13 (Jun 28, 2013): 0 13 Jun 28 2013. -* 0.12 (May 18, 2013): 0 12 May 18 2013. -* 0.11 (May 01, 2013): 0 11 May 01 2013. -* 0.10 (Apr 21, 2013): 0 10 Apr 21 2013. -* 0.9 (Apr 13, 2013): 0 9 Apr 13 2013. -* 0.8 (Apr 9, 2013): 0 8 Apr 9 2013. -* 0.7.1 (Feb 23, 2013): 0 7 1 Feb 23 2013. -* 0.7 (Feb 14, 2013): 0 7 Feb 14 2013. -* 0.6.1 (Jan 30, 2013): 0 6 1 Jan 30 2013. -* 0.6 (Jan 29, 2013): 0 6 Jan 29 2013. -* 0.5 (Dec 28, 2012): 0 5 Dec 28 2012. -* 0.4 (Nov 21, 2012): 0 4 Nov 21 2012. -* 0.3 (Nov 21, 2012): 0 3 Nov 21 2012. -* 0.2 (Oct 25, 2012): 0 2 Oct 25 2012. -* 0.1 (Oct 11, 2012): 0 1 Oct 11 2012. - -Extending Flycheck - -* Defining new syntax checkers:: -* Advanced syntax checker definitions:: -* Other ways to extend Flycheck:: - -Defining new syntax checkers - -* Finding the right error patterns:: -* Trying a new syntax checker:: -* Registering new syntax checkers:: - -Advanced syntax checker definitions - -* Parsing structured output format:: -* Passing options and configuration files to syntax checkers:: -* Controlling the use of a syntax checker:: -* Applying more than one syntax checker:: - -Other ways to extend Flycheck - -* Use arbitrary functions to check buffers:: -* Hooking into Flycheck:: - -Hooking into Flycheck - -* Status changes:: -* Error processing:: -* Error display:: - -Flycheck API - -* Syntax checks:: -* Generic syntax checkers: Generic syntax checkers<2>. -* Command syntax checkers:: -* Errors:: -* Flycheck buffer status:: -* Utilities:: - -Generic syntax checkers - -* Status callback protocol:: -* Predicates for syntax checkers:: -* Error filters:: - -Command syntax checkers - -* Command arguments:: -* Options for command syntax checkers:: -* Configuration files for command syntax checkers:: -* Error parsing with regular expressions:: -* Error parsers:: - -Errors - -* Error processing: Error processing<2>. -* Error analysis:: -* Error levels: Error levels<2>. - -Flycheck ERT API - -* Compatibility:: -* Loading and initializing:: -* Utilities: Utilities<2>. -* Defining test cases:: - -Utilities - -* Creating temporary buffers:: -* Scoping resource access:: -* Accessing test resources:: -* Obtaining information about the environment:: - -Defining test cases - -* Checking results of test cases:: -* Invoking syntax checkers in test cases:: -* Writing assertions:: - -Contribution guidelines - -* Reporting issues:: -* Contributing code:: - -Contributing code - -* General:: -* Code style:: -* Commit messages:: -* Contributing syntax checkers:: -* Pull requests:: - -Testing Flycheck - -* Test suite layout:: -* Test running:: -* Virtual test environment:: -* Travis CI:: - -Writing documentation - -* Build environment setup:: -* Building HTML and Texinfo:: -* Verifying references:: - -Maintenance tasks - -* Rebuilding the Texinfo:: -* Rasterized logo files:: - - - -File: flycheck.info, Node: Introduction, Next: Flycheck versus Flymake, Prev: Top, Up: Top - -1 Introduction -************** - -Flycheck is a 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. - -It uses various syntax checking and linting tools to automatically check -the contents of buffers while you type, and reports warnings and errors -directly in the buffer, or in an optional error list. - -* Menu: - -* Features:: -* 3rd party extensions:: - - -File: flycheck.info, Node: Features, Next: 3rd party extensions, Up: Introduction - -1.1 Features -============ - - - 44 languages with 74 syntax checkers, see *note Supported - languages: 5. - - - *note Fully automatic, fail-safe, on-the-fly syntax checking in - background: 6. - - - *note Nice error indication and highlighting: 7. - - - Optional error list popup - - - *note Many customization options: 8. - - - *note A comprehensive manual: 9. - - - *note A simple API to define new syntax checkers: a. - - - A “doesn’t get in your way” guarantee - - -File: flycheck.info, Node: 3rd party extensions, Prev: Features, Up: Introduction - -1.2 3rd party extensions -======================== - -The following extensions provide additional cool features for Flycheck: - - - flycheck-cask(1) makes Flycheck use Cask packages in Cask(2) - projects. - - - flycheck-color-mode-line(3) colors the mode line according to the - Flycheck status. - - - flycheck-d-unittest(4) adds a Flycheck checker to run unit tests - for D programs on the fly. - - - flycheck-google-cpplint(5) adds a syntax checker for Google’s C++ - style checker. - - - flycheck-haskell(6) improves Haskell support in Flycheck, by - configuring Flycheck according to the current Cabal project, and - using Cabal sandbox packages. - - - flycheck-hdevtools(7) adds a Flycheck syntax checker for Haskell - based on hdevtools(8). - - - flycheck-irony(9) adds a Flycheck syntax checker for C, C++ and - Objective C using Irony Mode(10). - - - flycheck-ledger(11) adds a syntax checker for the Ledger(12) - accounting tool. - - - flycheck-mercury(13) adds a Flycheck syntax checker for the Mercury - Language(14). - - - flycheck-ocaml(15) adds a syntax checker for OCaml. - - - flycheck-pos-tip(16) shows Flycheck error messages in a popup. - - - flycheck-pyflakes(17) adds a Python syntax checker using Pyflakes. - - - flycheck-rust(18) improves Rust support in Flycheck, by configuring - Flycheck according to Cargo settings and layouts. - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck-cask - - (2) https://github.com/cask/cask - - (3) https://github.com/flycheck/flycheck-color-mode-line - - (4) https://github.com/flycheck/flycheck-d-unittest - - (5) https://github.com/flycheck/flycheck-google-cpplint - - (6) https://github.com/flycheck/flycheck-haskell - - (7) https://github.com/flycheck/flycheck-hdevtools - - (8) https://github.com/bitc/hdevtools/ - - (9) https://github.com/Sarcasm/flycheck-irony - - (10) https://github.com/Sarcasm/irony-mode - - (11) https://github.com/purcell/flycheck-ledger - - (12) http://ledger-cli.org/ - - (13) https://github.com/flycheck/flycheck-mercury - - (14) http://mercurylang.org/ - - (15) https://github.com/flycheck/flycheck-ocaml - - (16) https://github.com/flycheck/flycheck-pos-tip - - (17) https://github.com/Wilfred/flycheck-pyflakes - - (18) https://github.com/flycheck/flycheck-rust - - -File: flycheck.info, Node: Flycheck versus Flymake, Next: Installation, Prev: Introduction, Up: Top - -2 Flycheck versus Flymake -************************* - -This article provides information about Flycheck compares to the -_built-in_ Flymake mode. It does not consider the improved Flymake -fork(1) or third-party extensions such as flymake-easy(2) or -flymake-cursor(3), but references them at appropriate places. - -We aim for this comparison to be neutral and complete, but do not -provide any guarantee for completeness or correctness of the following -information. Moreover, we consider Flycheck superior to Flymake in all -aspects. As such, you may find this page biased towards Flycheck. -Please excuse this as well as any factual mistake or lack of -information. Please suggest improvements. - -* Menu: - -* Overview:: -* Detailed review:: - - ---------- Footnotes ---------- - - (1) https://github.com/illusori/emacs-flymake - - (2) https://github.com/purcell/flymake-easy - - (3) http://www.emacswiki.org/emacs/flymake-cursor.el - - -File: flycheck.info, Node: Overview, Next: Detailed review, Up: Flycheck versus Flymake - -2.1 Overview -============ - -This table intends to give an overview about the differences and -similarities between Flycheck and the default install of Flymake. It is -not a direct comparision to third-party extensions such as flymake-easy, -flymake-cursor, or forks of Flymake. For a more comprehensive look -compared to those extensions, please read the details in the main -article and the footnotes. - -Please do _not_ only use this table to make your personal judgment, but -also read the detailed review in the following sections, at least with -regards to the features you are interested in. - - Flycheck Flymake - - -Supported Emacs versions 24+ 22+ - - -Built-in no (1) yes - - -Automatically enabled in supported yes no -languages - -Checks after save, newline, change save, newline, change - - -Checks in background yes yes - - -Automatic syntax checker selection By major mode and By file name patterns - custom predicates (2) - - -Manual syntax checker selection yes *no* - - -Multiple syntax checkers per buffer yes *no* (3) - - -Supported languages > 30 ~5 (4) - - -Checking remote files via Tramp no partly? - - -Definition of new syntax checkers Via a single By a function - declarative macro definition and various - variables (5) - - -Functions as syntax checkers yes *no* - - -Customization of syntax checkers yes no - - -Error levels Errors, warnings, Errors and warnings (6) - information, and custom - levels - - -Error identifiers yes no - - -Error parsing Regular expressions, or Regular expressions - custom error parsers - (e.g. XML, JSON, etc.) - - -Multiline error messages yes *no* (7) - - -Error highlighting in the buffer yes yes - - -Fringe icons for errors yes yes - - -Error messages display Via tooltip and echo In tooltip (8) - area, fully - customizable - - -List all errors in the buffer yes *no* - - -Resource consumption low high (9) - - -Unit tests all syntax checkers, *none?* - and large parts of the - underlying processing - - - ---------- Footnotes ---------- - - (1) Flycheck is *unlikely to ever become part of Emacs*. - - (2) The 3rd party library flymake-easy -(https://github.com/purcell/flymake-easy) allows to use syntax checkers -per major mode. - - (3) Various 3rd party packages thus use custom shell scripts to call -multiple syntax checking tools at once. - - (4) However, the Flymake page -(http://www.emacswiki.org/emacs/FlyMake) in the EmacsWiki provides -recipes for many other languages, although of varying quality. -Furthermore, the popular ELPA archive MELPA provides many packages which -add more languages to Flymake. There is also a Flymake fork -(https://github.com/illusori/emacs-flymake), which supports more -languages out of the box, among other fixes and improvements. - - (5) flymake-easy (https://github.com/purcell/flymake-easy) provides a -function to define a new syntax checker, which sets all required -variables at once. - - (6) The Flymake fork (https://github.com/illusori/emacs-flymake) adds -support for info messages. - - (7) flymake-easy (https://github.com/purcell/flymake-easy) -_overrides_ internal functions of Flymake to add support for multiline -error messages. - - (8) The 3rd party library flymake-cursor -(http://www.emacswiki.org/emacs/flymake-cursor.el) shows Flymake error -messages at point in the echo area. - - (9) A third-party Flymake fork -(https://github.com/illusori/emacs-flymake) mostly fixes the performance -and resource consumption issues in Flymake. - - -File: flycheck.info, Node: Detailed review, Prev: Overview, Up: Flycheck versus Flymake - -2.2 Detailed review -=================== - -* Menu: - -* Relation to Emacs:: -* Enabling syntax checking:: -* Syntax checkers:: -* Functions as syntax checkers:: -* Customization of syntax checkers:: -* Syntax checker selection:: -* Error levels:: -* Error identifiers:: -* Error parsing:: -* Error message display:: -* Error list:: -* Resource consumption:: -* Unit tests:: - - -File: flycheck.info, Node: Relation to Emacs, Next: Enabling syntax checking, Up: Detailed review - -2.2.1 Relation to Emacs ------------------------ - -*Flymake* is part of GNU Emacs since GNU Emacs 22. As such, -contributions to Flymake are subject to the FSF policies on GNU -projects. Most notably, contributors are required to assign their -copyright to the FSF by signing a contributor agreement. - -*Flycheck* is not part of GNU Emacs, and is *unlikely to ever be*. -However, it is free software as well, and publicly developed on the -well-known code hosting platform Github(1). Contributing to Flycheck -does not require a copyright assignments. - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck - - -File: flycheck.info, Node: Enabling syntax checking, Next: Syntax checkers, Prev: Relation to Emacs, Up: Detailed review - -2.2.2 Enabling syntax checking ------------------------------- - -*Flymake* is not enabled automatically for supported languages. It must -be be enabled for each mode individually and *carefully*, because it -does not deal well with unavailable syntax checker tools. In a GUI -frame, it signals errors in GUI dialogs. In a TTY frame, it does not -signal any error at all, but instead silently hangs. The same occurs, -when a syntax checker tool becomes unavailable after Flymake Mode is -enabled, for instance, because the underlying tool was uninstalled. - -The third-party library flymake-easy(1) provides an alternate way to -enable Flymake Mode, which gracefully handles unavailable syntax -checkers. It does not check whether the tool still exists before a -syntax check, though, and thus does still exposes above behavior, when a -tool becomes unavailable after the mode was enabled. - -*Flycheck* provides a global mode (see *note global-flycheck-mode: 15.), -which enables syntax checking in every supported language. If a syntax -checking tool is not available, Flycheck fails gracefully, does not -enable syntax checking, and just indicates the failure in the mode line. - - ---------- Footnotes ---------- - - (1) https://github.com/purcell/flymake-easy - - -File: flycheck.info, Node: Syntax checkers, Next: Functions as syntax checkers, Prev: Enabling syntax checking, Up: Detailed review - -2.2.3 Syntax checkers ---------------------- - -* Menu: - -* Built-in syntax checkers:: -* Definition of new syntax checkers:: - - -File: flycheck.info, Node: Built-in syntax checkers, Next: Definition of new syntax checkers, Up: Syntax checkers - -2.2.3.1 Built-in syntax checkers -................................ - -*Flymake* supports Java, Makefiles, Perl, PHP, TeX/LaTeX and XML. -Notably, it does _not_ support Emacs Lisp. A third-party Flymake -fork(1) supports more languages, though. Furthermore there are many -recipes for other languages on the Flymake page(2) in the EmacsWiki, and -many extension packages for other languages in the popular ELPA archive -MELPA(3). - -*Flycheck* provides support for 44 languages (see *note Supported -languages: 5.) with 74 syntax checkers, most of them contributed by the -community. Notably, Flycheck does _not_ support Java and Makefiles. - - ---------- Footnotes ---------- - - (1) https://github.com/illusori/emacs-flymake - - (2) http://www.emacswiki.org/emacs/FlyMake - - (3) http://melpa.org/ - - -File: flycheck.info, Node: Definition of new syntax checkers, Prev: Built-in syntax checkers, Up: Syntax checkers - -2.2.3.2 Definition of new syntax checkers -......................................... - -*Flymake* does not provide a single function to define a new syntax -checker. Instead, one has to define an “init” function, which returns -the command, and add this function to ‘flymake-allowed-file-name-masks’. -Additionally, one has to add the error patterns to -‘flymake-err-line-patterns’. As such, defining a syntax checker is -difficult for users who are not familiar with Emacs Lisp. -flymake-easy(1) provides an easier way to define new syntax checkers, -though. - -*Flycheck* provides a single function *note flycheck-define-checker: 19. -to define a new syntax checker. This function uses a declarative -syntax, which is easy to understand even for users unfamiliar with Emacs -Lisp. In fact, many syntax checkers in Flycheck were contributed by the -community(2). - -For example, the Perl checker in Flymake is defined as follows. - - (defun flymake-perl-init () - (let* ((temp-file (flymake-init-create-temp-buffer-copy - 'flymake-create-temp-inplace)) - (local-file (file-relative-name - temp-file - (file-name-directory buffer-file-name)))) - (list "perl" (list "-wc " local-file)))) - - (defcustom flymake-allowed-file-name-masks - '(;; … - ("\\.p[ml]\\'" flymake-perl-init) - ;; … - )) - - (defvar flymake-err-line-patterns ; regexp file-idx line-idx col-idx (optional) text-idx(optional), match-end to end of string is error text - (append - '(;; … - ;; perl - ("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1) - ;; … - ) - ;; … - )) - -Whereas Flycheck’s definition of the same checker looks like this: - - (flycheck-define-checker perl - "A Perl syntax checker using the Perl interpreter. - - See URL `http://www.perl.org'." - :command ("perl" "-w" "-c" source) - :error-patterns - ((error line-start (minimal-match (message)) - " at " (file-name) " line " line - (or "." (and ", " (zero-or-more not-newline))) line-end)) - :modes (perl-mode cperl-mode)) - - ---------- Footnotes ---------- - - (1) https://github.com/purcell/flymake-easy - - (2) -https://github.com/flycheck/flycheck/issues?labels=checker&milestone=&page=1&state=closed - - -File: flycheck.info, Node: Functions as syntax checkers, Next: Customization of syntax checkers, Prev: Syntax checkers, Up: Detailed review - -2.2.4 Functions as syntax checkers ----------------------------------- - -*Flymake* cannot check a buffer with a custom Emacs Lisp function. - -*Flycheck* provides the *note flycheck-define-generic-checker: 1b. -function to define a syntax checker based on an arbitrary Emacs Lisp -function. Flycheck supports synchronous as well as asynchronous -functions, and provides simple callback-based protocol to communicate -the status of syntax checks. This allows Flycheck to use persistent -background processes for syntax checking. For instance, -flycheck-ocaml(1) uses a running Merlin(2) process to check OCaml -buffers, which is much easier and faster than invoking the OCaml -compiler. - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck-ocaml - - (2) https://github.com/the-lambda-church/merlin - - -File: flycheck.info, Node: Customization of syntax checkers, Next: Syntax checker selection, Prev: Functions as syntax checkers, Up: Detailed review - -2.2.5 Customization of syntax checkers --------------------------------------- - -*Flymake* does not provide built-in means to customize syntax checkers. -Instead, when defining a new syntax checker, the user needs to declare -customization variables explicitly and explicitly check their value in -the init function. - -*Flycheck* provides built-in functions to add customization variables to -syntax checkers and splice the value of these variables into the -argument list of a syntax checking tool. Many syntax checkers in -Flycheck provide customization variables. For instance, you can -customize the enabled warnings for C with *note flycheck-clang-warnings: -1d. Flycheck also tries to automatically find configuration files for -syntax checkers. - -* Menu: - -* Executables of syntax checkers:: - - -File: flycheck.info, Node: Executables of syntax checkers, Up: Customization of syntax checkers - -2.2.5.1 Executables of syntax checkers -...................................... - -*Flymake* does not provide built-in means to change the executable of a -syntax checker. - -*Flycheck* implicitly defines a variable to set the path of a syntax -checker tool for each defined syntax checker, and provides the -interactive command *note flycheck-set-checker-executable: 1f. to change -the executable used in a buffer. - - -File: flycheck.info, Node: Syntax checker selection, Next: Error levels, Prev: Customization of syntax checkers, Up: Detailed review - -2.2.6 Syntax checker selection ------------------------------- - -*Flymake* selects syntax checkers based on file name patterns in -‘flymake-allowed-file-name-masks’. Effectively, this duplicates the -existing logic Emacs uses to choose the right major mode, but lacks its -flexibility and power. For instance, Flymake cannot pick a syntax -checker based on the shebang of a file. - -*Flycheck* uses the major mode to select a syntax checker. This reuses -the existing sophisticated logic Emcas uses to choose and configure -major modes. Flycheck can easily select a Python syntax checker for a -Python script without file extension, but with proper shebang, simply -because Emacs correctly chooses Python Mode for such a file. - -* Menu: - -* Custom predicates:: -* Manual selection:: -* Multiple syntax checkers per buffer:: - - -File: flycheck.info, Node: Custom predicates, Next: Manual selection, Up: Syntax checker selection - -2.2.6.1 Custom predicates -......................... - -*Flymake* does not allow for custom predicates to implement more complex -logic for syntax checker selection. For instance, Flymake cannot use -different syntax checkers for buffer depending on the value of a local -variable. - -However, flymake-easy(1) patches Flymake to allow for custom syntax -checkers per buffer. This does not happen automatically though. The -user still needs to explicitly register a syntax checker in a major mode -hook. - -*Flycheck* supports custom predicate function. It uses these to -implement the shell script syntax checkers, for instance. Emacs uses a -single major mode for various shell script types (e.g. Bash, Zsh, POSIX -Shell, etc.), so Flycheck additionally uses a custom predicate to look -at the value of the variable ‘sh-shell’ in Sh Mode buffers, to determine -which shell to use for syntax checking. - - ---------- Footnotes ---------- - - (1) https://github.com/purcell/flymake-easy - - -File: flycheck.info, Node: Manual selection, Next: Multiple syntax checkers per buffer, Prev: Custom predicates, Up: Syntax checker selection - -2.2.6.2 Manual selection -........................ - -*Flymake* does not provide means to manually select a specific syntax -checker, either interactively, or via local variables. - -*Flycheck* provides the local variable *note flycheck-checker: 23. to -explicitly use a specific syntax checker for a buffer, and the command -*note flycheck-select-checker: 24. to set this variable interactively. - - -File: flycheck.info, Node: Multiple syntax checkers per buffer, Prev: Manual selection, Up: Syntax checker selection - -2.2.6.3 Multiple syntax checkers per buffer -........................................... - -*Flymake* can only use a single syntax checker per buffer. Effectively, -the user can only use a single tool to check a buffer, for instance -either PHP Mess Detector or PHP CheckStyle. Third party extensions to -Flycheck work around this limitation by supplying custom shell scripts -to call multiple syntax checking tools at once. - -*Flycheck* can easily apply multiple syntax checkers per buffer. For -instance, Flycheck will check PHP files with PHP CLI first to find -syntax errors, then with PHP MessDetector to additionally find idiomatic -and semantic errors, and eventually with PHP CheckStyle to find -stylistic errors. The user will see all errors reported by all of these -utilities in the buffer. - - -File: flycheck.info, Node: Error levels, Next: Error identifiers, Prev: Syntax checker selection, Up: Detailed review - -2.2.7 Error levels ------------------- - -*Flymake* supports error and warning messages. The pattern of warning -messages is _hard-coded_ in Emacs 24.3, and only became customizable in -upcoming Emacs 24.4. The patterns to parse messages are kept separate -from the actual syntax checker. - -The third-party Flymake fork(1) also supports info messages, and makes -the pattern of warning messages customizable as well. - -*Flycheck* supports error, warning and info messages. The patterns to -parse messages of different levels are part of the syntax checker -definition, and thus specific to each syntax checker. Flycheck allows -to define new error levels for use in custom syntax checkers with *note -flycheck-define-error-level: 27. - - ---------- Footnotes ---------- - - (1) https://github.com/illusori/emacs-flymake - - -File: flycheck.info, Node: Error identifiers, Next: Error parsing, Prev: Error levels, Up: Detailed review - -2.2.8 Error identifiers ------------------------ - -*Flymake* does not support unique identifiers for different kinds of -errors. - -*Flycheck* supports unique identifiers for different kinds of errors, if -a syntax checker provides these. The identifiers appear in the error -list and in error display, and can be copied independently, for instance -for use in an inline suppression comment, or to search the web for a -particular kind of error. - - -File: flycheck.info, Node: Error parsing, Next: Error message display, Prev: Error identifiers, Up: Detailed review - -2.2.9 Error parsing -------------------- - -*Flymake* parses the output of syntax checker tools with regular -expressions only. As it splits the output by lines regardless of the -regular expressions, it does not support error messages spanning -multiple lines (such as returned by the Emacs Lisp byte compiler or by -the Glasgow Haskell Compiler). - -flymake-easy(1) overrides internal Flymake functions to support -multiline error messages. - -*Flycheck* can use regular expressions as well as custom parsing -functions. By means of such functions, it can parse JSON, XML or other -structured output formats. Flycheck includes some ready-to-use parsing -functions for well-known output formats, such as Checkstyle XML. By -parsing structured output format, Flycheck can handle arbitrarily -complex error messages. Also, with regular expressions it uses the -error patterns to split the output into tokens, and thus handles -multiline messages just as well. - - ---------- Footnotes ---------- - - (1) https://github.com/purcell/flymake-easy - - -File: flycheck.info, Node: Error message display, Next: Error list, Prev: Error parsing, Up: Detailed review - -2.2.10 Error message display ----------------------------- - -In GUI frames, *Flymake* shows error messages in a tool tip, if the user -hovers the mouse over an error location. It does not provide means to -show error messages in a TTY frame, or with the keyboard only. - -The third-party library flymake-cursor(1) shows Flymake error messages -at point in the echo area, by overriding internal Flymake functions. - -*Flycheck* shows error message tool tips as well, but also displays -error messages in the echo area, if the point is at an error location. -This feature is fully customizable via *note -flycheck-display-errors-function: 2b. - - ---------- Footnotes ---------- - - (1) http://www.emacswiki.org/emacs/flymake-cursor.el - - -File: flycheck.info, Node: Error list, Next: Resource consumption, Prev: Error message display, Up: Detailed review - -2.2.11 Error list ------------------ - -*Flymake* does not provide means to list all errors in the current -buffer. - -*Flycheck* can list all errors in the current buffer in a separate -window. This error list is automatically updated after each syntax -check, and follows the focus. - - -File: flycheck.info, Node: Resource consumption, Next: Unit tests, Prev: Error list, Up: Detailed review - -2.2.12 Resource consumption ---------------------------- - -* Menu: - -* Syntax checking:: -* Checking for changes:: - - -File: flycheck.info, Node: Syntax checking, Next: Checking for changes, Up: Resource consumption - -2.2.12.1 Syntax checking -........................ - -*Flymake* starts a syntax check after every change, regardless of -whether the buffer is visible in a window or not. It does not limit the -number of concurrent syntax checks. As such, Flymake starts many -concurrent syntax checks, if many buffers are changed at the same time -(e.g. after a VCS revert), which is known to freeze Emacs temporarily. - -The third-party Flymake fork(1) limits the number of concurrent syntax -checks. It does not take care to check visible buffers first, though. - -*Flycheck* does not conduct syntax checks in buffers which are not -visible in any window. Instead it defers syntax checks in such buffers -until after the buffer is visible again. Hence, Flycheck does only -start as many concurrent syntax checks as there are visible windows in -the current Emacs session. - - ---------- Footnotes ---------- - - (1) https://github.com/illusori/emacs-flymake - - -File: flycheck.info, Node: Checking for changes, Prev: Syntax checking, Up: Resource consumption - -2.2.12.2 Checking for changes -............................. - -*Flymake* uses a _separate_ timer (in ‘flymake-timer’) to periodically -check for changes in each buffer. These timers run even if the -corresponding buffers do not change. This is known to cause -considerable CPU load with many open buffers. - -The third-party Flymake fork(1) uses a single global timer to check for -changes. This greatly reduces the CPU load, but still consumes some -marginal CPU, even if Emacs is idle and not in use currently. - -*Flycheck* does not use timers at all to check for changes. Instead it -registers a handler for Emacs’ built-in ‘after-change-functions’ hook, -which is run after changes to the buffer. This handler is only invoked -when the buffer actually changed, and starts a one-shot timer to delay -the syntax check until the editing stopped for a short time, to save -resources and avoid checking half-finished editing. - - ---------- Footnotes ---------- - - (1) https://github.com/illusori/emacs-flymake - - -File: flycheck.info, Node: Unit tests, Prev: Resource consumption, Up: Detailed review - -2.2.13 Unit tests ------------------ - -*Flymake* does not have a test suite at all. - -*Flycheck* has unit tests for all built-in syntax checkers, and for -large parts of the underlying machinery and API. Contributed syntax -checkers are required to have test cases. The tests are continuously -run on Travis CI(1). - - ---------- Footnotes ---------- - - (1) https://travis-ci.org/flycheck/flycheck - - -File: flycheck.info, Node: Installation, Next: Quickstart, Prev: Flycheck versus Flymake, Up: Top - -3 Installation -************** - -* Menu: - -* Prerequisites:: -* Package installation:: -* Setup:: - - -File: flycheck.info, Node: Prerequisites, Next: Package installation, Up: Installation - -3.1 Prerequisites -================= - -* Menu: - -* Emacs:: -* Operating system:: -* Syntax checking tools:: - - -File: flycheck.info, Node: Emacs, Next: Operating system, Up: Prerequisites - -3.1.1 Emacs ------------ - -Flycheck supports Emacs 24. It is tested with Emacs 24.3, and Emacs -snapshot builds. It should work with GNU Emacs 24.1 and 24.2 as well, -but it is not tested against these versions. If it does not work with -these versions, please report an issue. - - Warning: Flycheck also does not support GNU Emacs 23 and other - flavors of Emacs (e.g. XEmacs, Aquamacs, etc.). Don’t try, it - will *not* work. - - -File: flycheck.info, Node: Operating system, Next: Syntax checking tools, Prev: Emacs, Up: Prerequisites - -3.1.2 Operating system ----------------------- - -Flycheck supports any Unix-like operating system. It is extensively -tested on Linux and OS X. - - Warning: Flycheck tries to maintain compatibility with Windows, and - generally works well on Windows. Pull requests which fix or - improve Windows compatibility are *very* welcome. - - However, Flycheck does *not* explicitly support Windows. If there - are any issues or problems with Windows, *you are on your own*. We - can neither answer questions about Windows support, nor can we fix - Windows-specific issues. - - -File: flycheck.info, Node: Syntax checking tools, Prev: Operating system, Up: Prerequisites - -3.1.3 Syntax checking tools ---------------------------- - -For almost all supported languages, Flycheck also needs additional -*external* checker programs. See *note Supported languages: 39. for a -list of supported languages and the corresponding checkers programs, and -use *note flycheck-describe-checker: 3a. to get help about specific -checkers inside Emacs. - -For instance, for Python you need either Flake8(1) or Pylint(2), which -can be installed with ‘pip install flake8’ and ‘pip install pylint’ -respectively. - -Generally you can install the required external checker programs with -the standard package manager of the corresponding programming languages -(e.g. Rubygems for Ruby, NPM for Javascript). Many checker programs -are also available in the package repositories of popular Linux -distributions, or as Formula for the OS X package manager Homebrew(3). - - ---------- Footnotes ---------- - - (1) https://flake8.readthedocs.org/ - - (2) http://www.pylint.org/ - - (3) http://brew.sh/ - - -File: flycheck.info, Node: Package installation, Next: Setup, Prev: Prerequisites, Up: Installation - -3.2 Package installation -======================== - -* Menu: - -* Manual:: -* Cask:: - - -File: flycheck.info, Node: Manual, Next: Cask, Up: Package installation - -3.2.1 Manual ------------- - -Install the ELPA package from MELPA(1) or MELPA Stable(2) using ‘M-x -package-install RET flycheck’. - - Warning: Flycheck is available from Marmalade(3) as well, but this - repository is *not recommended*. Due to frequent outages the - package is not guaranteed to be updated regularly. - -Neither of these repositories is included in GNU Emacs by default. You -need to enable these repositories explicitly. For instance, to add the -MELPA repository, add the following code to ‘init.el’: - - (require 'package) - (add-to-list 'package-archives - '("melpa" . "http://melpa.org/packages/") t) - (package-initialize) - - ---------- Footnotes ---------- - - (1) http://melpa.org - - (2) http://stable.melpa.org - - (3) https://marmalade-repo.org/ - - -File: flycheck.info, Node: Cask, Prev: Manual, Up: Package installation - -3.2.2 Cask ----------- - -If you use *note Cask: 3e, just add the following to your ‘Cask’ file, -and run ‘cask install’: - - (source gnu) - (source melpa) - - (depends-on "flycheck") - - -File: flycheck.info, Node: Setup, Prev: Package installation, Up: Installation - -3.3 Setup -========= - -Use ‘M-x flycheck-mode’ to enable Flycheck in the current buffer, and -‘M-x global-flycheck-mode’ to enable Flycheck for the entire current -Emacs session. - -To permanently enable Flycheck, add the following to your ‘init.el’: - - (add-hook 'after-init-hook #'global-flycheck-mode) - - -File: flycheck.info, Node: Quickstart, Next: Usage, Prev: Installation, Up: Top - -4 Quickstart -************ - -* Menu: - -* Enable Flycheck:: -* Install some syntax checker tools:: -* Check syntax in a buffer:: -* Navigate and list errors:: -* Explore the menu:: -* Further reading:: - - -File: flycheck.info, Node: Enable Flycheck, Next: Install some syntax checker tools, Up: Quickstart - -4.1 Enable Flycheck -=================== - -Enable Flycheck globally by adding the following to your ‘init.el’, and -restart Emacs: - - (add-hook 'after-init-hook #'global-flycheck-mode) - - -File: flycheck.info, Node: Install some syntax checker tools, Next: Check syntax in a buffer, Prev: Enable Flycheck, Up: Quickstart - -4.2 Install some syntax checker tools -===================================== - -Install some syntax checking tools for the programming or markup -language you are using. Take a look at the *note list of supported -languages: 5. to check what languages and tools are supported. - -For Python: - - $ pip install --user pylint - -Or for Ruby: - - $ gem install rubocop ruby-lint - -Or for Haskell: - - $ brew install haskell-platform - $ cabal install hlint - -The *note language list: 5. also lists the available options for each -syntax checker. Take a look at these to tune the syntax checkers to -your needs, and read *note how to use these options: 45. - - -File: flycheck.info, Node: Check syntax in a buffer, Next: Navigate and list errors, Prev: Install some syntax checker tools, Up: Quickstart - -4.3 Check syntax in a buffer -============================ - -Run ‘M-x flycheck-verify-setup’ in a buffer to check whether Flycheck is -correctly setup to check the buffer. - -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’ (*note -flycheck-buffer: 47.). - - -File: flycheck.info, Node: Navigate and list errors, Next: Explore the menu, Prev: Check syntax in a buffer, Up: Quickstart - -4.4 Navigate and list errors -============================ - -Use ‘C-c ! n’ (*note flycheck-next-error: 49.) and ‘C-c ! p’ (*note -flycheck-previous-error: 4a.) 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’ (*note flycheck-list-errors: 4b.) 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. - - -File: flycheck.info, Node: Explore the menu, Next: Further reading, Prev: Navigate and list errors, Up: Quickstart - -4.5 Explore the menu -==================== - -All Flycheck commands are available in the Emacs menu at _Tools ‣ Syntax -Checking_. Explore this menu to see what features Flycheck has to -offer. - -The menu can also be opened by clicking on the mode line lighter of -Flycheck. - - -File: flycheck.info, Node: Further reading, Prev: Explore the menu, Up: Quickstart - -4.6 Further reading -=================== - - - *note Usage: 4e. describes all commands and options in detail. - - - *note Supported languages: 39. has a list of all supported - languages, and the corresponding syntax checker tools and their - options. - - -File: flycheck.info, Node: Usage, Next: Supported languages, Prev: Quickstart, Up: Top - -5 Usage -******* - -This chapter explains in-depth how to use Flycheck for your daily work. - - Note: All commands in this chapter are documented with their - standard key prefix ‘C-c !’. If you do not like this prefix, you - can change it with *note flycheck-keymap-prefix: 50, but take care - to remember your custom prefix while reading this chapter. - - -- User Option: flycheck -keymap-prefix - - Variable properties: This variable may be risky if used - as a file-local variable. - - Prefix for key bindings of Flycheck. - - Changing this variable outside Customize does not have any - effect. To change the keymap prefix from Lisp, you need to - explicitly re-define the prefix key: - - (define-key flycheck-mode-map flycheck-keymap-prefix nil) - (setq flycheck-keymap-prefix (kbd "C-c f")) - (define-key flycheck-mode-map flycheck-keymap-prefix - flycheck-command-map) - - Please note that Flycheck’s manual documents the default - keybindings. Changing this variable is at your own risk. - - This user option was introduced, or its default value was - changed, in version 0.19 of the flycheck package. - -* Menu: - -* Enabling syntax checking: Enabling syntax checking<2>. -* Checking buffers:: -* Selecting syntax checkers:: -* Configuring syntax checkers:: -* Error reporting:: -* Listing errors:: -* Copying (killing) errors: Copying killing errors. -* Navigating and jumping to errors:: -* Mode line reporting:: - - -File: flycheck.info, Node: Enabling syntax checking<2>, Next: Checking buffers, Up: Usage - -5.1 Enabling syntax checking -============================ - -*note global-flycheck-mode: 15. enables syntax checking in all buffers -whenever possible: - - -- Command: M -x global-flycheck-mode - - Toggle Flycheck Mode for *all* live buffers, and for new buffers. - - With Global Flycheck Mode, Flycheck Mode is automatically enabled - in all buffers, for which a *note suitable syntax checker: 53. - exists and is enabled. - - Note: Flycheck Mode will *not* be enabled in buffers for - remote or encrypted files. The former is flaky and might be - very slow, and the latter might leak confidential data to - temporary directories. - - You can still explicitly enable Flycheck Mode in such buffers - with *note flycheck-mode: 54. This is *not* recommended - though. - - -- User Option: global -flycheck-mode - - Whether Flycheck Mode is enabled globally. - -To permanently enable syntax checking, either customize *note -global-flycheck-mode: 55. with ‘M-x customize-variable RET -global-flycheck-mode’ and select _Save for Future Sessions_, or add the -following code to your init file: - - (add-hook 'after-init-hook #'global-flycheck-mode) - -You can also explicitly enable syntax checking just for the current -buffer with the local minor mode *note flycheck-mode: 54.: - - -- Command: M -x flycheck-mode - - Toggle Flycheck Mode for the current buffer. - - -- User Option: flycheck -mode - - Whether Flycheck Mode is enabled in the current buffer. - - -File: flycheck.info, Node: Checking buffers, Next: Selecting syntax checkers, Prev: Enabling syntax checking<2>, Up: Usage - -5.2 Checking buffers -==================== - -When *note flycheck-mode: 54. is enabled, Flycheck automatically checks -a buffer whenever - - - the buffer is saved (e.g. ‘C-x C-s’), - - - new lines are inserted, - - - or a short time (see *note flycheck-idle-change-delay: 58.) after - the last change to the buffer. - -You can customize this behaviour with the option *note -flycheck-check-syntax-automatically: 59.: - - -- User Option: flycheck -check-syntax-automatically - - Variable properties: This variable is safe as a file local - variable if its value satisfies the predicate ‘symbolp’. - - When Flycheck should check syntax automatically. - - This variable is a list of events that may trigger syntax checks. - The following events are known: - - ‘`save'’ - Check syntax immediately after the buffer was saved. - - ‘`idle-change'’ - Check syntax a short time (see *note ‘flycheck-idle-change-delay’: 58.) - after the last change to the buffer. - - ‘`new-line'’ - Check syntax immediately after a new line was inserted into - the buffer. - - ‘`mode-enabled'’ - Check syntax immediately when *note ‘flycheck-mode’: 54. is enabled. - - Flycheck performs a syntax checks only on events, which are - contained in this list. For instance, if the value of this - variable is ‘(mode-enabled save)’, Flycheck will only check if - the mode is enabled or the buffer was saved, but never after - changes to the buffer contents. - - If nil, never check syntax automatically. In this case, use - *note ‘flycheck-buffer’: 47. to start a syntax check manually. - - This user option was introduced, or its default value was changed, - in version 0.12 of the flycheck package. - - -- User Option: flycheck -idle-change-delay - - Variable properties: This variable is safe as a file local - variable if its value satisfies the predicate ‘numberp’. - - How many seconds to wait before checking syntax automatically. - - After the buffer was changed, Flycheck will wait as many seconds - as the value of this variable before starting a syntax check. If - the buffer is modified during this time, Flycheck will wait - again. - - This variable has no effect, if ‘`idle-change'’ is not contained in - *note ‘flycheck-check-syntax-automatically’: 59. - - This user option was introduced, or its default value was changed, - in version 0.13 of the flycheck package. - -You can also always check the current buffer manually: - - -- Command: C -c ! c - -- Command: M -x flycheck-buffer - - Check syntax in the current buffer. - - The syntax checker used for the syntax check is cached in - ‘`flycheck-last-checker'’ and re-used for the next check, if - possible. - - Note: If syntax checking does not work, check your setup: - - -- Command: C -c ! v - -- Command: M -x flycheck-verify-setup - - Check whether Flycheck can be used in this buffer. - - Display a new buffer listing all syntax checkers that could be - applicable in the current buffer. For each syntax checkers, - possible problems are shown. - -During syntax checks, Flycheck generates some temporary files for syntax -checker input and output. Use *note flycheck-temp-prefix: 5b. to change -the prefix of these temporary files: - - -- User Option: flycheck -temp-prefix - - Variable properties: This variable may be risky if used as a - file-local variable. - - Prefix for temporary files created by Flycheck. - - This user option was introduced, or its default value was changed, - in version 0.19 of the flycheck package. - - -File: flycheck.info, Node: Selecting syntax checkers, Next: Configuring syntax checkers, Prev: Checking buffers, Up: Usage - -5.3 Selecting syntax checkers -============================= - -Whenever it checks a buffer, Flycheck selects a *note suitable syntax -checker: 53. from *note flycheck-checkers: 5e.: - - -- User Option: flycheck -checkers - - Variable properties: This variable may be risky if used as a - file-local variable. - - Syntax checkers available for automatic selection. - - A list of Flycheck syntax checkers to choose from when syntax - checking a buffer. Flycheck will automatically select a suitable - syntax checker from this list, unless *note ‘flycheck-checker’: 23. is set, - either directly or with *note ‘flycheck-select-checker’: 24. - - You should not need to change this variable normally. In order - to disable syntax checkers, please use - *note ‘flycheck-disabled-checkers’: 5f. This variable is intended for 3rd - party extensions to tell Flycheck about new syntax checkers. - - Syntax checkers in this list must be defined with - *note ‘flycheck-define-checker’: 19. - - An item in this list is a *note registered syntax checker: 60. - -To disable a *note registered syntax checker: 60, add it to *note -flycheck-disabled-checkers: 5f.: - - -- User Option: flycheck -disabled-checkers - - Variable properties: Automatically becomes buffer-local when - set. This variable is safe as a file local variable if its - value satisfies the predicate *note flycheck-symbol-list-p: - 61. - - Syntax checkers excluded from automatic selection. - - A list of Flycheck syntax checkers to exclude from automatic - selection. Flycheck will never automatically select a syntax - checker in this list, regardless of the value of - *note ‘flycheck-checkers’: 5e. - - However, syntax checkers in this list are still available for - manual selection with *note ‘flycheck-select-checker’: 24. - - Use this variable to disable syntax checkers, instead of removing - the syntax checkers from *note ‘flycheck-checkers’: 5e. You may also use - this option as a file or directory local variable to disable - specific checkers in individual files and directories - respectively. - - This user option was introduced, or its default value was changed, - in version 0.16 of the flycheck package. - -A syntax checker in *note flycheck-checkers: 5e. that is *not* in *note -flycheck-disabled-checkers: 5f. is an *note enabled syntax checker: 62. - -Flycheck starts to check the current buffer with the first enabled and -suitable syntax checker from *note flycheck-checkers: 5e. See -‘Languages and syntax checkers’ for a list of all available syntax -checkers. If there is no enabled and suitable checker for the current, -Flycheck does not check this buffer. It does *not* signal an error. -Instead a special mode line indicator informs about this state. See -*note Mode line reporting: 63. for details. - -You can also force Flycheck to use a specific syntax checker for the -current buffer with *note flycheck-select-checker: 24.: - - -- Command: C -c ! s - -- Command: M -x flycheck-select-checker - - Select the syntax checker for the current buffer by setting *note - flycheck-checker: 23, and run a syntax check with the new syntax - checker. - - Prompt for a syntax checker and set *note flycheck-checker: 23. - - Any *note syntax checker: 64. can be selected with this command, - regardless of whether it is enabled. - - -- Command: C -u C-c ! s - - -- Command: C -u M-x flycheck-select-checker - - Deselect the current syntax checker, and run a syntax check with an - automatically selected syntax checker. - - Set *note flycheck-checker: 23. to ‘nil’. - - -- Function: flycheck -select-checker checker - - Select CHECKER for the current buffer. - - CHECKER is a syntax checker symbol (see *note ‘flycheck-checkers’: 5e.) or - nil. In the former case, use CHECKER for the current buffer, - otherwise deselect the current syntax checker (if any) and use - automatic checker selection via *note ‘flycheck-checkers’: 5e. - - If called interactively prompt for CHECKER. With prefix arg - deselect the current syntax checker and enable automatic - selection again. - - Set *note ‘flycheck-checker’: 23. to CHECKER and automatically start a new - syntax check if the syntax checker changed. - - CHECKER will be used, even if it is not contained in - *note ‘flycheck-checkers’: 5e, or if it is disabled via - *note ‘flycheck-disabled-checkers’: 5f. - -You can change the completion system used by *note -flycheck-select-checker: 24.: - - -- User Option: flycheck -completion-system - - The completion system to use. - - ‘`ido'’ - Use IDO. - - IDO is a built-in alternative completion system, without - good flex matching and a powerful UI. You may want to - install flx-ido (see URL ‘https://github.com/lewang/flx’(1)) to - improve the flex matching in IDO. - - ‘`grizzl'’ - Use Grizzl. - - Grizzl is an alternative completion system with powerful - flex matching, but a very limited UI. See URL - ‘https://github.com/d11wtq/grizzl’(2). - - nil - Use the standard unfancy ‘`completing-read'’. - - ‘`completing-read'’ has a very simple and primitive UI, and - does not offer flex matching. This is the default setting, - though, to match Emacs’ defaults. With this system, you may - want enable option ‘`icomplete-mode'’ to improve the display - of completion candidates at least. - - This user option was introduced, or its default value was changed, - in version 0.17 of the flycheck package. - -*note flycheck-select-checker: 24. sets the local variable *note -flycheck-checker: 23. for the current buffer. You can also set this -variable explicitly, via *note (emacs)File Variables:: or *note -(emacs)Directory Variables::, to enforce a specific syntax checker per -file or per directory: - - -- Variable: flycheck -checker - - Variable properties: Automatically becomes buffer-local when - set. This variable is safe as a file local variable if its - value satisfies the predicate *note - flycheck-registered-checker-p: 66. - - Syntax checker to use for the current buffer. - - If unset or nil, automatically select a suitable syntax checker - from *note ‘flycheck-checkers’: 5e. on every syntax check. - - If set to a syntax checker only use this syntax checker and never - select one from *note ‘flycheck-checkers’: 5e. automatically. The syntax - checker is used regardless of whether it is contained in - *note ‘flycheck-checkers’: 5e. or *note ‘flycheck-disabled-checkers’: 5f. If the - syntax checker is unusable in the current buffer an error is - signaled. - - A syntax checker assigned to this variable must be defined with - *note ‘flycheck-define-checker’: 19. - - Use the command *note ‘flycheck-select-checker’: 24. to select a syntax - checker for the current buffer, or set this variable as file - local variable to always use a specific syntax checker for a - file. See Info Node *note (emacs)Specifying File Variables:: for more - information about file variables. - -Like everything else in Emacs, a syntax checker has online -documentation, which you can via with *note flycheck-describe-checker: -3a.: - - -- Command: C -c ! ? - -- Command: M -x flycheck-describe-checker - - Show the documentation of a syntax checker. - - ---------- Footnotes ---------- - - (1) https://github.com/lewang/flx - - (2) https://github.com/d11wtq/grizzl - - -File: flycheck.info, Node: Configuring syntax checkers, Next: Error reporting, Prev: Selecting syntax checkers, Up: Usage - -5.4 Configuring syntax checkers -=============================== - -* Menu: - -* Syntax checker executables:: -* Syntax checker options:: -* Syntax checker configuration files:: - - -File: flycheck.info, Node: Syntax checker executables, Next: Syntax checker options, Up: Configuring syntax checkers - -5.4.1 Syntax checker executables --------------------------------- - -For each syntax checker, there is a buffer-local, customizable variable -‘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. - -Use these variables to override the executable from the definition per -buffer. For instance, you could use a different Emacs version with the -‘emacs-lisp’ or ‘emacs-lisp-checkdoc’. - -You can either set these variables directly in your ‘init.el’, or change -them interactively: - - -- Command: C -c ! e - -- Command: M -x flycheck-set-checker-executable - - 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. - - -- Command: C -u C-c ! e - - -- Command: C -u M-x flycheck-set-checker-executable - - Reset the executable of a syntax checker in the current buffer. - - Prompt for a syntax checker and reset its executable to the - default. - - -File: flycheck.info, Node: Syntax checker options, Next: Syntax checker configuration files, Prev: Syntax checker executables, Up: Configuring syntax checkers - -5.4.2 Syntax checker options ----------------------------- - -Some syntax checkers can be configured via options. See *note Supported -languages: 39. for a complete list of options for each syntax checkers. - -All options are customizable via ‘M-x customize-group RET -flycheck-options’, and automatically buffer-local to easily set them in -hooks. - -Options are mainly intended to be used by *note extensions: b, and via -File or Directory Local variables. See *note (emacs)File Variables:: -and *note (emacs)Directory Variables:: respectively. - - -File: flycheck.info, Node: Syntax checker configuration files, Prev: Syntax checker options, Up: Configuring syntax checkers - -5.4.3 Syntax checker configuration files ----------------------------------------- - -Some syntax checkers also read configuration files, denoted by -associated _configuration file variables_. See *note Supported -languages: 39. of these variables. - -All options are customizable via ‘M-x customize-group RET -flycheck-config-files’, and automatically buffer-local to easily set -them in hooks. You may also set them via File or Directory Local -variables. See *note (emacs)File Variables:: and *note (emacs)Directory -Variables:: respectively. - -When set to a string, Flycheck tries to locate the configuration file -using the functions in *note flycheck-locate-config-file-functions: 6d. -and passes the name of the file to the syntax checker: - - -- User Option: flycheck -locate-config-file-functions - - Variable properties: This variable may be risky if used as a - file-local variable. - - Functions to locate syntax checker configuration files. - - Each function in this hook must accept two arguments: The value - of the configuration file variable, and the syntax checker - symbol. It must return either a string with an absolute path to - the configuration file, or nil, if it cannot locate the - configuration file. - - The functions in this hook are called in order of appearance, until a - function returns non-nil. The configuration file returned by that - function is then given to the syntax checker if it exists. - - This variable is an abnormal hook. See Info - node *note (elisp)Hooks::. - -With the default value of this variable, configuration files are located -by the following algorithm: - - 1. If the configuration file variable contains a path a directory - separator, expand the path against the buffer’s default directory - and use the resulting path as configuration file. - - 2. If the buffer has a file name, search the buffer’s directory and - any ancestors thereof for the configuration file. - - 3. Eventually attempt to locate the configuration file in the user’s - home directory. - -If any of these steps succeeds, the subsequent steps are not executed. - - -File: flycheck.info, Node: Error reporting, Next: Listing errors, Prev: Configuring syntax checkers, Up: Usage - -5.5 Error reporting -=================== - -When a syntax check in the current buffer has finished, Flycheck -highlights the locations of errors and warnings in the buffer according -to *note flycheck-highlighting-mode: 6f, and indicates these locations -in the fringe according to *note flycheck-indication-mode: 70. -Additionally it shows the number of errors and warnings in the mode -line. - - Note: To avoid flooding the buffer with excessive errors, Flycheck - discards errors and warnings and *disables* the corresponding - syntax checker subsequently, if the total number of reported errors - of any level exceeds *note flycheck-checker-error-threshold: 71.: - - -- User Option: flycheck -checker-error-threshold - - Variable properties: This variable may be risky if used - as a file-local variable. - - Maximum errors allowed per syntax checker. - - The value of this variable is either an integer denoting the - maximum number of errors per syntax checker and buffer, or nil to - not limit the errors reported from a syntax checker. - - If this variable is a number and a syntax checker reports more - errors than the value of this variable, its errors are not - discarded, and not highlighted in the buffer or available in the - error list. The affected syntax checker is also disabled for - future syntax checks of the buffer. - - This user option was introduced, or its default value was - changed, in version 0.22 of the flycheck package. - - -- User Option: flycheck -highlighting-mode - - Variable properties: This variable is safe as a file local - variable if its value satisfies the predicate ‘symbolp’. - - The highlighting mode for Flycheck errors and warnings. - - The highlighting mode controls how Flycheck highlights errors in - buffers. The following modes are known: - - ‘`columns'’ - Highlight the error column. If the error does not have a column, - highlight the whole line. - - ‘`symbols'’ - Highlight the symbol at the error column, if there is any, - otherwise behave like ‘`columns'’. This is the default. - - ‘`sexps'’ - Highlight the expression at the error column, if there is - any, otherwise behave like ‘`columns'’. Note that this mode - can be *very* slow in some major modes. - - ‘`lines'’ - Highlight the whole line. - - nil - Do not highlight errors at all. However, errors will still - be reported in the mode line and in error message popups, - and indicated according to *note ‘flycheck-indication-mode’: 70. - - This user option was introduced, or its default value was changed, - in version 0.14 of the flycheck package. - - -- Face: flycheck -error - -- Face: flycheck -warning - -- Face: flycheck -info - - The faces to use to highlight errors, warnings and info messages - respectively. - - Note: The default faces provided by GNU Emacs are ill-suited - to highlight errors because these are relatively pale and do - not specify a background color or underline. Hence highlights - are easy to overlook and even *invisible* for white space. - - For best error highlighting customize these faces, or choose a - color theme that has reasonable Flycheck faces. The popular - Solarized(1) and Zenburn(2) themes are known to have good Flycheck - faces. - - -- User Option: flycheck -indication-mode - - Variable properties: This variable is safe as a file local - variable if its value satisfies the predicate ‘symbolp’. - - The indication mode for Flycheck errors and warnings. - - This variable controls how Flycheck indicates errors in buffers. - May either be ‘`left-fringe'’, ‘`right-fringe'’, or nil. - - If set to ‘`left-fringe'’ or ‘`right-fringe'’, indicate errors and - warnings via icons in the left and right fringe respectively. - - If set to nil, do not indicate errors and warnings, but just - highlight them according to *note ‘flycheck-highlighting-mode’: 6f. - - -- Face: flycheck -fringe-error - -- Face: flycheck -fringe-warning - -- Face: flycheck -fringe-info - - The faces of fringe indicators for errors, warnings and info - messages respectively. - -If you hover a highlighted error with the mouse, a tooltip with the -top-most error message is shown. Alternatively, you can move the point -onto an error location to see the error message. Flycheck displays -errors at point after a short delay: - - -- User Option: flycheck -display-errors-delay - - Variable properties: This variable is safe as a file local - variable if its value satisfies the predicate ‘numberp’. - - Delay in seconds before displaying errors at point. - - Use floating point numbers to express fractions of seconds. - - This user option was introduced, or its default value was changed, - in version 0.15 of the flycheck package. - -By default, Flycheck shows the messages and IDs of the errors at point -in the minibuffer, but this behaviour is entirely customizable via the -*note flycheck-display-errors-function: 2b. option: - - -- User Option: flycheck -display-errors-function - - Variable properties: This variable may be risky if used as a - file-local variable. - - Function to display error messages. - - If set to a function, call the function with the list of errors - to display as single argument. Each error is an instance of the - ‘`flycheck-error'’ struct. - - If set to nil, do not display errors at all. - - Flycheck provides two built-in functions for this option: - - -- Function: flycheck -display-error-messages errors - - Display the messages of ERRORS. - - Concatenate all non-nil messages of ERRORS separated by empty - lines, and display them with ‘`display-message-or-buffer'’, which - shows the messages either in the echo area or in a separate - buffer, depending on the number of lines. See Info - node *note (elisp)Displaying Messages:: for more information. - - In the latter case, show messages in - ‘`flycheck-error-message-buffer'’. - - -- Function: flycheck -display-error-messages-unless-error-list - errors - - Show messages of ERRORS unless the error list is visible. - - Like *note ‘flycheck-display-error-messages’: 79, but only if the error - list (see *note ‘flycheck-list-errors’: 4b.) is not visible in any window in - the current frame. - - See also -.................. - - *note Listing errors: 7b. - - See also -............. - - The flycheck-pos-tip(3) extension provides a display function to - show errors at point in a graphical popup. - - This user option was introduced, or its default value was changed, - in version 0.13 of the flycheck package. - -You can clear all errors in the current buffer with *note -flycheck-clear: 7c.: - - -- Command: C -c ! C - -- Command: M -x flycheck-clear - - Clear all Flycheck errors and warnings in the current buffer. - - You should not normally need this command, because Flycheck checks - the buffer periodically anyway. - - ---------- Footnotes ---------- - - (1) https://github.com/bbatsov/solarized-emacs - - (2) https://github.com/bbatsov/zenburn-emacs - - (3) https://github.com/flycheck/flycheck-pos-tip - - -File: flycheck.info, Node: Listing errors, Next: Copying killing errors, Prev: Error reporting, Up: Usage - -5.6 Listing errors -================== - -To view all errors in the current buffer, pop up the error list with -*note flycheck-list-errors: 4b.: - - -- Command: C -c ! l - -- Command: M -x flycheck-list-errors - - List all errors in the current buffer in a separate buffer. - - The error list automatically refreshes after a syntax check, and - follows the current buffer and window, that is, if you switch to - another buffer or window, the error list is updated to show the - errors of the new buffer or window. - -Every time the error list refreshes, *note -flycheck-error-list-after-refresh-hook: 7e. is run: - - -- Hook: flycheck -error-list-after-refresh-hook - - Variable properties: This variable may be risky if used as a - file-local variable. - - Functions to run after the error list was refreshed. - - This hook is run whenever the error list is refreshed. - - This variable is a normal hook. See Info node *note (elisp)Hooks::. - - This hook was introduced, or its default value was changed, in - version 0.21 of the flycheck package. - -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 *note flycheck-error-list-highlight: 7f.: - - -- Face: flycheck -error-list-highlight - - Flycheck face to highlight errors in the error list. - - This face was introduced, or its default value was changed, in - version 0.15 of the flycheck package. - -You can customize the appearance of the line and column numbers and of -the syntax checker name: - - -- Face: flycheck -error-list-line-number - - Face for line numbers in the error list. - - This face was introduced, or its default value was changed, in - version 0.16 of the flycheck package. - - -- Face: flycheck -error-list-column-number - - Face for line numbers in the error list. - - This face was introduced, or its default value was changed, in - version 0.16 of the flycheck package. - - -- Face: flycheck -error-list-checker-name - - Face for the syntax checker name in the error list. - - This face was introduced, or its default value was changed, in - version 0.21 of the flycheck package. - - -File: flycheck.info, Node: Copying killing errors, Next: Navigating and jumping to errors, Prev: Listing errors, Up: Usage - -5.7 Copying (killing) errors -============================ - -Frequently, it’s convenient to not only see the error messages, but to -also copy them into the kill ring: - - -- Command: C -c ! C-w - -- Command: M -x flycheck-copy-errors-as-kill - - Copy all Flycheck error messages at the current point into kill - ring. - - Each error message is killed separately, so you can use ‘M-y’ to - cycle among the killed messages after yanking the first one with - ‘C-y’. - - -- Command: C -u C-c ! C-w - - -- Command: C -u M-x flycheck-copy-errors-as-kill - - Copy all Flycheck error messages *and their IDs* at the current - point into kill ring. - - -- Command: M -0 C-c ! C-w - - -- Command: M -0 M-x flycheck-copy-errors-as-kill - - Copy all Flycheck error *IDs* at the current point into kill ring. - This command is particularly handy to copy an ID in order to add an - inline suppression comment. - - -File: flycheck.info, Node: Navigating and jumping to errors, Next: Mode line reporting, Prev: Copying killing errors, Up: Usage - -5.8 Navigating and jumping to errors -==================================== - -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 *note (emacs)Compilation Mode:: for more information about these -commands. - - Note: *Visible* compilation buffers (e.g. from ‘M-x compile’, ‘M-x - grep’, ‘M-x occur’, etc.) take precedence over Flycheck’s error - navigation. - -If you find this integration annoying and would rather keep ‘M-g n’ -confined to compilation buffers, you may disable it by setting *note -flycheck-standard-error-navigation: 88. to nil and re-enabling *note -flycheck-mode: 54. afterwards: - - -- User Option: flycheck -standard-error-navigation - - Variable properties: This variable is safe as a file local - variable if its value satisfies the predicate ‘booleanp’. - - Whether to support error navigation with ‘`next-error'’. - - If non-nil, enable navigation of Flycheck errors with - ‘`next-error'’, ‘`previous-error'’ and ‘`first-error'’. Otherwise, - these functions just navigate errors from compilation modes. - - Flycheck error navigation with *note ‘flycheck-next-error’: 49, - *note ‘flycheck-previous-error’: 4a. and *note ‘flycheck-first-error’: 89. is always - enabled, regardless of the value of this variable. - - Note that this setting only takes effect when *note ‘flycheck-mode’: 54. is - enabled. Changing it will not affect buffers which already have - *note ‘flycheck-mode’: 54. enabled. - - This user option was introduced, or its default value was changed, - in version 0.15 of the flycheck package. - -Since compilation buffers take precedence, Flycheck provides an -independent set of navigation commands which always navigate Flycheck -errors regardless of compilation buffers or *note -flycheck-standard-error-navigation: 88.: - - -- Command: C -c ! n - -- Command: M -x flycheck-next-error - - Jump to the next Flycheck 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. - - -- Command: C -c ! p - -- Command: M -x flycheck-previous-error - - 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 - previous error from the current point. - - -- Command: M -x flycheck-first-error - - 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. - -If *note flycheck-standard-error-navigation: 88. is ‘nil’, these -commands are the only way to navigate Flycheck errors. - -By default, Flycheck’s error navigation considers all error levels. You -can specify a threshold for navigation with *note -flycheck-navigation-minimum-level: 8a.: - - -- User Option: flycheck -navigation-minimum-level - - Variable properties: This variable is safe as a file local - variable if its value satisfies the predicate *note - flycheck-error-level-p: 8b. - - The minimum level of errors to navigate. - - If set to an error level, only navigate errors whose error level - is at least as severe as this one. If nil, navigate all errors. - - This user option was introduced, or its default value was changed, - in version 0.21 of the flycheck package. - - -File: flycheck.info, Node: Mode line reporting, Prev: Navigating and jumping to errors, Up: Usage - -5.9 Mode line reporting -======================= - -Flycheck always indicates its state in the mode line: - -‘FlyC’ - - There are no errors in the current buffer. - -‘FlyC*’ - - A syntax check is being performed currently. - -‘FlyC:3/4’ - - There are three errors and four warnings in the current buffer. - -‘FlyC-’ - - Automatic syntax checker selection did not find a suitable syntax - checker. See *note Selecting syntax checkers: 5d. for more - information. - -‘FlyC!’ - - The syntax check failed. Inspect the ‘*Messages*’ buffer for - details. - -‘FlyC?’ - - 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* be displayed for built-in syntax - checkers. If it is, please report an issue to the Flycheck - developers, as by *note Reporting issues: 8d. - -Change *note flycheck-mode-line: 8e. to customize the mode line -reporting: - - -- User Option: flycheck -mode-line - - Variable properties: This variable may be risky if used as a - file-local variable. - - Mode line lighter for Flycheck. - - The value of this variable is a mode line template as in - ‘`mode-line-format'’. See Info Node *note (elisp)Mode Line Format:: for - more information. Note that it should contain a _single_ mode - line construct only. - - Customize this variable to change how Flycheck reports its status - in the mode line. You may use *note ‘flycheck-mode-line-status-text’: 8f. - to obtain a human-readable status text, including an - error/warning count. - - You may also assemble your own status text. The current status - of Flycheck is available in *note ‘flycheck-last-status-change’: 90. The - errors in the current buffer are stored in - *note ‘flycheck-current-errors’: 91, and the function - *note ‘flycheck-count-errors’: 92. may be used to obtain the number of - errors grouped by error level. - - Set this variable to nil to disable the mode line completely. - - This user option was introduced, or its default value was changed, - in version 0.20 of the flycheck package. - -See also -........ - -The flycheck-color-mode-line(1) extension changes the background colour -of the mode line according to the result of the last syntax check. - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck-color-mode-line - - -File: flycheck.info, Node: Supported languages, Next: Glossary, Prev: Usage, Up: Top - -6 Supported languages -********************* - -Flycheck supports the following 44 languages with 74 syntax checkers. - -Each language has one or more syntax checkers, whose names follow a -‘LANGUAGE-TOOL’ convention, where LANGUAGE is the programming language -supported by this syntax checker, and TOOL the specific syntax checker -tool. - -There are some 3rd party extensions which add support for more -languages: - - - flycheck-ledger(1) adds a syntax checker for the Ledger(2) - accounting tool. - - - flycheck-mercury(3) adds a syntax checker for the Mercury(4) - language. - - - flycheck-ocaml(5) adds a syntax checker for OCaml, using the - Merlin(6) tool. - -* Menu: - -* Ada:: -* AsciiDoc:: -* C/C++:: -* CFEngine:: -* Chef:: -* Coffeescript:: -* Coq:: -* CSS:: -* D:: -* Elixir:: -* Emacs Lisp:: -* Erlang:: -* ERuby:: -* Fortran:: -* Go:: -* Haml:: -* Handlebars:: -* Haskell:: -* HTML:: -* Javascript:: -* JSON:: -* LESS:: -* Lua:: -* Make:: -* Perl:: -* PHP:: -* Puppet:: -* Python:: -* R:: -* Racket:: -* RPM SPEC:: -* ReStructuredText:: -* Ruby:: -* Rust:: -* Sass:: -* Scala:: -* Scss:: -* Shell script languages:: -* Slim:: -* TeX/LaTeX:: -* Texinfo:: -* Verilog:: -* XML:: -* YAML:: - - ---------- Footnotes ---------- - - (1) https://github.com/purcell/flycheck-ledger - - (2) http://ledger-cli.org/ - - (3) https://github.com/flycheck/flycheck-mercury - - (4) http://mercurylang.org/ - - (5) https://github.com/flycheck/flycheck-ocaml - - (6) https://github.com/the-lambda-church/merlin - - -File: flycheck.info, Node: Ada, Next: AsciiDoc, Up: Supported languages - -6.1 Ada -======= - - -- Flycheck Syntax Checker: ada -gnat - - An Ada syntax checker using GNAT. - - Uses the GNAT compiler from GCC. See URL - ‘https://gcc.gnu.org/onlinedocs/gnat_ugn_unw/’(1). - - Options -............ - - -- User Option: flycheck -gnat-args - - A list of additional arguments for Symbol(’ada-gnat’). - - The value of this variable is a list of strings with additional - command line arguments. - - This variable is an option for the syntax checker ‘`ada-gnat'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- User Option: flycheck -gnat-include-path - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - A list of include directories for GNAT. - - The value of this variable is a list of strings, where each - string is a directory to add to the include path of gcc. - Relative paths are relative to the file being checked. - - This variable is an option for the syntax checker ‘`ada-gnat'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- User Option: flycheck -gnat-language-standard - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - The language standard to use in GNAT. - - The value of this variable is either a string denoting a language - standard, or nil, to use the default standard. When non-nil, pass - the language standard via the ‘`-std'’ option. - - This variable is an option for the syntax checker ‘`ada-gnat'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- User Option: flycheck -gnat-warnings - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - A list of additional Ada warnings to enable in GNAT. - - The value of this variable is a list of strings, where each - string is the name of a warning category to enable. By default, - most optional warnings are recommended, as in ‘`-gnata'’. - - Refer to Info Node *note (gnat_ugn_unw)Warning Message Control:: for - more information about GNAT warnings. - - This variable is an option for the syntax checker ‘`ada-gnat'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - ---------- Footnotes ---------- - - (1) https://gcc.gnu.org/onlinedocs/gnat_ugn_unw/ - - -File: flycheck.info, Node: AsciiDoc, Next: C/C++, Prev: Ada, Up: Supported languages - -6.2 AsciiDoc -============ - - -- Flycheck Syntax Checker: asciidoc - - A AsciiDoc syntax checker using the AsciiDoc compiler. - - See URL ‘http://www.methods.co.nz/asciidoc’(1). - - ---------- Footnotes ---------- - - (1) http://www.methods.co.nz/asciidoc - - -File: flycheck.info, Node: C/C++, Next: CFEngine, Prev: AsciiDoc, Up: Supported languages - -6.3 C/C++ -========= - - -- Flycheck Syntax Checker: c/c++ -clang - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note c/c++-cppcheck: a1, if there are no errors above - level ‘warning’ - - The *first* suitable syntax checker is used. - - A C/C++ syntax checker using Clang. - - See URL ‘http://clang.llvm.org/’(1). - - Options -............ - - -- User Option: flycheck -clang-args - - A list of additional arguments for Symbol(’c/c++-clang’). - - The value of this variable is a list of strings with additional - command line arguments. - - This variable is an option for the syntax checker ‘`c/c++-clang'’. - - This user option was introduced, or its default value was - changed, in version 0.22 of the flycheck package. - - -- User Option: flycheck -clang-blocks - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - Enable blocks in Clang. - - When non-nil, enable blocks in Clang with ‘`-fblocks'’. See URL - ‘http://clang.llvm.org/docs/BlockLanguageSpec.html’(2) for more - information about blocks. - - This variable is an option for the syntax checker ‘`c/c++-clang'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- User Option: flycheck -clang-definitions - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - Additional preprocessor definitions for Clang. - - The value of this variable is a list of strings, where each - string is an additional definition to pass to Clang, via the ‘`-D'’ - option. - - This variable is an option for the syntax checker ‘`c/c++-clang'’. - - This user option was introduced, or its default value was - changed, in version 0.15 of the flycheck package. - - -- User Option: flycheck -clang-include-path - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - A list of include directories for Clang. - - The value of this variable is a list of strings, where each - string is a directory to add to the include path of Clang. - Relative paths are relative to the file being checked. - - This variable is an option for the syntax checker ‘`c/c++-clang'’. - - This user option was introduced, or its default value was - changed, in version 0.14 of the flycheck package. - - -- User Option: flycheck -clang-includes - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - A list of additional include files for Clang. - - The value of this variable is a list of strings, where each - string is a file to include before syntax checking. Relative - paths are relative to the file being checked. - - This variable is an option for the syntax checker ‘`c/c++-clang'’. - - This user option was introduced, or its default value was - changed, in version 0.15 of the flycheck package. - - -- User Option: flycheck -clang-language-standard - - Variable properties: Automatically becomes buffer-local - when set. This variable is safe as a file local variable - if its value satisfies the predicate ‘stringp’. - - The language standard to use in Clang. - - The value of this variable is either a string denoting a language - standard, or nil, to use the default standard. When non-nil, - pass the language standard via the ‘`-std'’ option. - - This variable is an option for the syntax checker ‘`c/c++-clang'’. - - This user option was introduced, or its default value was - changed, in version 0.15 of the flycheck package. - - -- User Option: flycheck -clang-ms-extensions - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - Whether to enable Microsoft extensions to C/C++ in Clang. - - When non-nil, enable Microsoft extensions to C/C++ via - ‘`-fms-extensions'’. - - This variable is an option for the syntax checker ‘`c/c++-clang'’. - - This user option was introduced, or its default value was - changed, in version 0.16 of the flycheck package. - - -- User Option: flycheck -clang-no-exceptions - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - Whether to disable exceptions in Clang. - - When non-nil, disable exceptions for syntax checks, via - ‘`-fno-exceptions'’. - - This variable is an option for the syntax checker ‘`c/c++-clang'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- User Option: flycheck -clang-no-rtti - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - Whether to disable RTTI in Clang. - - When non-nil, disable RTTI for syntax checks, via ‘`-fno-rtti'’. - - This variable is an option for the syntax checker ‘`c/c++-clang'’. - - This user option was introduced, or its default value was - changed, in version 0.15 of the flycheck package. - - -- User Option: flycheck -clang-standard-library - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - The standard library to use for Clang. - - The value of this variable is the name of a standard library as - string, or nil to use the default standard library. - - Refer to the Clang manual at URL - ‘http://clang.llvm.org/docs/UsersManual.html’(3) for more - information about the standard library. - - This variable is an option for the syntax checker ‘`c/c++-clang'’. - - This user option was introduced, or its default value was - changed, in version 0.15 of the flycheck package. - - -- User Option: flycheck -clang-warnings - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - A list of additional warnings to enable in Clang. - - The value of this variable is a list of strings, where each string - is the name of a warning category to enable. By default, all - recommended warnings and some extra warnings are enabled (as by - ‘`-Wall'’ and ‘`-Wextra'’ respectively). - - Refer to the Clang manual at URL - ‘http://clang.llvm.org/docs/UsersManual.html’(4) for more - information about warnings. - - This variable is an option for the syntax checker ‘`c/c++-clang'’. - - This user option was introduced, or its default value was - changed, in version 0.14 of the flycheck package. - - -- Flycheck Syntax Checker: c/c++ -gcc - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note c/c++-cppcheck: a1, if there are no errors above - level ‘warning’ - - The *first* suitable syntax checker is used. - - A C/C++ syntax checker using GCC. - - Requires GCC 4.8 or newer. See URL ‘https://gcc.gnu.org/’(5). - - Options -............ - - -- User Option: flycheck -gcc-args - - A list of additional arguments for Symbol(’c/c++-gcc’). - - The value of this variable is a list of strings with additional - command line arguments. - - This variable is an option for the syntax checker ‘`c/c++-gcc'’. - - This user option was introduced, or its default value was - changed, in version 0.22 of the flycheck package. - - -- User Option: flycheck -gcc-definitions - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - Additional preprocessor definitions for GCC. - - The value of this variable is a list of strings, where each - string is an additional definition to pass to GCC, via the ‘`-D'’ - option. - - This variable is an option for the syntax checker ‘`c/c++-gcc'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- User Option: flycheck -gcc-include-path - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - A list of include directories for GCC. - - The value of this variable is a list of strings, where each - string is a directory to add to the include path of gcc. - Relative paths are relative to the file being checked. - - This variable is an option for the syntax checker ‘`c/c++-gcc'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- User Option: flycheck -gcc-includes - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - A list of additional include files for GCC. - - The value of this variable is a list of strings, where each - string is a file to include before syntax checking. Relative - paths are relative to the file being checked. - - This variable is an option for the syntax checker ‘`c/c++-gcc'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- User Option: flycheck -gcc-language-standard - - Variable properties: Automatically becomes buffer-local - when set. This variable is safe as a file local variable - if its value satisfies the predicate ‘stringp’. - - The language standard to use in GCC. - - The value of this variable is either a string denoting a language - standard, or nil, to use the default standard. When non-nil, - pass the language standard via the ‘`-std'’ option. - - This variable is an option for the syntax checker ‘`c/c++-gcc'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- User Option: flycheck -gcc-no-exceptions - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - Whether to disable exceptions in GCC. - - When non-nil, disable exceptions for syntax checks, via - ‘`-fno-exceptions'’. - - This variable is an option for the syntax checker ‘`c/c++-gcc'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- User Option: flycheck -gcc-no-rtti - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - Whether to disable RTTI in GCC. - - When non-nil, disable RTTI for syntax checks, via ‘`-fno-rtti'’. - - This variable is an option for the syntax checker ‘`c/c++-gcc'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- User Option: flycheck -gcc-openmp - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - Whether to enable OpenMP in GCC. - - When non-nil, enable OpenMP for syntax checkers, via - ‘`-fopenmp'’. - - This variable is an option for the syntax checker ‘`c/c++-gcc'’. - - This user option was introduced, or its default value was - changed, in version 0.21 of the flycheck package. - - -- User Option: flycheck -gcc-warnings - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - A list of additional warnings to enable in GCC. - - The value of this variable is a list of strings, where each string - is the name of a warning category to enable. By default, all - recommended warnings and some extra warnings are enabled (as by - ‘`-Wall'’ and ‘`-Wextra'’ respectively). - - Refer to the gcc manual at URL - ‘https://gcc.gnu.org/onlinedocs/gcc/’(6) for more information about - warnings. - - This variable is an option for the syntax checker ‘`c/c++-gcc'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- Flycheck Syntax Checker: c/c++ -cppcheck - - A C/C++ checker using cppcheck. - - See URL ‘http://cppcheck.sourceforge.net/’(7). - - Options -............ - - -- User Option: flycheck -cppcheck-checks - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - Enabled checks for Cppcheck. - - The value of this variable is a list of strings, where each - string is the name of an additional check to enable. By default, - all coding style checks are enabled. - - See section "Enable message" in the Cppcheck manual at URL - ‘http://cppcheck.sourceforge.net/manual.pdf’(8), and the - documentation of the ‘`--enable'’ option for more information, - including a list of supported checks. - - This variable is an option for the syntax checker ‘`c/c++-cppcheck'’. - - This user option was introduced, or its default value was - changed, in version 0.14 of the flycheck package. - - -- User Option: flycheck -cppcheck-inconclusive - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - Whether to enable Cppcheck inconclusive checks. - - When non-nil, enable Cppcheck inconclusive checks. This allows Cppcheck to - report warnings it’s not certain of, but it may result in false positives. - - This will have no effect when using Cppcheck 1.53 and older. - - This variable is an option for the syntax checker ‘`c/c++-cppcheck'’. - - This user option was introduced, or its default value was - changed, in version 0.19 of the flycheck package. - -See also -........ - -flycheck-irony(9) adds an alternative syntax checker for C, C++ and -Objective C which uses Irony Mode(10) server to check buffers. - -The flycheck-google-cpplint(11) extension adds a syntax checker using -Google’s C++ style checker. - - ---------- Footnotes ---------- - - (1) http://clang.llvm.org/ - - (2) http://clang.llvm.org/docs/BlockLanguageSpec.html - - (3) http://clang.llvm.org/docs/UsersManual.html - - (4) http://clang.llvm.org/docs/UsersManual.html - - (5) https://gcc.gnu.org/ - - (6) https://gcc.gnu.org/onlinedocs/gcc/ - - (7) http://cppcheck.sourceforge.net/ - - (8) http://cppcheck.sourceforge.net/manual.pdf - - (9) https://github.com/Sarcasm/flycheck-irony - - (10) https://github.com/Sarcasm/irony-mode - - (11) https://github.com/flycheck/flycheck-google-cpplint - - -File: flycheck.info, Node: CFEngine, Next: Chef, Prev: C/C++, Up: Supported languages - -6.4 CFEngine -============ - - -- Flycheck Syntax Checker: cfengine - - A CFEngine syntax checker using cf-promises. - - See URL ‘http://cfengine.com/’(1). - - ---------- Footnotes ---------- - - (1) http://cfengine.com/ - - -File: flycheck.info, Node: Chef, Next: Coffeescript, Prev: CFEngine, Up: Supported languages - -6.5 Chef -======== - -See also -........ - -Chef(1) - - -- Flycheck Syntax Checker: chef -foodcritic - - A Chef cookbooks syntax checker using Foodcritic. - - See URL ‘http://acrmp.github.io/foodcritic/’(2). - - ---------- Footnotes ---------- - - (1) https://www.getchef.com/chef/ - - (2) http://acrmp.github.io/foodcritic/ - - -File: flycheck.info, Node: Coffeescript, Next: Coq, Prev: Chef, Up: Supported languages - -6.6 Coffeescript -================ - - -- Flycheck Syntax Checker: coffee - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note coffee-coffeelint: c0, if there are no errors above - level ‘warning’ - - The *first* suitable syntax checker is used. - - A CoffeeScript syntax checker using coffee. - - See URL ‘http://coffeescript.org/’(1). - - -- Flycheck Syntax Checker: coffee -coffeelint - - A CoffeeScript style checker using coffeelint. - - This syntax checker requires coffeelint 1.0 or newer. - - See URL ‘http://www.coffeelint.org/’(2). - - Configuration file -....................... - - -- User Option: flycheck -coffeelintrc - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - Configuration file for ‘`coffee-coffeelint'’. - - ---------- Footnotes ---------- - - (1) http://coffeescript.org/ - - (2) http://www.coffeelint.org/ - - -File: flycheck.info, Node: Coq, Next: CSS, Prev: Coffeescript, Up: Supported languages - -6.7 Coq -======= - - -- Flycheck Syntax Checker: coq - - A Coq syntax checker using the Coq compiler. - - See URL ‘http://coq.inria.fr/’(1). - - ---------- Footnotes ---------- - - (1) http://coq.inria.fr/ - - -File: flycheck.info, Node: CSS, Next: D, Prev: Coq, Up: Supported languages - -6.8 CSS -======= - - -- Flycheck Syntax Checker: css -csslint - - A CSS syntax and style checker using csslint. - - See URL ‘https://github.com/CSSLint/csslint’(1). - - ---------- Footnotes ---------- - - (1) https://github.com/CSSLint/csslint - - -File: flycheck.info, Node: D, Next: Elixir, Prev: CSS, Up: Supported languages - -6.9 D -===== - - -- Flycheck Syntax Checker: d -dmd - - A D syntax checker using the DMD compiler. - - Requires DMD 2.066 or newer. See URL ‘http://dlang.org/’(1). - - Options -............ - - -- User Option: flycheck -dmd-include-path - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - A list of include directories for dmd. - - The value of this variable is a list of strings, where each - string is a directory to add to the include path of dmd. - Relative paths are relative to the file being checked. - - This variable is an option for the syntax checker ‘`d-dmd'’. - - This user option was introduced, or its default value was - changed, in version 0.18 of the flycheck package. - -See also -........ - -The flycheck-d-unittest(2) extension adds a syntax checker that runs D -unit tests on the fly. - - ---------- Footnotes ---------- - - (1) http://dlang.org/ - - (2) https://github.com/flycheck/flycheck-d-unittest - - -File: flycheck.info, Node: Elixir, Next: Emacs Lisp, Prev: D, Up: Supported languages - -6.10 Elixir -=========== - - -- Flycheck Syntax Checker: elixir - - An Elixir syntax checker using the Elixir interpreter. - - See URL ‘http://elixir-lang.org/’(1). - - ---------- Footnotes ---------- - - (1) http://elixir-lang.org/ - - -File: flycheck.info, Node: Emacs Lisp, Next: Erlang, Prev: Elixir, Up: Supported languages - -6.11 Emacs Lisp -=============== - -See also -........ - -Emacs(1), Emacs Lisp reference(2) - - -- Flycheck Syntax Checker: emacs -lisp - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note emacs-lisp-checkdoc: ce. - - The *first* suitable syntax checker is used. - - An Emacs Lisp syntax checker using the Emacs Lisp Byte compiler. - - See Info Node *note (elisp)Byte Compilation::. - - Options -............ - - -- User Option: flycheck -emacs-lisp-initialize-packages - - Variable properties: This variable may be risky if used - as a file-local variable. - - Whether to initialize packages in the Emacs Lisp syntax checker. - - To initialize packages, call ‘`package-initialize'’ before - byte-compiling the file to check. - - When nil, never initialize packages. When ‘`auto'’, initialize - packages only when checking files from ‘`user-emacs-directory'’. - For any other non-nil value, always initialize packages. - - This variable is an option for the syntax checker ‘`emacs-lisp'’. - - This user option was introduced, or its default value was - changed, in version 0.14 of the flycheck package. - - -- User Option: flycheck -emacs-lisp-load-path - - Variable properties: This variable may be risky if used - as a file-local variable. - - Load path to use in the Emacs Lisp syntax checker. - - When set to ‘`inherit'’, use the ‘`load-path'’ of the current Emacs - session during syntax checking. - - When set to a list of strings, add each directory in this list to - the ‘`load-path'’ before invoking the byte compiler. Relative - paths in this list are expanded against the ‘`default-directory'’ - of the buffer to check. - - When nil, do not explicitly set the ‘`load-path'’ during syntax - checking. The syntax check only uses the built-in ‘`load-path'’ of - Emacs in this case. - - Note that changing this variable can lead to wrong results of the - syntax check, e.g. if an unexpected version of a required library - is used. - - This variable is an option for the syntax checker ‘`emacs-lisp'’. - - This user option was introduced, or its default value was - changed, in version 0.14 of the flycheck package. - - -- User Option: flycheck -emacs-lisp-package-user-dir - - Variable properties: This variable may be risky if used - as a file-local variable. - - Package directory for the Emacs Lisp syntax checker. - - When set to a string, set ‘`package-user-dir'’ to the value of this - variable before initializing packages. - - This variable has no effect, if - *note ‘flycheck-emacs-lisp-initialize-packages’: cf. is nil. - - This variable is an option for the syntax checker ‘`emacs-lisp'’. - - This user option was introduced, or its default value was - changed, in version 0.14 of the flycheck package. - - See also -............. - - With the flycheck-cask(3) extension this syntax checker - automatically uses packages from Cask(4) projects. - - -- Flycheck Syntax Checker: emacs -lisp-checkdoc - - An Emacs Lisp style checker using CheckDoc. - - The checker runs ‘`checkdoc-current-buffer'’. - - See also -............. - - *note (elisp)Documentation Tips:: - - ---------- Footnotes ---------- - - (1) http://www.gnu.org/software/emacs/ - - (2) -http://www.gnu.org/software/emacs/manual/html_node/elisp/index.html - - (3) https://github.com/flycheck/flycheck-cask - - (4) https://github.com/cask/cask - - -File: flycheck.info, Node: Erlang, Next: ERuby, Prev: Emacs Lisp, Up: Supported languages - -6.12 Erlang -=========== - - -- Flycheck Syntax Checker: erlang - - An Erlang syntax checker using the Erlang interpreter. - - See URL ‘http://www.erlang.org/’(1). - - ---------- Footnotes ---------- - - (1) http://www.erlang.org/ - - -File: flycheck.info, Node: ERuby, Next: Fortran, Prev: Erlang, Up: Supported languages - -6.13 ERuby -========== - - -- Flycheck Syntax Checker: eruby -erubis - - A eRuby syntax checker using the ‘`erubis'’ command. - - See URL ‘http://www.kuwata-lab.com/erubis/’(1). - - ---------- Footnotes ---------- - - (1) http://www.kuwata-lab.com/erubis/ - - -File: flycheck.info, Node: Fortran, Next: Go, Prev: ERuby, Up: Supported languages - -6.14 Fortran -============ - - -- Flycheck Syntax Checker: fortran -gfortran - - An Fortran syntax checker using GCC. - - Uses GCC’s Fortran compiler gfortran. See URL - ‘https://gcc.gnu.org/onlinedocs/gfortran/’(1). - - Options -............ - - -- User Option: flycheck -gfortran-args - - A list of additional arguments for Symbol(’fortran-gfortran’). - - The value of this variable is a list of strings with additional - command line arguments. - - This variable is an option for the syntax checker ‘`fortran-gfortran'’. - - This user option was introduced, or its default value was - changed, in version 0.22 of the flycheck package. - - -- User Option: flycheck -gfortran-include-path - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - A list of include directories for GCC Fortran. - - The value of this variable is a list of strings, where each - string is a directory to add to the include path of gcc. - Relative paths are relative to the file being checked. - - This variable is an option for the syntax checker ‘`fortran-gfortran'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- User Option: flycheck -gfortran-language-standard - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - The language standard to use in GFortran. - - The value of this variable is either a string denoting a language - standard, or nil, to use the default standard. When non-nil, - pass the language standard via the ‘`-std'’ option. - - This variable is an option for the syntax checker ‘`fortran-gfortran'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- User Option: flycheck -gfortran-layout - - The source code layout to use in GFortran. - - The value of this variable is one of the following symbols: - - nil - Let gfortran determine the layout from the extension - - ‘`free'’ - Use free form layout - - - ‘`fixed'’ - Use fixed form layout - - In any other case, an error is signaled. - - This variable is an option for the syntax checker ‘`fortran-gfortran'’. - - -- User Option: flycheck -gfortran-warnings - - A list of warnings for GCC Fortran. - - The value of this variable is a list of strings, where each string - is the name of a warning category to enable. By default, all - recommended warnings and some extra warnings are enabled (as by - ‘`-Wall'’ and ‘`-Wextra'’ respectively). - - Refer to the gfortran manual at URL - ‘https://gcc.gnu.org/onlinedocs/gfortran/’(2) for more information - about warnings - - This variable is an option for the syntax checker ‘`fortran-gfortran'’. - - ---------- Footnotes ---------- - - (1) https://gcc.gnu.org/onlinedocs/gfortran/ - - (2) https://gcc.gnu.org/onlinedocs/gfortran/ - - -File: flycheck.info, Node: Go, Next: Haml, Prev: Fortran, Up: Supported languages - -6.15 Go -======= - - -- Flycheck Syntax Checker: go -gofmt - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note go-golint: e0, if there are no errors above level - ‘warning’ - - 2. *note go-vet: e1, if there are no errors above level - ‘warning’ - - 3. *note go-build: e2, if there are no errors above level - ‘warning’ - - 4. *note go-test: e3, if there are no errors above level - ‘warning’ - - 5. *note go-errcheck: e4, if there are no errors above level - ‘warning’ - - The *first* suitable syntax checker is used. - - A Go syntax and style checker using the gofmt utility. - - See URL ‘http://golang.org/cmd/gofmt/’(1). - - -- Flycheck Syntax Checker: go -golint - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note go-vet: e1. - - 2. *note go-build: e2. - - 3. *note go-test: e3. - - 4. *note go-errcheck: e4. - - The *first* suitable syntax checker is used. - - A Go style checker using Golint. - - See URL ‘https://github.com/golang/lint’(2). - - -- Flycheck Syntax Checker: go -vet - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note go-build: e2. - - 2. *note go-test: e3. - - 3. *note go-errcheck: e4. - - The *first* suitable syntax checker is used. - - A Go syntax checker using the ‘go tool vet’ command. - - See URL ‘http://golang.org/cmd/go/’(3) and URL - ‘http://godoc.org/code.google.com/p/go.tools/cmd/vet’(4). - - Options -............ - - -- User Option: flycheck -go-vet-print-functions - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - A comma-separated list of print-like functions for ‘go tool vet’. - - Go vet will check these functions for format string problems and - issues, such as a mismatch between the number of formats used, - and the number of arguments given. - - Each entry is in the form Name:N where N is the zero-based - argument position of the first argument involved in the print: - either the format or the first print argument for non-formatted - prints. For example, if you have Warn and Warnf functions that - take an io.Writer as their first argument, like Fprintf, - -printfuncs=Warn:1,Warnf:1 - - This variable is an option for the syntax checker ‘`go-vet'’. - - -- Flycheck Syntax Checker: go -build - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note go-errcheck: e4, if there are no errors above level - ‘warning’ - - The *first* suitable syntax checker is used. - - A Go syntax and type checker using the ‘go build’ command. - - See URL ‘http://golang.org/cmd/go’(5). - - -- Flycheck Syntax Checker: go -test - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note go-errcheck: e4, if there are no errors above level - ‘warning’ - - The *first* suitable syntax checker is used. - - A Go syntax and type checker using the ‘go test’ command. - - See URL ‘http://golang.org/cmd/go’(6). - - -- Flycheck Syntax Checker: go -errcheck - - A Go checker for unchecked errors. - - See URL ‘https://github.com/kisielk/errcheck’(7). - - ---------- Footnotes ---------- - - (1) http://golang.org/cmd/gofmt/ - - (2) https://github.com/golang/lint - - (3) http://golang.org/cmd/go/ - - (4) http://godoc.org/code.google.com/p/go.tools/cmd/vet - - (5) http://golang.org/cmd/go - - (6) http://golang.org/cmd/go - - (7) https://github.com/kisielk/errcheck - - -File: flycheck.info, Node: Haml, Next: Handlebars, Prev: Go, Up: Supported languages - -6.16 Haml -========= - - -- Flycheck Syntax Checker: haml - - A Haml syntax checker using the Haml compiler. - - See URL ‘http://haml.info’(1). - - ---------- Footnotes ---------- - - (1) http://haml.info - - -File: flycheck.info, Node: Handlebars, Next: Haskell, Prev: Haml, Up: Supported languages - -6.17 Handlebars -=============== - - -- Flycheck Syntax Checker: handlebars - - A Handlebars syntax checker using the Handlebars compiler. - - See URL ‘http://handlebarsjs.com/’(1). - - ---------- Footnotes ---------- - - (1) http://handlebarsjs.com/ - - -File: flycheck.info, Node: Haskell, Next: HTML, Prev: Handlebars, Up: Supported languages - -6.18 Haskell -============ - - -- Flycheck Syntax Checker: haskell -ghc - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note haskell-hlint: ec, if there are no errors above - level ‘warning’ - - The *first* suitable syntax checker is used. - - A Haskell syntax and type checker using ghc. - - See URL ‘http://www.haskell.org/ghc/’(1). - - Options -............ - - -- User Option: flycheck -ghc-args - - A list of additional arguments for Symbol(’haskell-ghc’). - - The value of this variable is a list of strings with additional - command line arguments. - - This variable is an option for the syntax checker ‘`haskell-ghc'’. - - This user option was introduced, or its default value was - changed, in version 0.22 of the flycheck package. - - -- User Option: flycheck -ghc-language-extensions - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - Language extensions for GHC. - - The value of this variable is a list of strings, where each - string is a Haskell language extension, as in the LANGUAGE - pragma. Each extension is enabled via ‘`-X'’. - - This variable is an option for the syntax checker ‘`haskell-ghc'’. - - This user option was introduced, or its default value was - changed, in version 0.19 of the flycheck package. - - -- User Option: flycheck -ghc-no-user-package-database - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - Whether to disable the user package database in GHC. - - When non-nil, disable the user package database in GHC, via - ‘`-no-user-package-db'’. - - This variable is an option for the syntax checker ‘`haskell-ghc'’. - - This user option was introduced, or its default value was - changed, in version 0.16 of the flycheck package. - - -- User Option: flycheck -ghc-package-databases - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - Additional module databases for GHC. - - The value of this variable is a list of strings, where each - string is a directory of a package database. Each package - database is given to GHC via ‘`-package-db'’. - - This variable is an option for the syntax checker ‘`haskell-ghc'’. - - This user option was introduced, or its default value was - changed, in version 0.16 of the flycheck package. - - -- User Option: flycheck -ghc-search-path - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - Module search path for GHC. - - The value of this variable is a list of strings, where each - string is a directory containing Haskell modules. Each directory - is added to the GHC search path via ‘`-i'’. - - This variable is an option for the syntax checker ‘`haskell-ghc'’. - - This user option was introduced, or its default value was - changed, in version 0.16 of the flycheck package. - - See also -............. - - The flycheck-haskell(2) extension configures this syntax checker - according to the corresponding Cabal project, and adds Cabal - sandboxes. - - -- Flycheck Syntax Checker: haskell -hlint - - A Haskell style checker using hlint. - - See URL ‘https://github.com/ndmitchell/hlint’(3). - -See also -........ - -The flycheck-hdevtools(4) extension adds a Haskell syntax checker using -hdevtools(5). - - ---------- Footnotes ---------- - - (1) http://www.haskell.org/ghc/ - - (2) https://github.com/flycheck/flycheck-haskell - - (3) https://github.com/ndmitchell/hlint - - (4) https://github.com/flycheck/flycheck-hdevtools - - (5) https://github.com/bitc/hdevtools/ - - -File: flycheck.info, Node: HTML, Next: Javascript, Prev: Haskell, Up: Supported languages - -6.19 HTML -========= - - -- Flycheck Syntax Checker: html -tidy - - A HTML syntax and style checker using Tidy. - - See URL ‘https://github.com/w3c/tidy-html5’(1). - - Configuration file -....................... - - -- User Option: flycheck -tidyrc - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - Configuration file for ‘`html-tidy'’. - - ---------- Footnotes ---------- - - (1) https://github.com/w3c/tidy-html5 - - -File: flycheck.info, Node: Javascript, Next: JSON, Prev: HTML, Up: Supported languages - -6.20 Javascript -=============== - - -- Flycheck Syntax Checker: javascript -jshint - - A JavaScript syntax and style checker using jshint. - - See URL ‘http://www.jshint.com’(1). - - Configuration file -....................... - - -- User Option: flycheck -jshintrc - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - Configuration file for ‘`javascript-jshint'’. - - -- Flycheck Syntax Checker: javascript -eslint - - A JavaScript syntax and style checker using eslint. - - See URL ‘https://github.com/eslint/eslint’(2). - - Options -............ - - -- User Option: flycheck -eslint-rulesdir - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - The directory of custom rules for ESLint. - - The value of this variable is either a string containing the path - to a directory with custom rules, or nil, to not give any custom - rules to ESLint. - - Refer to the ESLint manual at URL - ‘https://github.com/eslint/eslint/tree/master/docs/command-line-interface#–rulesdir’(3) - for more information about the custom directory. - - This variable is an option for the syntax checker ‘`javascript-eslint'’. - - This user option was introduced, or its default value was - changed, in version 0.16 of the flycheck package. - - Configuration file -....................... - - -- User Option: flycheck -eslintrc - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - Configuration file for ‘`javascript-eslint'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- Flycheck Syntax Checker: javascript -gjslint - - A JavaScript syntax and style checker using Closure Linter. - - See URL ‘https://developers.google.com/closure/utilities’(4). - - Configuration file -....................... - - -- User Option: flycheck -gjslintrc - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - Configuration file for ‘`javascript-gjslint'’. - - ---------- Footnotes ---------- - - (1) http://www.jshint.com - - (2) https://github.com/eslint/eslint - - (3) -https://github.com/eslint/eslint/tree/master/docs/command-line-interface#–rulesdir - - (4) https://developers.google.com/closure/utilities - - -File: flycheck.info, Node: JSON, Next: LESS, Prev: Javascript, Up: Supported languages - -6.21 JSON -========= - - -- Flycheck Syntax Checker: json -jsonlint - - A JSON syntax and style checker using jsonlint. - - See URL ‘https://github.com/zaach/jsonlint’(1). - - ---------- Footnotes ---------- - - (1) https://github.com/zaach/jsonlint - - -File: flycheck.info, Node: LESS, Next: Lua, Prev: JSON, Up: Supported languages - -6.22 LESS -========= - - -- Flycheck Syntax Checker: less - - A LESS syntax checker using lessc. - - At least version 1.4 of lessc is required. - - See URL ‘http://lesscss.org’(1). - - ---------- Footnotes ---------- - - (1) http://lesscss.org - - -File: flycheck.info, Node: Lua, Next: Make, Prev: LESS, Up: Supported languages - -6.23 Lua -======== - - -- Flycheck Syntax Checker: lua - - A Lua syntax checker using the Lua compiler. - - See URL ‘http://www.lua.org/’(1). - - ---------- Footnotes ---------- - - (1) http://www.lua.org/ - - -File: flycheck.info, Node: Make, Next: Perl, Prev: Lua, Up: Supported languages - -6.24 Make -========= - - -- Flycheck Syntax Checker: make - - A Makefile syntax checker using the POSIX compatible Make command. - - See URL ‘http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html’(1). - - See also -............. - - GNU Make(2), NetBSD Make(3), FreeBSD Make(4), OpenBSD Make(5) - - ---------- Footnotes ---------- - - (1) -http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html - - (2) http://www.gnu.org/software/make/ - - (3) http://netbsd.gw.com/cgi-bin/man-cgi?make++NetBSD-current - - (4) http://www.freebsd.org/cgi/man.cgi?query=make&sektion=1 - - (5) http://www.openbsd.org/cgi-bin/man.cgi?query=make - - -File: flycheck.info, Node: Perl, Next: PHP, Prev: Make, Up: Supported languages - -6.25 Perl -========= - - -- Flycheck Syntax Checker: perl - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note perl-perlcritic: 109. - - The *first* suitable syntax checker is used. - - A Perl syntax checker using the Perl interpreter. - - See URL ‘http://www.perl.org’(1). - - -- Flycheck Syntax Checker: perl -perlcritic - - A Perl syntax checker using Perl::Critic. - - See URL ‘https://metacpan.org/pod/Perl::Critic’(2). - - Options -............ - - -- User Option: flycheck -perlcritic-severity - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘integerp’. - - The message severity for Perl Critic. - - The value of this variable is a severity level as integer, for - the ‘`--severity'’ option to Perl Critic. - - This variable is an option for the syntax checker ‘`perl-perlcritic'’. - - This user option was introduced, or its default value was - changed, in version 0.18 of the flycheck package. - - ---------- Footnotes ---------- - - (1) http://www.perl.org - - (2) https://metacpan.org/pod/Perl::Critic - - -File: flycheck.info, Node: PHP, Next: Puppet, Prev: Perl, Up: Supported languages - -6.26 PHP -======== - - -- Flycheck Syntax Checker: php - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note php-phpmd: 10d, if there are no errors above level - ‘warning’ - - 2. *note php-phpcs: 10e, if there are no errors above level - ‘warning’ - - The *first* suitable syntax checker is used. - - A PHP syntax checker using the PHP command line interpreter. - - See URL ‘http://php.net/manual/en/features.commandline.php’(1). - - -- Flycheck Syntax Checker: php -phpmd - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note php-phpcs: 10e. - - The *first* suitable syntax checker is used. - - A PHP style checker using PHP Mess Detector. - - See URL ‘http://phpmd.org/’(2). - - Options -............ - - -- User Option: flycheck -phpmd-rulesets - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - The rule sets for PHP Mess Detector. - - Set default rule sets and custom rule set files. - - See section "Using multiple rule sets" in the PHP Mess Detector - manual at URL ‘http://phpmd.org/documentation/index.html’(3). - - This variable is an option for the syntax checker ‘`php-phpmd'’. - - -- Flycheck Syntax Checker: php -phpcs - - A PHP style checker using PHP_CodeSniffer. - - See URL ‘http://pear.php.net/package/PHP_CodeSniffer/’(4). - - Options -............ - - -- User Option: flycheck -phpcs-standard - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - The coding standard for PHP CodeSniffer. - - When nil, use the default standard from the global PHP - CodeSniffer configuration. When set to a string, pass the string - to PHP CodeSniffer which will interpret it as name as a standard, - or as path to a standard specification. - - This variable is an option for the syntax checker ‘`php-phpcs'’. - - ---------- Footnotes ---------- - - (1) http://php.net/manual/en/features.commandline.php - - (2) http://phpmd.org/ - - (3) http://phpmd.org/documentation/index.html - - (4) http://pear.php.net/package/PHP_CodeSniffer/ - - -File: flycheck.info, Node: Puppet, Next: Python, Prev: PHP, Up: Supported languages - -6.27 Puppet -=========== - - -- Flycheck Syntax Checker: puppet -parser - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note puppet-lint: 113, if there are no errors above - level ‘warning’ - - The *first* suitable syntax checker is used. - - A Puppet DSL syntax checker using puppet’s own parser. - - See URL ‘http://puppetlabs.com/’(1). - - -- Flycheck Syntax Checker: puppet -lint - - A Puppet DSL style checker using puppet-lint. - - See URL ‘http://puppet-lint.com/’(2). - - ---------- Footnotes ---------- - - (1) http://puppetlabs.com/ - - (2) http://puppet-lint.com/ - - -File: flycheck.info, Node: Python, Next: R, Prev: Puppet, Up: Supported languages - -6.28 Python -=========== - - -- Flycheck Syntax Checker: python -flake8 - - A Python syntax and style checker using Flake8. - - Requires Flake8 2.0 or newer. See URL - ‘https://pypi.python.org/pypi/flake8’(1). - - Options -............ - - -- User Option: flycheck -flake8-error-level-alist - - An alist mapping flake8 error IDs to Flycheck error levels. - - Each item in this list is a cons cell ‘(PATTERN . LEVEL)’ where - PATTERN is a regular expression matched against the error ID, and - LEVEL is a Flycheck error level symbol. - - Each PATTERN is matched in the order of appearance in this list - against the error ID. If it matches the ID, the level of the - corresponding error is set to LEVEL. An error that is not - matched by any PATTERN defaults to warning level. - - This option exists because flake8 categorises errors by the - underlying tool that produced them (e.g. F for pyflakes messages, - E for pep8 messages, etc.). These categorisations do not map - directly to Flycheck error levels. Hence, this option exists to - allow for a custom mapping. The default value handles all of the - built-in tools of flake8, and naming errors from pep8-naming. - - This variable is an option for the syntax checker ‘`python-flake8'’. - - This user option was introduced, or its default value was - changed, in version 0.22 of the flycheck package. - - -- User Option: flycheck -flake8-maximum-complexity - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘integerp’. - - The maximum McCabe complexity of methods. - - If nil, do not check the complexity of methods. If set to an - integer, report any complexity greater than the value of this - variable as warning. - - If set to an integer, this variable overrules any similar setting - in the configuration file denoted by *note ‘flycheck-flake8rc’: 118. - - This variable is an option for the syntax checker ‘`python-flake8'’. - - -- User Option: flycheck -flake8-maximum-line-length - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘integerp’. - - The maximum length of lines. - - If set to an integer, the value of this variable denotes the - maximum length of lines, overruling any similar setting in the - configuration file denoted by *note ‘flycheck-flake8rc’: 118. An error will - be reported for any line longer than the value of this variable. - - If set to nil, use the maximum line length from the configuration - file denoted by *note ‘flycheck-flake8rc’: 118, or the PEP 8 recommendation - of 79 characters if there is no configuration with this setting. - - This variable is an option for the syntax checker ‘`python-flake8'’. - - Configuration file -....................... - - -- User Option: flycheck -flake8rc - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - Configuration file for ‘`python-flake8'’. - - -- Flycheck Syntax 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/’(2). - - Configuration file -....................... - - -- User Option: flycheck -pylintrc - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - Configuration file for ‘`python-pylint'’. - - -- Flycheck Syntax Checker: python -pycompile - - A Python syntax checker using Python’s builtin compiler. - - See URL ‘https://docs.python.org/3.4/library/py_compile.html’(3). - -See also -........ - -flycheck-pyflakes(4) adds a Python syntax checker using Pyflakes. - - ---------- Footnotes ---------- - - (1) https://pypi.python.org/pypi/flake8 - - (2) http://www.pylint.org/ - - (3) https://docs.python.org/3.4/library/py_compile.html - - (4) https://github.com/Wilfred/flycheck-pyflakes - - -File: flycheck.info, Node: R, Next: Racket, Prev: Python, Up: Supported languages - -6.29 R -====== - - -- Flycheck Syntax Checker: r -lintr - - An R style and syntax checker using the lintr package. - - See URL ‘https://github.com/jimhester/lintr’(1). - - Options -............ - - -- User Option: flycheck -lintr-caching - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - Whether to enable caching in lintr. - - By default, lintr caches all expressions in a file and re-checks - only those that have changed. Setting this option to nil - disables caching in case there are problems. - - This variable is an option for the syntax checker ‘`r-lintr'’. - - This user option was introduced, or its default value was - changed, in version 0.23 of the flycheck package. - - -- User Option: flycheck -lintr-linters - - Variable properties: This variable may be risky if used - as a file-local variable. - - Linters to use with lintr. - - The value of this variable is a string containing an R - expression, which selects linters for lintr. - - This variable is an option for the syntax checker ‘`r-lintr'’. - - This user option was introduced, or its default value was - changed, in version 0.23 of the flycheck package. - - ---------- Footnotes ---------- - - (1) https://github.com/jimhester/lintr - - -File: flycheck.info, Node: Racket, Next: RPM SPEC, Prev: R, Up: Supported languages - -6.30 Racket -=========== - - -- Flycheck Syntax Checker: racket - - A Racket syntax checker using the Racket compiler. - - See URL ‘http://racket-lang.org/’(1). - - ---------- Footnotes ---------- - - (1) http://racket-lang.org/ - - -File: flycheck.info, Node: RPM SPEC, Next: ReStructuredText, Prev: Racket, Up: Supported languages - -6.31 RPM SPEC -============= - - -- Flycheck Syntax Checker: rpm -rpmlint - - A RPM SPEC file syntax checker using rpmlint. - - See URL ‘http://sourceforge.net/projects/rpmlint/’(1). - - ---------- Footnotes ---------- - - (1) http://sourceforge.net/projects/rpmlint/ - - -File: flycheck.info, Node: ReStructuredText, Next: Ruby, Prev: RPM SPEC, Up: Supported languages - -6.32 ReStructuredText -===================== - - -- Flycheck Syntax Checker: rst - - A ReStructuredText (RST) syntax checker using Docutils. - - See URL ‘http://docutils.sourceforge.net/’(1). - - -- Flycheck Syntax Checker: rst -sphinx - - A ReStructuredText (RST) syntax checker using Sphinx. - - Requires Sphinx 1.2 or newer. See URL ‘http://sphinx-doc.org’(2). - - Options -............ - - -- User Option: flycheck -sphinx-warn-on-missing-references - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - Whether to warn about missing references in Sphinx. - - When non-nil (the default), warn about all missing references in - Sphinx via ‘`-n'’. - - This variable is an option for the syntax checker ‘`rst-sphinx'’. - - This user option was introduced, or its default value was - changed, in version 0.17 of the flycheck package. - - ---------- Footnotes ---------- - - (1) http://docutils.sourceforge.net/ - - (2) http://sphinx-doc.org - - -File: flycheck.info, Node: Ruby, Next: Rust, Prev: ReStructuredText, Up: Supported languages - -6.33 Ruby -========= - - -- Flycheck Syntax Checker: ruby -rubocop - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note ruby-rubylint: 12c, if there are no errors above - level ‘warning’ - - The *first* suitable syntax checker is used. - - A Ruby syntax and style checker using the RuboCop tool. - - See URL ‘http://batsov.com/rubocop/’(1). - - Options -............ - - -- User Option: flycheck -rubocop-lint-only - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - 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. - - This variable is an option for the syntax checker ‘`ruby-rubocop'’. - - This user option was introduced, or its default value was - changed, in version 0.16 of the flycheck package. - - Configuration file -....................... - - -- User Option: flycheck -rubocoprc - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - Configuration file for ‘`ruby-rubocop'’. - - -- Flycheck Syntax Checker: ruby -rubylint - - A Ruby syntax and code analysis checker using ruby-lint. - - Requires ruby-lint 2.0 or newer. To use *note ‘flycheck-rubylintrc’: 12f, - ruby-lint 2.0.2 or newer is required. See URL - ‘https://github.com/YorickPeterse/ruby-lint’(2). - - Configuration file -....................... - - -- User Option: flycheck -rubylintrc - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - Configuration file for ‘`ruby-rubylint'’. - - Warning: You need ruby-lint version 2.0.2 or newer to use - this variable. - - -- Flycheck Syntax Checker: ruby - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note ruby-rubylint: 12c, if there are no errors above - level ‘warning’ - - The *first* suitable syntax checker is used. - - A Ruby syntax checker using the standard Ruby interpreter. - - Please note that the output of different Ruby versions and - implementations varies wildly. This syntax checker supports - current versions of MRI and JRuby, but may break when used with - other implementations or future versions of these - implementations. - - Please consider using ‘`ruby-rubocop'’ or ‘`ruby-rubylint'’ instead. - - See URL ‘https://www.ruby-lang.org/’(3). - - -- Flycheck Syntax Checker: ruby -jruby - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note ruby-rubylint: 12c, if there are no errors above - level ‘warning’ - - The *first* suitable syntax checker is used. - - A Ruby syntax checker using the JRuby interpreter. - - This syntax checker is very primitive, and may break on future - versions of JRuby. - - Please consider using ‘`ruby-rubocop'’ or ‘`ruby-rubylint'’ instead. - - See URL ‘http://jruby.org/’(4). - - ---------- Footnotes ---------- - - (1) http://batsov.com/rubocop/ - - (2) https://github.com/YorickPeterse/ruby-lint - - (3) https://www.ruby-lang.org/ - - (4) http://jruby.org/ - - -File: flycheck.info, Node: Rust, Next: Sass, Prev: Ruby, Up: Supported languages - -6.34 Rust -========= - - -- Flycheck Syntax Checker: rust - - A Rust syntax checker using Rust compiler. - - This syntax checker needs Rust 0.10 or newer. - - See URL ‘http://www.rust-lang.org’(1). - - Options -............ - - -- User Option: flycheck -rust-check-tests - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - Whether to check test code in Rust. - - When non-nil, ‘`rustc'’ is passed the ‘`--test'’ flag, which will - check any code marked with the ‘#[cfg(test)]’ attribute and any - functions marked with ‘#[test]’. Otherwise, ‘`rustc'’ is not passed - ‘`--test'’ and test code will not be checked. Skipping ‘`--test'’ is - necessary when using ‘#![no_std]’, because compiling the test - runner requires ‘`std'’. - - This variable is an option for the syntax checker ‘`rust'’. - - -- User Option: flycheck -rust-crate-root - - Variable properties: Automatically becomes buffer-local - when set. This variable is safe as a file local variable - if its value satisfies the predicate ‘stringp’. - - A path to the crate root for the current buffer. - - The value of this variable is either a string with the path to - the crate root for the current buffer, or nil if the current buffer - is a crate. A relative path is relative to the current buffer. - - If this variable is non nil the current buffer will only be checked - if it is not modified, i.e. after it has been saved. - - This variable is an option for the syntax checker ‘`rust'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - -- User Option: flycheck -rust-crate-type - - Variable properties: Automatically becomes buffer-local - when set. This variable is safe as a file local variable - if its value satisfies the predicate ‘stringp’. - - The type of the Rust Crate to check. - - The value of this variable is a string denoting the crate type, - for the ‘`--crate-type'’ flag. - - This variable is an option for the syntax checker ‘`rust'’. - - -- User Option: flycheck -rust-library-path - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - A list of library directories for Rust. - - The value of this variable is a list of strings, where each - string is a directory to add to the library path of Rust. - Relative paths are relative to the file being checked. - - This variable is an option for the syntax checker ‘`rust'’. - - This user option was introduced, or its default value was - changed, in version 0.18 of the flycheck package. - - See also -............. - - The flycheck-rust(2) extension customizes this syntax checker - according to the Cargo project layout and settings. - - ---------- Footnotes ---------- - - (1) http://www.rust-lang.org - - (2) https://github.com/flycheck/flycheck-rust - - -File: flycheck.info, Node: Sass, Next: Scala, Prev: Rust, Up: Supported languages - -6.35 Sass -========= - - -- Flycheck Syntax Checker: sass - - A Sass syntax checker using the Sass compiler. - - See URL ‘http://sass-lang.com’(1). - - Options -............ - - -- User Option: flycheck -sass-compass - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - Whether to enable the Compass CSS framework. - - When non-nil, enable the Compass CSS framework, via ‘`--compass'’. - - This variable is an option for the syntax checker ‘`sass'’. - - This user option was introduced, or its default value was - changed, in version 0.16 of the flycheck package. - - ---------- Footnotes ---------- - - (1) http://sass-lang.com - - -File: flycheck.info, Node: Scala, Next: Scss, Prev: Sass, Up: Supported languages - -6.36 Scala -========== - - -- Flycheck Syntax Checker: scala - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note scala-scalastyle: 13e, if there are no errors above - level ‘warning’ - - The *first* suitable syntax checker is used. - - A Scala syntax checker using the Scala compiler. - - See URL ‘http://www.scala-lang.org/’(1). - - -- Flycheck Syntax Checker: scala -scalastyle - - A Scala style checker using scalastyle. - - Note that this syntax checker is not used if - *note ‘flycheck-scalastyle-jar’: 13f. or *note ‘flycheck-scalastylerc’: 140. are nil or - point to non-existing files. - - See URL ‘http://www.scalastyle.org’(2). - - Options -............ - - -- User Option: flycheck -scalastyle-jar - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - The path to the main JAR file of Scalastyle. - - If this option is nil, or points to a non-existing file, - ‘`scala-scalastyle'’ can not be used. - - This variable is an option for the syntax checker ‘`scala-scalastyle'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - Configuration file -....................... - - -- User Option: flycheck -scalastylerc - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - Configuration file for ‘`scala-scalastyle'’. - - This user option was introduced, or its default value was - changed, in version 0.20 of the flycheck package. - - ---------- Footnotes ---------- - - (1) http://www.scala-lang.org/ - - (2) http://www.scalastyle.org - - -File: flycheck.info, Node: Scss, Next: Shell script languages, Prev: Scala, Up: Supported languages - -6.37 Scss -========= - - -- Flycheck Syntax Checker: scss - - A SCSS syntax checker using the SCSS compiler. - - See URL ‘http://sass-lang.com’(1). - - Options -............ - - -- User Option: flycheck -scss-compass - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘booleanp’. - - Whether to enable the Compass CSS framework. - - When non-nil, enable the Compass CSS framework, via ‘`--compass'’. - - This variable is an option for the syntax checker ‘`scss'’. - - This user option was introduced, or its default value was - changed, in version 0.16 of the flycheck package. - - ---------- Footnotes ---------- - - (1) http://sass-lang.com - - -File: flycheck.info, Node: Shell script languages, Next: Slim, Prev: Scss, Up: Supported languages - -6.38 Shell script languages -=========================== - - -- Flycheck Syntax Checker: sh -bash - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note sh-shellcheck: 146, if there are no errors above - level ‘warning’ - - The *first* suitable syntax checker is used. - - A Bash syntax checker using the Bash shell. - - See URL ‘http://www.gnu.org/software/bash/’(1). - - -- Flycheck Syntax Checker: sh -posix-dash - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note sh-shellcheck: 146, if there are no errors above - level ‘warning’ - - The *first* suitable syntax checker is used. - - A POSIX Shell syntax checker using the Dash shell. - - See URL ‘http://gondor.apana.org.au/~herbert/dash/’(2). - - See also -............. - - POSIX Shell Command Language(3) - - -- Flycheck Syntax Checker: sh -posix-bash - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note sh-shellcheck: 146, if there are no errors above - level ‘warning’ - - The *first* suitable syntax checker is used. - - A POSIX Shell syntax checker using the Bash shell. - - See URL ‘http://www.gnu.org/software/bash/’(4). - - See also -............. - - GNU Bash POSIX Mode(5), POSIX Shell Command Language(6) - - -- Flycheck Syntax Checker: sh -zsh - - Chained syntax checkers: The following syntax checkers are - *note chained: a0. after this syntax checker: - - 1. *note sh-shellcheck: 146, if there are no errors above - level ‘warning’ - - The *first* suitable syntax checker is used. - - A Zsh syntax checker using the Zsh shell. - - See URL ‘http://www.zsh.org/’(7). - - -- Flycheck Syntax Checker: sh -shellcheck - - A shell script syntax and style checker using Shellcheck. - - See URL ‘https://github.com/koalaman/shellcheck/’(8). - - Options -............ - - -- User Option: flycheck -shellcheck-excluded-warnings - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate *note - flycheck-string-list-p: 99. - - A list of excluded warnings for ShellCheck. - - The value of this variable is a list of strings, where each - string is a warning code to be excluded from ShellCheck reports. - By default, no warnings are excluded. - - This variable is an option for the syntax checker ‘`sh-shellcheck'’. - - This user option was introduced, or its default value was - changed, in version 0.21 of the flycheck package. - - ---------- Footnotes ---------- - - (1) http://www.gnu.org/software/bash/ - - (2) http://gondor.apana.org.au/~herbert/dash/ - - (3) -http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html - - (4) http://www.gnu.org/software/bash/ - - (5) -http://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html#Bash-POSIX-Mode - - (6) -http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html - - (7) http://www.zsh.org/ - - (8) https://github.com/koalaman/shellcheck/ - - -File: flycheck.info, Node: Slim, Next: TeX/LaTeX, Prev: Shell script languages, Up: Supported languages - -6.39 Slim -========= - - -- Flycheck Syntax Checker: slim - - A Slim syntax checker using the Slim compiler. - - See URL ‘http://slim-lang.com’(1). - - ---------- Footnotes ---------- - - (1) http://slim-lang.com - - -File: flycheck.info, Node: TeX/LaTeX, Next: Texinfo, Prev: Slim, Up: Supported languages - -6.40 TeX/LaTeX -============== - -See also -........ - -LaTeX(1), TeX Live(2) - - -- Flycheck Syntax Checker: tex -chktex - - A TeX and LaTeX syntax and style checker using chktex. - - See URL ‘http://www.nongnu.org/chktex/’(3). - - Configuration file -....................... - - -- User Option: flycheck -chktexrc - - Variable properties: This variable is safe as a file - local variable if its value satisfies the predicate - ‘stringp’. - - Configuration file for ‘`tex-chktex'’. - - -- Flycheck Syntax Checker: tex -lacheck - - A LaTeX syntax and style checker using lacheck. - - See URL ‘http://www.ctan.org/pkg/lacheck’(4). - - ---------- Footnotes ---------- - - (1) http://www.latex-project.org/ - - (2) http://www.tug.org/texlive/ - - (3) http://www.nongnu.org/chktex/ - - (4) http://www.ctan.org/pkg/lacheck - - -File: flycheck.info, Node: Texinfo, Next: Verilog, Prev: TeX/LaTeX, Up: Supported languages - -6.41 Texinfo -============ - - -- Flycheck Syntax Checker: texinfo - - A Texinfo syntax checker using makeinfo. - - See URL ‘http://www.gnu.org/software/texinfo/’(1). - - ---------- Footnotes ---------- - - (1) http://www.gnu.org/software/texinfo/ - - -File: flycheck.info, Node: Verilog, Next: XML, Prev: Texinfo, Up: Supported languages - -6.42 Verilog -============ - - -- Flycheck Syntax Checker: verilog -verilator - - A Verilog syntax checker using the Verilator Verilog HDL simulator. - - See URL ‘http://www.veripool.org/wiki/verilator’(1). - - ---------- Footnotes ---------- - - (1) http://www.veripool.org/wiki/verilator - - -File: flycheck.info, Node: XML, Next: YAML, Prev: Verilog, Up: Supported languages - -6.43 XML -======== - - -- Flycheck Syntax Checker: xml -xmlstarlet - - A XML syntax checker and validator using the xmlstarlet utility. - - See URL ‘http://xmlstar.sourceforge.net/’(1). - - -- Flycheck Syntax Checker: xml -xmllint - - A XML syntax checker and validator using the xmllint utility. - - The xmllint is part of libxml2, see URL - ‘http://www.xmlsoft.org/’(2). - - ---------- Footnotes ---------- - - (1) http://xmlstar.sourceforge.net/ - - (2) http://www.xmlsoft.org/ - - -File: flycheck.info, Node: YAML, Prev: XML, Up: Supported languages - -6.44 YAML -========= - - -- Flycheck Syntax Checker: yaml -jsyaml - - A YAML syntax checker using JS-YAML. - - See URL ‘https://github.com/nodeca/js-yaml’(1). - - -- Flycheck Syntax Checker: yaml -ruby - - A YAML syntax checker using Ruby’s YAML parser. - - This syntax checker uses the YAML parser from Ruby’s standard - library. - - See URL ‘http://www.ruby-doc.org/stdlib-2.0.0/libdoc/yaml/rdoc/YAML.html’(2). - - ---------- Footnotes ---------- - - (1) https://github.com/nodeca/js-yaml - - (2) http://www.ruby-doc.org/stdlib-2.0.0/libdoc/yaml/rdoc/YAML.html - - -File: flycheck.info, Node: Glossary, Next: Flycheck releases, Prev: Supported languages, Up: Top - -7 Glossary -********** - -syntax checker - - A symbol which is defined as syntax checker with *note - flycheck-define-checker: 19. - -registered syntax checker - - A *note syntax checker: 64. available for automatic selection, i.e. - that is contained in *note flycheck-checkers: 5e. - -disabled syntax checker - - A *note syntax checker: 64. explicitly excluded from available - selection, i.e. that is contained in *note - flycheck-disabled-checkers: 5f. - -enabled syntax checker - - A *note registered syntax checker: 60. which is not a *note - disabled syntax checker: 15f. - -suitable syntax checker - - A *note syntax checker: 64. which can be used to check the current - buffer. Precisely, a syntax checker which - - - which can be used for the current major mode, - - - and whose predicate succeeds, - - - and whose syntax checker tool exists. - -chaining - - In some languages, multiple *note syntax checkers: 64. can be - applied to a buffer. In such a case, each syntax checker specifies - which checkers are to be used after it and when. The result is a - “syntax checker chain”, specifying all syntax checkers to be - applied to the buffer. - - For instance, Haskell buffers are first checked with GHC for syntax - and type errors, and then with ‘hlint’ for idiomatic and semantic - mistakes. Hence, the syntax checker chain consists of *note - haskell-ghc: eb. and *note haskell-hlint: ec. - - -File: flycheck.info, Node: Flycheck releases, Next: Extending Flycheck, Prev: Glossary, Up: Top - -8 Flycheck releases -******************* - -This document contains the release announcements for Flycheck, and the -complete changelog. - -* Menu: - -* Release announcements:: -* Changelog:: - - -File: flycheck.info, Node: Release announcements, Next: Changelog, Up: Flycheck releases - -8.1 Release announcements -========================= - -* Menu: - -* Flycheck 0.22: Flycheck 0 22. -* Flycheck 0.21: Flycheck 0 21. -* Flycheck 0.20: Flycheck 0 20. -* Flycheck 0.19: Flycheck 0 19. -* Flycheck 0.18: Flycheck 0 18. -* Flycheck 0.17: Flycheck 0 17. -* Flycheck 0.16: Flycheck 0 16. -* Flycheck 0.15: Flycheck 0 15. - - -File: flycheck.info, Node: Flycheck 0 22, Next: Flycheck 0 21, Up: Release announcements - -8.1.1 Flycheck 0.22 -------------------- - - -date: Dec 23, 2014 - - -version: 0.22 - -Flycheck 0.22 comes with some major new features, most notably generic -syntax checkers and many improvements and bug fixes. Unfortunately, -some of these changes break backwards compatibility. - -This announcement covers the most important changes. For details, -please refer to the *note Changelog: 165. - -* Menu: - -* Breaking changes:: -* Setup: Setup<2>. -* Language support:: -* Syntax checking improvements:: -* Error list improvements:: -* Generic syntax checkers:: -* Error IDs:: -* Unit test library for Flycheck:: - - -File: flycheck.info, Node: Breaking changes, Next: Setup<2>, Up: Flycheck 0 22 - -8.1.1.1 Breaking changes -........................ - - Warning: The addition of generic syntax checkers lead to some - breaking changes to the internals of syntax checker definitions. - Due to the way macros work in Emacs Lisp *all packages depending on - Flycheck* must be recompiled after upgrading to Flycheck 0.22! - - We hope that this will be the last breaking change of this kind, - since the definition of syntax checkers is now wrapped into - functions, and the *note flycheck-define-checker: 19. macro just - provides some syntactic sugar for definitions. - -Error parsers must explicitly set *note flycheck-error buffer: 167. and -*note flycheck-error checker: 168. of new *note flycheck-error: 169. -objects now. This is another consequence of generic syntax checkers. - -‘flycheck-perlcritic-verbosity’ and ‘flycheck-copy-messages-as-kill’ are -obsolete now, in favour of *note flycheck-perlcritic-severity: 10a. and -*note flycheck-copy-errors-as-kill: 85. respectively. -‘flycheck-google-messages’ has been removed completely. - -*note flycheck-select-checker: 24. cannot select disabled syntax -checkers anymore. - -Syntax checker options and configuration file variables are not -buffer-local anymore, with some exceptions. Consequently you can now -use ‘setq’ to set their global value, and you *must* use ‘setq-local’ to -set them locally. Variables set via file or directory variables are not -affected by this change. - - -File: flycheck.info, Node: Setup<2>, Next: Language support, Prev: Breaking changes, Up: Flycheck 0 22 - -8.1.1.2 Setup -............. - -The new *note flycheck-verify-setup: 5a. command provides information -about all applicable syntax checkers, and lists potential problems. It -is intended to help you uncover issues in your Flycheck setup. - - -File: flycheck.info, Node: Language support, Next: Syntax checking improvements, Prev: Setup<2>, Up: Flycheck 0 22 - -8.1.1.3 Language support -........................ - -* Menu: - -* Ada: Ada<2>. -* C/C++: C/C++<2>. -* Emacs Lisp: Emacs Lisp<2>. -* Haskell: Haskell<2>. -* Fortran: Fortran<2>. -* Python: Python<2>. -* Rust: Rust<2>. -* TeX/LaTeX: TeX/LaTeX<2>. - - -File: flycheck.info, Node: Ada<2>, Next: C/C++<2>, Up: Language support - -8.1.1.4 Ada -........... - -The new option *note flycheck-gnat-args: 97. allows to pass arbitrary -arguments to *note ada-gnat: 96. - - -File: flycheck.info, Node: C/C++<2>, Next: Emacs Lisp<2>, Prev: Ada<2>, Up: Language support - -8.1.1.5 C/C++ -............. - -Flycheck now correctly computes the error level from errors in included -files. Messages of errors in included files are now discarded to reduce -the verbosity of error reporting. - -The new options *note flycheck-clang-args: a2. and *note -flycheck-gcc-args: ad. allow to pass arbitrary arguments to *note -c/c++-clang: 9f. and *note c/c++-gcc: ac. respectively. - - -File: flycheck.info, Node: Emacs Lisp<2>, Next: Haskell<2>, Prev: C/C++<2>, Up: Language support - -8.1.1.6 Emacs Lisp -.................. - -The new ‘inherit’ value for *note flycheck-emacs-lisp-load-path: d0. -automates ‘load-path’ inheritance for the *note emacs-lisp: cd. syntax -checker. If you have the following in your init file - - (setq-default flycheck-emacs-lisp-load-path load-path) - -please replace it with: - - (setq flycheck-emacs-lisp-load-path 'inherit) - -As a consequence of this change you can now enable ‘load-path’ -inheritance via customize. - - -File: flycheck.info, Node: Haskell<2>, Next: Fortran<2>, Prev: Emacs Lisp<2>, Up: Language support - -8.1.1.7 Haskell -............... - -The *note haskell-ghc: eb. syntax checker supports literate Haskell now. - -The new option *note flycheck-ghc-args: ed. allows to pass arbitrary -arguments to *note haskell-ghc: eb. - - -File: flycheck.info, Node: Fortran<2>, Next: Python<2>, Prev: Haskell<2>, Up: Language support - -8.1.1.8 Fortran -............... - -The new option *note flycheck-gfortran-args: d9. allows to pass -arbitrary arguments to *note fortran-gfortran: d8. - - -File: flycheck.info, Node: Python<2>, Next: Rust<2>, Prev: Fortran<2>, Up: Language support - -8.1.1.9 Python -.............. - -The new syntax checker *note python-pycompile: 11c. uses the built-in -byte compiler of Python to check a buffer for syntax errors. It is -provided as a last resort for basic syntax checking of Python code, if -neither pylint nor flake8 are installed. - -The error levels of *note python-flake8: 115. can now be customized via -*note flycheck-flake8-error-level-alist: 116. The default value handles -the standard plugins of flake8, and the 3rd party pep8-naming plugin. -You can add custom patterns to this option to add support for other -flake8 plugins. - -*note python-pylint: 11a. now has correct error columns. - - -File: flycheck.info, Node: Rust<2>, Next: TeX/LaTeX<2>, Prev: Python<2>, Up: Language support - -8.1.1.10 Rust -............. - -The *note rust: 133. parses help messages to ‘info’-level errors now. - - -File: flycheck.info, Node: TeX/LaTeX<2>, Prev: Rust<2>, Up: Language support - -8.1.1.11 TeX/LaTeX -.................. - -*note tex-chktex: 14f. now has correct error columns as well. - - -File: flycheck.info, Node: Syntax checking improvements, Next: Error list improvements, Prev: Language support, Up: Flycheck 0 22 - -8.1.1.12 Syntax checking improvements -..................................... - -Flycheck now parses errors faster, because it does not longer access the -file system to check the file of each parsed errors, and it protects -against excessive error reporting by automatically disabling syntax -checkers that try to report too many errors. The threshold is -customizable via the new *note flycheck-checker-error-threshold: 71. -option. - - -File: flycheck.info, Node: Error list improvements, Next: Generic syntax checkers, Prev: Syntax checking improvements, Up: Flycheck 0 22 - -8.1.1.13 Error list improvements -................................ - -The error list now shows errors IDs for syntax checkers that emit these. - -Typing ‘g’ in the error list will re-check the source buffer, and -refresh the error list afterwards. - - -File: flycheck.info, Node: Generic syntax checkers, Next: Error IDs, Prev: Error list improvements, Up: Flycheck 0 22 - -8.1.1.14 Generic syntax checkers -................................ - -Flycheck now supports “generic” syntax checkers, which call arbitrary -synchronous or asynchronous Emacs Lisp functions to check a buffer. The -new function *note flycheck-define-generic-checker: 1b. defines a new -generic syntax checker which calls a given function to conduct a syntax -check. - -Syntax checkers for external commands are now called “command syntax -checkers”, and implemented as a special kind of generic syntax checkers. -*note flycheck-define-checker: 19. still defines a command syntax -checker. The new function *note flycheck-define-command-checker: 177. -is a non-macro variant of *note flycheck-define-generic-checker: 1b. - - -File: flycheck.info, Node: Error IDs, Next: Unit test library for Flycheck, Prev: Generic syntax checkers, Up: Flycheck 0 22 - -8.1.1.15 Error IDs -.................. - -Syntax checkers can now add “IDs” to errors, which shall uniquely -identify a particular kind of error. These IDs are used by Flycheck and -Flycheck extensions to identify errors, particularly in future -extensions such as error fixers. - -The new ‘id’ form for error patterns allows to parse IDs. Error parsers -and generic syntax checkers can set the *note flycheck-error id: 179. -slot to add IDs. The *note flycheck-parse-checkstyle: 17a. parser -automatically adds IDs from the ‘source’ attribute of errors. - -The new error filters *note flycheck-dequalify-error-ids: 17b. and *note -flycheck-remove-error-ids: 17c. manipulate IDs of parsed errors. The -former removes qualifications from error IDs, turning ‘Foo.Bar.E1’ into -‘E1’. The latter completely removes error IDs from parsed errors, for -use in cases where the syntax checker only outputs bogus IDs. - -All built-in syntax checkers were updated to parse IDs, if possible. - -The error list now shows these IDs, and *note -flycheck-copy-errors-as-kill: 85. can put them into the kill ring. - - -File: flycheck.info, Node: Unit test library for Flycheck, Prev: Error IDs, Up: Flycheck 0 22 - -8.1.1.16 Unit test library for Flycheck -....................................... - -The new library ‘flycheck-ert’ provides assertions and utilities to -write unit tests for Flycheck syntax checkers. The library is part of -all Flycheck packages. - -3rd party extensions may use this library to write test cases for their -syntax checkers. *note Flycheck ERT API: 17e. documents the interface -of this library. - - -File: flycheck.info, Node: Flycheck 0 21, Next: Flycheck 0 20, Prev: Flycheck 0 22, Up: Release announcements - -8.1.2 Flycheck 0.21 -------------------- - - -date: Oct 26, 2014 - - -version: 0.21 - -Flycheck 0.21 is out, with new syntax checkers, many new options, -improvements and bug fixes, and some important breaking changes. - -This announcement covers the most important changes. For details, -please refer to the *note Changelog: 165. - -* Menu: - -* Breaking changes: Breaking changes<2>. -* Language support: Language support<2>. -* Error list changes:: -* Error navigation and display:: -* Syntax checker definition and extension:: -* Obtaining the new release:: - - -File: flycheck.info, Node: Breaking changes<2>, Next: Language support<2>, Up: Flycheck 0 21 - -8.1.2.1 Breaking changes -........................ - - Warning: The value of the ‘:next-checkers’ property changed in a - backwards-incompatible way. The custom symbols ‘no-errors’ and - ‘warnings-only’ are gone. Instead the first item of each cons cell - is the _maximum permissible error level_ now. For instance, - ‘:next-checkers ((no-errors . foo))’ now becomes ‘:next-checkers - ((warning . foo))’. Please update all your syntax checker - definitions accordingly. - -The *note html-tidy: f4. syntax checker does not check Web Mode buffers -anymore, because will frequently contain strictly invalid HTML. - -The *note d-dmd: c7. syntax checker requires DMD 2.066 or newer now, to -add columns to error locations. - -The error list highlights all errors at the current line now. -Highlighting of errors at point, i.e. the -‘flycheck-error-list-highlight-at-point’ face and related functionality, -was removed, because it would frequently cause odd and confusing -highlighting. - - -File: flycheck.info, Node: Language support<2>, Next: Error list changes, Prev: Breaking changes<2>, Up: Flycheck 0 21 - -8.1.2.2 Language support -........................ - -Flycheck now supports the Coq proof language and RPM spec files with the -new syntax checkers *note coq: c3. and *note rpm-rpmlint: 125. -respectively. - -* Menu: - -* C/C++: C/C++<3>. -* D: D<2>. -* Go: Go<2>. -* HTML: HTML<2>. -* Less:: -* Shell scripts:: - - -File: flycheck.info, Node: C/C++<3>, Next: D<2>, Up: Language support<2> - -8.1.2.3 C/C++ -............. - -The new *note flycheck-gcc-openmp: b4. enables OpenMP for the *note -c/c++-gcc: ac. checker to suppress warnings about OpenMP pragmas. - -The *note c/c++-gcc: ac. expands templates during syntax checks now. - -The *note c/c++-clang: 9f. syntax checker now handles empty messages -from ‘#error’ and ‘#warning’ pragmas correctly. - - -File: flycheck.info, Node: D<2>, Next: Go<2>, Prev: C/C++<3>, Up: Language support<2> - -8.1.2.4 D -......... - -The *note d-dmd: c7. syntax checker reports columns now, making error -locations more precise. This requires DMD 2.066. Support for earlier -DMD versions was dropped. - - -File: flycheck.info, Node: Go<2>, Next: HTML<2>, Prev: D<2>, Up: Language support<2> - -8.1.2.5 Go -.......... - -*note go-errcheck: e4. now handles packages correctly, fixing many -faulty warnings. - - -File: flycheck.info, Node: HTML<2>, Next: Less, Prev: Go<2>, Up: Language support<2> - -8.1.2.6 HTML -............ - -*note html-tidy: f4. does not check Web Mode buffers anymore. - - -File: flycheck.info, Node: Less, Next: Shell scripts, Prev: HTML<2>, Up: Language support<2> - -8.1.2.7 Less -............ - -*note less: 101. now correctly resolves relative paths in ‘data-uri’. - - -File: flycheck.info, Node: Shell scripts, Prev: Less, Up: Language support<2> - -8.1.2.8 Shell scripts -..................... - -The new *note flycheck-shellcheck-excluded-warnings: 14a. allows to -exclude specific warnings from reports of the *note sh-shellcheck: 146. -checker. - -In a related change, *note sh-shellcheck: 146. now includes the warning -code into all reported errors, which makes it easier to set *note -flycheck-shellcheck-excluded-warnings: 14a. accordingly. - - -File: flycheck.info, Node: Error list changes, Next: Error navigation and display, Prev: Language support<2>, Up: Flycheck 0 21 - -8.1.2.9 Error list changes -.......................... - -The error list at *note flycheck-list-errors: 4b. was refined and fixed: - - - Mouse support is restored: You can now click onto error messages - again, to navigate to the error source. - - - When navigating inside the error list with ‘n’ or ‘p’, the error - list does not randomly alter the point position anymore. - - - The syntax checker name now appears in a separate column. The - appearance of this column can be customized with new face :face: - ‘flycheck-error-list-checker-name’. - - - Errors can be sorted by syntax checker name and message now. - - - The new hook *note flycheck-error-list-after-refresh-hook: 7e. now - runs every time the error list was refreshed. - - - The error list does not highlight errors at point separately - anymore, to avoid confusing highlighting. - - -File: flycheck.info, Node: Error navigation and display, Next: Syntax checker definition and extension, Prev: Error list changes, Up: Flycheck 0 21 - -8.1.2.10 Error navigation and display -..................................... - -The new option *note flycheck-navigation-minimum-level: 8a. allows to -skip errors of specific error levels in error navigation, i.e. ‘M-g n’ -or ‘C-c ! n’. Errors of levels below the value of this new option are -still shown in the buffer and in the error list, but they are skipped in -any of the navigation commands. - -The new function *note -flycheck-display-error-messages-unless-error-list: 7a. shows messages of -the errors at point in the echo area, but only if the error list is -_not_ visible. Use this function for *note -flycheck-display-errors-function: 2b. to make use of this feature. - - -File: flycheck.info, Node: Syntax checker definition and extension, Next: Obtaining the new release, Prev: Error navigation and display, Up: Flycheck 0 21 - -8.1.2.11 Syntax checker definition and extension -................................................ - -The ‘:next-checkers’ property requires a maximum permissible error level -now. The custom predicates ‘no-errors’ and ‘warnings-only’ are gone. - -Syntax checker definitions can use the new ‘null-device’ symbol to add -the name of the system null device (e.g. ‘/dev/null’ on Unix, ‘NUL’ on -Windows) to the syntax checker arguments. Typically, this would be used -to ignore files generated by the syntax checker. See the definition of -the *note c/c++-gcc: ac. syntax checker for an example. - -The new function *note flycheck-add-mode: 18c. adds major modes to -existing syntax checkers, by extending the ‘:modes’ property. - - -File: flycheck.info, Node: Obtaining the new release, Prev: Syntax checker definition and extension, Up: Flycheck 0 21 - -8.1.2.12 Obtaining the new release -.................................. - -Follow the *note installation instructions: 33. If you already have -Flycheck installed, just update it from ‘M-x list-packages’. - - -File: flycheck.info, Node: Flycheck 0 20, Next: Flycheck 0 19, Prev: Flycheck 0 21, Up: Release announcements - -8.1.3 Flycheck 0.20 -------------------- - - -date: Aug 12, 2014 - - -version: 0.20 - -Flycheck 0.20 is out, with new syntax checkers, many new options, -improvements and bug fixes, and some important breaking changes. - -This announcement covers the most important changes. For details, -please refer to the *note Changelog: 165. - -* Menu: - -* Breaking changes: Breaking changes<3>. -* Language support: Language support<3>. -* Error list improvements: Error list improvements<2>. -* User interface improvements:: -* Miscellaneous new features:: -* Miscellaneous fixes:: -* Get it:: - - -File: flycheck.info, Node: Breaking changes<3>, Next: Language support<3>, Up: Flycheck 0 20 - -8.1.3.1 Breaking changes -........................ - - Warning: The internals of syntax checker definitions changed in a - backwards-incompatible way. Due to the way macros work in Emacs - Lisp *all packages depending on Flycheck* must be recompiled after - upgrading to Flycheck 0.20! - -Furthermore, the special meaning of a trailing equals sign in ‘(config -…)’ and ‘(config-file …)’ is removed. Syntax checker definitions now -need to explicitly specify a function to concatenate the option and its -arguments. ‘(option "--foo=" foo)’ now becomes ‘(option "--foo=" foo -concat)’. - -As a consequence of this change, the position of the ‘filter’ in -‘(option …)’ changed. The ‘filter’ is now in the *forth* element. -Hence, ‘(option "--foo" foo flycheck-option-int)’ now becomes ‘(option -"--foo" foo nil flycheck-option-int)’. - - -File: flycheck.info, Node: Language support<3>, Next: Error list improvements<2>, Prev: Breaking changes<3>, Up: Flycheck 0 20 - -8.1.3.2 Language support -........................ - -Flycheck now supports Ada and Fortran with *note ada-gnat: 96. and *note -fortran-gfortran: d8. respectively. - -* Menu: - -* C/C++: C/C++<4>. -* Rust: Rust<3>. -* Scala: Scala<2>. -* Sass/SCSS:: -* Javascript: Javascript<2>. -* Ruby: Ruby<2>. - - -File: flycheck.info, Node: C/C++<4>, Next: Rust<3>, Up: Language support<3> - -8.1.3.3 C/C++ -............. - -C/C++ can now be checked with GCC (*note c/c++-gcc: ac.) as an -alternative to Clang. GCC supports the same options as Clang, with the -exception of *note flycheck-clang-blocks: a3. - -The Clang syntax checker now supports the Clang block syntax with the -new option *note flycheck-clang-blocks: a3, and allows to disable -exceptions with *note flycheck-clang-no-exceptions: a9. - -Furthermore, temporary files for the Clang syntax checker are now -created in the system temporary directory. - - -File: flycheck.info, Node: Rust<3>, Next: Scala<2>, Prev: C/C++<4>, Up: Language support<3> - -8.1.3.4 Rust -............ - -Support for Rust creates is greatly improved. You can now specify the -type of crate to check with ‘flycheck-rust-crate-type’, and the root -file of the crate with ‘flycheck-rust-crate-root’. The former avoids -redundant warnings due to unused code, and the latter helps to resolve -relative module references. - -Flycheck also parses info messages from Rust now. - - -File: flycheck.info, Node: Scala<2>, Next: Sass/SCSS, Prev: Rust<3>, Up: Language support<3> - -8.1.3.5 Scala -............. - -Flycheck now supports Scalastyle(1) with *note scala-scalastyle: 13e. - - ---------- Footnotes ---------- - - (1) http://www.scalastyle.org/ - - -File: flycheck.info, Node: Sass/SCSS, Next: Javascript<2>, Prev: Scala<2>, Up: Language support<3> - -8.1.3.6 Sass/SCSS -................. - -*note sass: 13a. and *note scss: 142. now use a temporary directory for -their cache and do not clutter the source directory anymore. - - -File: flycheck.info, Node: Javascript<2>, Next: Ruby<2>, Prev: Sass/SCSS, Up: Language support<3> - -8.1.3.7 Javascript -.................. - -*note flycheck-eslintrc: fb. is now ‘nil’ by default. ESLint(1) will -now find its configuration file by itself, which enables configuration -cascading. See Configuring ESLint(2) for more information. - - ---------- Footnotes ---------- - - (1) http://eslint.org/ - - (2) http://eslint.org/docs/configuring/ - - -File: flycheck.info, Node: Ruby<2>, Prev: Javascript<2>, Up: Language support<3> - -8.1.3.8 Ruby -............ - -*note ruby-rubylint: 12c. now supports configuration files with *note -flycheck-rubylintrc: 12f. This requires ruby-lint 2.0.2 or newer. - - -File: flycheck.info, Node: Error list improvements<2>, Next: User interface improvements, Prev: Language support<3>, Up: Flycheck 0 20 - -8.1.3.9 Error list improvements -............................... - -The error list (*note flycheck-list-errors: 4b.) got a bunch of -improvements: - - - Errors can now be sorted by error level and by error location, - either by clicking on the headers of ‘line’ and ‘level’ - respectively, or by pressing ‘S’ when the point is on the text of - the corresponding column. - - - Pressing ‘RET’ on any error in the error list now jumps immediately - to the error location. - - - ‘n’ and ‘p’ now move by errors instead by lines, even with - multi-line error messages, and display the error location in - another window while navigating. - - -File: flycheck.info, Node: User interface improvements, Next: Miscellaneous new features, Prev: Error list improvements<2>, Up: Flycheck 0 20 - -8.1.3.10 User interface improvements -.................................... - -The mode line indicator of Flycheck is now customizable with *note -flycheck-mode-line: 8e, which is a mode line template (see *note -(elisp)Mode Line Format::). The mode line of the error list buffer is -customizable as well, with ‘flycheck-error-list-mode-line’. - -The Flycheck menu at _Tools -> Syntax Checking_ was improved. It now -provides an item to toggle Flycheck Mode in the current buffer. Items -that are not available currently are now disabled. The menu is also -shown on the mode line indicator now. - -*note flycheck-compile: 19c. now prompts for a syntax checker to use, -defaulting to the last used for the current buffer. - -When Flycheck asks for a syntax checker in the minibuffer, it now -presents a reasonable default. - - -File: flycheck.info, Node: Miscellaneous new features, Next: Miscellaneous fixes, Prev: User interface improvements, Up: Flycheck 0 20 - -8.1.3.11 Miscellaneous new features -................................... - -The new hook *note flycheck-status-changed-functions: 19e. lets -extensions and customization react on any status change in Flycheck. - -Error levels defined with ‘flycheck-define-error-level’ can now have a -numeric severity used for sorting, with ‘:severity’. - - -File: flycheck.info, Node: Miscellaneous fixes, Next: Get it, Prev: Miscellaneous new features, Up: Flycheck 0 20 - -8.1.3.12 Miscellaneous fixes -............................ - -Flycheck now properly unloads with ‘unload-feature’. - -The *note emacs-lisp: cd. checker does not longer choke when -‘package-initialize’ signals an error. - - -File: flycheck.info, Node: Get it, Prev: Miscellaneous fixes, Up: Flycheck 0 20 - -8.1.3.13 Get it -............... - -Follow the *note installation instructions: 33. If you already have -Flycheck installed, just update it from ‘M-x list-packages’. - - -File: flycheck.info, Node: Flycheck 0 19, Next: Flycheck 0 18, Prev: Flycheck 0 20, Up: Release announcements - -8.1.4 Flycheck 0.19 -------------------- - - -date: Jun 12, 2014 - - -version: 0.19 - -We are pleased to announce the release of Flycheck 0.19. - -* Menu: - -* Breaking changes: Breaking changes<4>. -* Languages:: -* New features:: -* Bug fixes:: -* Misc changes:: -* Get it: Get it<2>. - - -File: flycheck.info, Node: Breaking changes<4>, Next: Languages, Up: Flycheck 0 19 - -8.1.4.1 Breaking changes -........................ - -*note ruby-rubylint: 12c. requires Ruby Lint 2.0 or newer, due to some -breaking changes in the command line interface of Ruby Lint. - - -File: flycheck.info, Node: Languages, Next: New features, Prev: Breaking changes<4>, Up: Flycheck 0 19 - -8.1.4.2 Languages -................. - -* Menu: - -* C/C++: C/C++<5>. -* Emacs Lisp: Emacs Lisp<3>. -* Go: Go<3>. -* Haskell: Haskell<3>. -* Rust: Rust<4>. - - -File: flycheck.info, Node: C/C++<5>, Next: Emacs Lisp<3>, Up: Languages - -8.1.4.3 C/C++ -............. - -The new *note flycheck-cppcheck-inconclusive: b7. enables *note -c/c++-cppcheck: a1. tests that might yield false positives. - -When reporting errors in included files, *note c/c++-clang: 9f. now -includes the error messages in the faulty include file in the error -message on the affected ‘#include’ statement. - - -File: flycheck.info, Node: Emacs Lisp<3>, Next: Go<3>, Prev: C/C++<5>, Up: Languages - -8.1.4.4 Emacs Lisp -.................. - -Flycheck now removes redundant whitespace in the error messages reported -by the *note emacs-lisp: cd. syntax checker. - - -File: flycheck.info, Node: Go<3>, Next: Haskell<3>, Prev: Emacs Lisp<3>, Up: Languages - -8.1.4.5 Go -.......... - -Go code is now checked for unhandled error return values with the new -*note go-errcheck: e4. syntax checker. - -Flycheck does not longer signal errors in Go Mode, when the ‘go’ -executable is not available. - - -File: flycheck.info, Node: Haskell<3>, Next: Rust<4>, Prev: Go<3>, Up: Languages - -8.1.4.6 Haskell -............... - -Flycheck now dedents the error messages reported by *note haskell-ghc: -eb, and properly checks Haskell files without extensions. - - -File: flycheck.info, Node: Rust<4>, Prev: Haskell<3>, Up: Languages - -8.1.4.7 Rust -............ - -*note rust: 133. has a new *note flycheck-rust-check-tests: 134. option, -to disable syntax checking of test code. - - -File: flycheck.info, Node: New features, Next: Bug fixes, Prev: Languages, Up: Flycheck 0 19 - -8.1.4.8 New features -.................... - -Syntax checkers may now use the ‘:error-filter’ argument to *note -flycheck-define-checker: 19. to apply a function to all errors after -parsing. The function is given the list of parsed errors, and shall -return the list of errors that Flycheck is to use as the result of the -syntax checker. It may modify the list and all error objects therein -in-place. - -The new option *note flycheck-keymap-prefix: 50. lets you change the -prefix key used by Flycheck. The default is still ‘C-c !’. - - Warning: The Flycheck manual assumes that you are using the default - prefix key. You are encouraged to leave the prefix key unchanged, - and instead add your own custom bindings to the Flycheck key map: - - (eval-after-load 'flycheck - '(define-key flycheck-mode-map (kbd "") #'flycheck-list-errors)) - -Likewise, you now can configure the prefix of in-place temporary files -created by Flycheck with *note flycheck-temp-prefix: 5b. - - Warning: Changing the prefix may break syntax checkers. In doubt, - stick to the default prefix. - - -File: flycheck.info, Node: Bug fixes, Next: Misc changes, Prev: New features, Up: Flycheck 0 19 - -8.1.4.9 Bug fixes -................. - -Flycheck now correctly kills running process and removes the temporary -files when stopping a syntax check or killing the buffer. - -Also, Flycheck does not long warn if a syntax checker only reports -errors for other files. - - -File: flycheck.info, Node: Misc changes, Next: Get it<2>, Prev: Bug fixes, Up: Flycheck 0 19 - -8.1.4.10 Misc changes -..................... - -Flycheck now has an official logo, and its own mail address. You can -see both on the Github profile(1) of the Flycheck project. - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/ - - -File: flycheck.info, Node: Get it<2>, Prev: Misc changes, Up: Flycheck 0 19 - -8.1.4.11 Get it -............... - -See *note Installation: 31. - - -File: flycheck.info, Node: Flycheck 0 18, Next: Flycheck 0 17, Prev: Flycheck 0 19, Up: Release announcements - -8.1.5 Flycheck 0.18 -------------------- - - -date: Mar 24, 2014 - - -version: 0.18 - -Today, we release Flycheck 0.18. - -It’s quite some time since the last release, but there are not many big -changes, as Flycheck becomes more and more mature, and slowly approaches -a 1.0 release. - -* Menu: - -* Breaking changes: Breaking changes<5>. -* Syntax checkers: Syntax checkers<2>. -* Bug fixes: Bug fixes<2>. -* Get it: Get it<3>. - - -File: flycheck.info, Node: Breaking changes<5>, Next: Syntax checkers<2>, Up: Flycheck 0 18 - -8.1.5.1 Breaking changes -........................ - -There are some small breaking changes. Most notably, the naming -conventions of various shell script syntax checkers were changed. All -of them now use the prefix ‘sh-’, and the former ‘sh-’ checkers now have -the prefix ‘sh-posix-’. This affects their executable variables as -well. - -Furthermore, the version requirements for some syntax checker tools -changed: - - - *note rust: 133. needs upcoming Rust 0.10 now, because Flycheck - followed backwards-incompatible upstream changes in the ‘rustc’ - options. - - - *note rst-sphinx: 128. needs Sphinx 1.2 now, because Flycheck uses - a special writer now, which is not present in previous releases. - - -File: flycheck.info, Node: Syntax checkers<2>, Next: Bug fixes<2>, Prev: Breaking changes<5>, Up: Flycheck 0 18 - -8.1.5.2 Syntax checkers -....................... - -Flycheck can now check BSD Makefile with BSD Make as well. The *note -make: 105. syntax checker does not use GNU Make specific options -anymore, and will work with any POSIX compatible variant of Make. - -Go syntax checking got a major update with new syntax checkers based on -Golint(1) (*note go-golint: e0.) and ‘go tool vet’ (*note go-vet: e1.). -Go now has one of the most complete and powerful syntax checker chains -in Flycheck. - -Support for Perl and for shell scripts was greatly improved by -introducing two new syntax checkers: - - - *note perl-perlcritic: 109. checks Perl with the powerful - Perl-Critic(2) tool. - - - *note sh-shellcheck: 146. checks Shell scripts with the awesome - Shellcheck(3) tool, which finds all sorts of idiomatic and - semantics mistakes in shell scripts of various shell languages, and - will greatly improve your shell scripting. - -D users can now tell *note d-dmd: c7. about include directories with the -new option *note flycheck-dmd-include-path: c8. Likewise, Rust users -can use *note flycheck-rust-library-path: 137. now. - - ---------- Footnotes ---------- - - (1) https://github.com/golang/lint - - (2) https://metacpan.org/pod/Perl::Critic - - (3) https://github.com/koalaman/shellcheck - - -File: flycheck.info, Node: Bug fixes<2>, Next: Get it<3>, Prev: Syntax checkers<2>, Up: Flycheck 0 18 - -8.1.5.3 Bug fixes -................. - -As always, a good deal of bugs and issues was fixed: - - - *note puppet-lint: 113. includes the name of the corresponding - check in the error message now. - - - *note rst: 127. handles ‘.. include::’ directives with relative - file names now. - - - *note rst-sphinx: 128. will no longer choke if the document being - checked contains custom nodes without ‘text’ writers. - - - *note rust: 133. will not longer emit pointless warnings about - missing ‘main’ functions in library creates. - - - Various error parsing problems were corrected in *note c/c++-clang: - 9f, *note go-build: e2. and *note go-test: e3. - - -File: flycheck.info, Node: Get it<3>, Prev: Bug fixes<2>, Up: Flycheck 0 18 - -8.1.5.4 Get it -.............. - -See *note Installation: 31. - - -File: flycheck.info, Node: Flycheck 0 17, Next: Flycheck 0 16, Prev: Flycheck 0 18, Up: Release announcements - -8.1.6 Flycheck 0.17 -------------------- - - -date: Feb 1, 2014 - - -version: 0.17 - -Flycheck 0.17 was released today. Though it’s just about two weeks -since the last release, there are quite some changes. - -* Menu: - -* Breaking changes: Breaking changes<6>. -* New online manual:: -* Syntax checkers: Syntax checkers<3>. -* Extending syntax checkers:: -* Other bug fixes and improvements:: - - -File: flycheck.info, Node: Breaking changes<6>, Next: New online manual, Up: Flycheck 0 17 - -8.1.6.1 Breaking changes -........................ - -The default value of *note flycheck-completion-system: 65. was changed -to ‘nil’, i.e. Flycheck now uses plain ‘completing-read’ as default -completion system. To restore the previous default (i.e. IDO), -customize it with ‘M-x customize-variable RET -flycheck-completion-system’ or add the following to your ‘init.el’: - - (eval-after-load 'flycheck '(setq flycheck-completion-system 'ido)) - -Also, *note flycheck-count-errors: 92. was changed to count errors of -all levels. It returns an alist mapping error levels to the amount of -errors of that level. - - -File: flycheck.info, Node: New online manual, Next: Syntax checkers<3>, Prev: Breaking changes<6>, Up: Flycheck 0 17 - -8.1.6.2 New online manual -......................... - -The most notable change is the new online documentation at -‘http://flycheck.readthedocs.org’, which replaces the old online manual -at ‘http://flycheck.github.io’. The latter now redirects to the former. - -The new manual is written with Sphinx(1) instead of Texinfo(2). The -underlying markup is ReStructuredText(3), which is simpler, less -cluttered, and more powerful than the TeX dialect of Texinfo(4). It is -also more popular, as nowadays Sphinx has become a standard tool among -Python developers, and is also increasingly used with other languages as -well. For instance, the LLVM documentation(5) is written in Sphinx. - -Besides providing a better HTML documentation, we hope that the new -manual lowers the barrier to external contributors and increases the -amount of contributions to the documentation. - -The documentation is now automatically re-build after each push to the -Github repository, so that ‘http://flycheck.readthedocs.org/en/latest’ -now always hosts the up to date documentation. Besides, there are -separate sites for each versioned release of Flycheck. For instance, -‘http://flycheck.readthedocs.org/en/0.17’ now hosts the documentation of -Flycheck 0.17 now. - -Beyond the manual itself, the new documentation now also includes the -release notes, which were previously hosted at -‘http://www.lunaryorn.com’, and the *note comparison with Flymake: d, -which was previously hosted at the Github Wiki of Flycheck. The Github -Wiki is disabled now, to make all documentation available from a single -place. - -Unfortunately, the Info manual included in the Flycheck ELPA packages is -somewhat inferior now, because there is some idiomatic gap between -Sphinx and Texinfo. It’s still usable, though, and we hope to overcome -the most striking shortcomings over the time. - - ---------- Footnotes ---------- - - (1) http://sphinx-doc.org - - (2) http://www.gnu.org/software/texinfo/ - - (3) http://docutils.sourceforge.net/rst.html - - (4) http://www.gnu.org/software/texinfo/ - - (5) http://llvm.org/docs/ - - -File: flycheck.info, Node: Syntax checkers<3>, Next: Extending syntax checkers, Prev: New online manual, Up: Flycheck 0 17 - -8.1.6.3 Syntax checkers -....................... - -Flycheck can now check GNU Makefiles (see [GH-321](1)) with the new -‘make-gmake’ syntax checker. - -The *note rust: 133. syntax checker now uses ‘--no-trans’ to check for -more than just syntax errors. For instance, it will report unused -variables now. - -As part of the transition to the new manual, Flycheck now provides a -syntax checker for Sphinx documents (*note rst-sphinx: 128.). The *note -rst: 127. syntax checker does not check documents within a Sphinx -project anymore, do avoid false positives from Sphinx-specific markup. - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/321 - - -File: flycheck.info, Node: Extending syntax checkers, Next: Other bug fixes and improvements, Prev: Syntax checkers<3>, Up: Flycheck 0 17 - -8.1.6.4 Extending syntax checkers -................................. - - -File: flycheck.info, Node: Other bug fixes and improvements, Prev: Extending syntax checkers, Up: Flycheck 0 17 - -8.1.6.5 Other bug fixes and improvements -........................................ - - - Flycheck does not longer attach syntax checker processes to the - buffer anymore, improving compatibility with Tabbar Mode - ([GH-298](1)). - - - The *note emacs-lisp: cd. and *note emacs-lisp-checkdoc: ce. syntax - checkers do not visit the file being checked anymore, to avoid - unintended side effects from unsafe local variables, etc. - ([GH-319](2)) - - - When a buffer changes while being checked, Flycheck immediately - re-checks the buffer after the check finished, to avoid outdated - errors ([GH-301](3)). - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/298 - - (2) https://github.com/flycheck/flycheck/issues/319 - - (3) https://github.com/flycheck/flycheck/issues/301 - - -File: flycheck.info, Node: Flycheck 0 16, Next: Flycheck 0 15, Prev: Flycheck 0 17, Up: Release announcements - -8.1.7 Flycheck 0.16 -------------------- - - -date: Jan 12, 2014 - - -version: 0.16 - -Time for a new release of Flycheck, the modern syntax-checking extension -for Emacs: - -In two months since the last release, Flycheck got a bunch of new syntax -checkers, a brand-new error list, and the ability to override the -executables of syntax checkers. - -Let’s go through the list of important changes. For a detailed list, -please read the *note Changelog: 165. - -* Menu: - -* Breaking changes: Breaking changes<7>. -* Syntax checkers: Syntax checkers<4>. -* New features: New features<2>. -* Improved error list:: -* Get it: Get it<4>. - - -File: flycheck.info, Node: Breaking changes<7>, Next: Syntax checkers<4>, Up: Flycheck 0 16 - -8.1.7.1 Breaking changes -........................ - - - The Hdevtools syntax checker was removed from Flycheck into a - separate package flycheck-hdevtools(1) due to various issues - ([GH-275](2)). - - - Support for coffeelint 0.x is dropped. - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck-hdevtools - - (2) https://github.com/flycheck/flycheck/issues/275 - - -File: flycheck.info, Node: Syntax checkers<4>, Next: New features<2>, Prev: Breaking changes<7>, Up: Flycheck 0 16 - -8.1.7.2 Syntax checkers -....................... - -* Menu: - -* New languages and checkers:: -* Better Haskell support:: -* Miscellaneous new options:: - - -File: flycheck.info, Node: New languages and checkers, Next: Better Haskell support, Up: Syntax checkers<4> - -8.1.7.3 New languages and checkers -.................................. - -Flycheck supports _eight_ new languages: AsciiDoc(1), Cfengine(2), -Chef(3) recipes, ERuby(4), Handlebars(5), Racket(6), Texinfo(7), and -Verilog(8). Additionally, there are a new syntax checker for Javascript -(eslint(9)), Ruby (ruby-lint(10)), and YAML (js-yaml(11)). - - ---------- Footnotes ---------- - - (1) http://asciidoc.org/ - - (2) http://cfengine.com/ - - (3) https://www.getchef.com/ - - (4) http://www.kuwata-lab.com/erubis/ - - (5) http://handlebarsjs.com/ - - (6) http://racket-lang.org/ - - (7) https://www.gnu.org/software/texinfo - - (8) https://en.wikipedia.org/wiki/Verilog - - (9) https://github.com/eslint/eslint - - (10) https://github.com/YorickPeterse/ruby-lint - - (11) https://github.com/nodeca/js-yaml - - -File: flycheck.info, Node: Better Haskell support, Next: Miscellaneous new options, Prev: New languages and checkers, Up: Syntax checkers<4> - -8.1.7.4 Better Haskell support -.............................. - -Despite the aforementioned removal of Hdevtools, Haskell support made a -leap forward. The GHC syntax checker resolves local imports properly -now, and has new options to change the search path and the package -databases. - -The brand-new flycheck-haskell(1) extension makes use of these variables -to configure the syntax checker properly in Cabal projects. The -extensions adds all source directories of a Cabal project to the GHC -search path, and enables the package database of the project’s Cabal -sandbox. - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck-haskell - - -File: flycheck.info, Node: Miscellaneous new options, Prev: Better Haskell support, Up: Syntax checkers<4> - -8.1.7.5 Miscellaneous new options -................................. - - - The SASS and SCSS syntax checkers support the Compass framework - now, via *note flycheck-sass-compass: 13b. and *note - flycheck-scss-compass: 143. respectively. - - - Clang can enable Microsoft C/C++ extensions now, via *note - flycheck-clang-ms-extensions: a8. - - - Rubocop can inhibit all style hints via the new *note - flycheck-rubocop-lint-only: 12d. - - -File: flycheck.info, Node: New features<2>, Next: Improved error list, Prev: Syntax checkers<4>, Up: Flycheck 0 16 - -8.1.7.6 New features -.................... - -* Menu: - -* Syntax checker executables: Syntax checker executables<2>. -* Disable syntax checkers easily:: - - -File: flycheck.info, Node: Syntax checker executables<2>, Next: Disable syntax checkers easily, Up: New features<2> - -8.1.7.7 Syntax checker executables -.................................. - -You can now override the executables of syntax checkers. See *note -Syntax checker executables: 69. for details. - - -File: flycheck.info, Node: Disable syntax checkers easily, Prev: Syntax checker executables<2>, Up: New features<2> - -8.1.7.8 Disable syntax checkers easily -...................................... - -Flycheck as a new customization options *note -flycheck-disabled-checkers: 5f, to easily disable syntax checkers. - -Previously, you needed to remove syntax checkers from *note -flycheck-checkers: 5e. to disable them, either via the Customization -interface, or by custom Emacs Lisp: - - (setq flycheck-checkers (delq 'emacs-lisp-checkdoc flycheck-checkers)) - -With the new variable, there is no need for this convoluted code -anymore. Instead, just set the variable: - - (setq flycheck-disabled-checkers '(emacs-lisp-checkdoc)) - -Even better, you can easily use this variable in file or directory -variables. For instance, you can use ‘M-x add-file-local-variable RET -flycheck-disabled-checkers RET (emacs-lisp-checkdoc)’ in your ‘init.el’ -to disable Checkdoc warnings while editing your ‘init.el’. - - -File: flycheck.info, Node: Improved error list, Next: Get it<4>, Prev: New features<2>, Up: Flycheck 0 16 - -8.1.7.9 Improved error list -........................... - -This release continues the improvements to the error list started in the -last release. The error list is now based on Tabulated List Mode (see -[GH-230](1)), to address a number of issues in the old Compile -Mode-based error list (e.g. misleading commands and menu items such as -“Recompile”). - -The new error list, which you can see in the screenshot above, fixes -these issues, and has an improved visual appearance. The columns are -aligned now, and the superfluous file name is omitted. - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/230 - - -File: flycheck.info, Node: Get it<4>, Prev: Improved error list, Up: Flycheck 0 16 - -8.1.7.10 Get it -............... - -See *note Installation: 31. - - -File: flycheck.info, Node: Flycheck 0 15, Prev: Flycheck 0 16, Up: Release announcements - -8.1.8 Flycheck 0.15 -------------------- - - -date: Nov 15, 2013 - - -version: 0.15 - -I have the honour and pleasure to announce a new release of Flycheck, -the modern syntax-checking extension for Emacs. - -It is three months since the last release, so this release brings quite -a lot of changes. For a complete list of all changes, please read the -complete list of *note Changelog: 165. This article will just cover the -most important changes. - -* Menu: - -* Breaking changes: Breaking changes<8>. -* New syntax checkers:: -* New error list:: -* C/C++ support:: -* New info level messages:: -* Custom error levels:: -* Other improvements:: -* Get it: Get it<5>. - - -File: flycheck.info, Node: Breaking changes<8>, Next: New syntax checkers, Up: Flycheck 0 15 - -8.1.8.1 Breaking changes -........................ - -This release introduces three breaking changes. Two of these are -related to the *note new-error-list: 1d0.: - - Warning: ‘flycheck-display-errors-in-list’ is gone. If you had - previously set *note flycheck-display-errors-function: 2b. to this - function, *remove* this setting from your configuration. - -Besides, ‘flycheck-list-errors’ does not take a prefix argument anymore. -It cannot list errors at point any longer. - -The third breaking change is the removal of ‘flycheck-declare-checker’, -which was obsolete already since the last release. Unless you have -custom syntax checkers not yet ported to *note flycheck-define-checker: -19, this won’t affect you in any way. I am not aware of any 3rd party -extension which still uses ‘flycheck-declare-checker’. - - -File: flycheck.info, Node: New syntax checkers, Next: New error list, Prev: Breaking changes<8>, Up: Flycheck 0 15 - -8.1.8.2 New syntax checkers -........................... - -Two new languages made it into this release: YAML (using the YAML parser -from the Ruby standard library) and Slim(1). - -Additionally there are new syntax checkers for Javascript and PHP. -Flycheck can check Javascript with Google’s Closure Linter(2), in place -of Jshint. For PHP, Flycheck now uses the PHP Mess Detector(3) to check -for semantic errors, in _addition_ to a syntax checks with PHP CLI and a -style checks with PHP CodeSniffer. - - ---------- Footnotes ---------- - - (1) http://slim-lang.com - - (2) https://code.google.com/p/closure-linter/ - - (3) http://phpmd.org/ - - -File: flycheck.info, Node: New error list, Next: C/C++ support, Prev: New syntax checkers, Up: Flycheck 0 15 - -8.1.8.3 New error list -...................... - -The error list at ‘C-c ! l’ has been redesigned. - -It is no longer a static list filled once by ‘C-c ! l’. Instead, it -automatically updates after each syntax check, and follows the current -window, i.e. if you switch to another window, the error list is updated -to show the errors of the corresponding buffer. - -Furthermore, the error list highlights the errors at point and at the -current line. If you move the point to an error location, the error -list automatically scrolls to the corresponding error, and highlights it -with the new ‘flycheck-error-list-highlight-at-point’ face. -Additionally, it highlights all other errors at the current line with -the new *note flycheck-error-list-highlight: 7f. face. - - -File: flycheck.info, Node: C/C++ support, Next: New info level messages, Prev: New error list, Up: Flycheck 0 15 - -8.1.8.4 C/C++ support -..................... - -The *note c/c++-clang: 9f. syntax checker for C and C++ got a bunch of -new options: - - - Set additional preprocessor definitions for syntax checking with - *note flycheck-clang-definitions: a4, corresponding to the ‘-D’ - option for ‘clang’. - - - Include additional headers or files during syntax checking with - *note flycheck-clang-includes: a6, corresponding to the ‘-include’ - option for ‘clang’. - - - Choose the language standard, e.g. C++98 or C++11, with *note - flycheck-clang-language-standard: a7, corresponding to the ‘-std’ - option for ‘clang’. - - - Disable RTTI during syntax checking with *note - flycheck-clang-no-rtti: aa, corresponding to the ‘-fno-rtti’ option - for ‘clang’. In current Clang versions, however, this does not - cause errors or warnings when using RTTI. - - - Choose the standard library for syntax checking with *note - flycheck-clang-standard-library: ab, corresponding to the ‘-stdlib’ - option for ‘clang’. Currently, Clang supports ‘libstdc++’ for the - good old GNU standard library, and ‘libc++’ for the modern Libc++ - from the LLVM project. - -Besides, the Clang syntax checker was changed to correctly handle local -include files, e.g. ‘#include "foo.h"’. - - -File: flycheck.info, Node: New info level messages, Next: Custom error levels, Prev: C/C++ support, Up: Flycheck 0 15 - -8.1.8.5 New ‘info’ level messages -................................. - -In addition to the ‘warning’ and ‘error’ levels, Flycheck now has a new -‘info’ level, which is intended for informational messages which provide -additional information about a specific location in the source code. -With this new level, the semantics of error levels is as follows: - -‘error’ - - Definite errors which must be fixed for the source code to work - correctly - -‘warning’ - - Potential errors and issues, which can be ignored, but still - deserve to be fixed - -‘info’ - - Additional information about a specific source code location, which - does not indicate an error or issue, but is still worth noting - -Some syntax checkers were changed to use this new level for messages, -which do not really fit into the ‘warning’ level: - - - *note c/c++-clang: 9f. for ‘note:’ messages - - - *note python-flake8: 115. for PEP8 naming issues emitted by the - ‘pep8-naming’ plugin - - - *note python-pylint: 11a. for convention level messages, e.g. - naming issues, etc. - -The new level is already supported by the popular Solarized(1) and -Zenburn(2) themes. - - ---------- Footnotes ---------- - - (1) https://github.com/bbatsov/solarized-emacs - - (2) https://github.com/bbatsov/zenburn-emacs - - -File: flycheck.info, Node: Custom error levels, Next: Other improvements, Prev: New info level messages, Up: Flycheck 0 15 - -8.1.8.6 Custom error levels -........................... - -The new ‘info’ level is backed by a generic mechanism to define new -error levels, using the new function *note flycheck-define-error-level: -27. For instance, the ‘warning’ level is now defined as follows: - - (flycheck-define-error-level 'warning - :overlay-category 'flycheck-warning-overlay - :fringe-bitmap 'question-mark - :fringe-face 'flycheck-fringe-warning) - -A error level consists of a category for overlays, which defines the -appearance and priority of overlays for this level, and bitmap and face -for fringe indicators. - -After defining an error level, you can use it the error patterns of a -syntax checker as usual. - - -File: flycheck.info, Node: Other improvements, Next: Get it<5>, Prev: Custom error levels, Up: Flycheck 0 15 - -8.1.8.7 Other improvements -.......................... - -Beside these important changes, there are also a number of smaller -improvements: - - - Flycheck does not longer check encrypted files for obvious reasons. - - - The *note emacs-lisp-checkdoc: ce. syntax checker does not check - ‘.dir-locals.el’ anymore. - - - *note python-pylint: 11a. now parses error columns from the output - of ‘pylint’. - - - Spurious “flawed definition” warnings in *note lua: 103, *note rst: - 127. and *note go-build: e2. were fixed. - - - *note c/c++-cppcheck: a1. output now parses correctly when using - the pure Emacs Lisp XML parser in ‘xml.el’. - - Note: Nonetheless, you are advised to use Emacs with ‘libxml’ - support. Most Linux distributions ship Emacs packages with - ‘libxml’ support, but if you are building your own, or use a - source-based distribution such as Gentoo, take care to enable - ‘libxml’ for Emacs. - - -File: flycheck.info, Node: Get it<5>, Prev: Other improvements, Up: Flycheck 0 15 - -8.1.8.8 Get it -.............. - -See *note Installation: 31. - - -File: flycheck.info, Node: Changelog, Prev: Release announcements, Up: Flycheck releases - -8.2 Changelog -============= - -* Menu: - -* master (in development): master in development. -* 0.22 (Dec 23, 2014): 0 22 Dec 23 2014. -* 0.21 (Oct 26, 2014): 0 21 Oct 26 2014. -* 0.20 (Aug 12, 2014): 0 20 Aug 12 2014. -* 0.19 (Jun 12, 2014): 0 19 Jun 12 2014. -* 0.18 (Mar 24, 2014): 0 18 Mar 24 2014. -* 0.17 (Feb 1, 2014): 0 17 Feb 1 2014. -* 0.16 (Jan 11, 2014): 0 16 Jan 11 2014. -* 0.15 (Nov 15, 2013): 0 15 Nov 15 2013. -* 0.14.1 (Aug 16, 2013): 0 14 1 Aug 16 2013. -* 0.14 (Aug 15, 2013): 0 14 Aug 15 2013. -* 0.13 (Jun 28, 2013): 0 13 Jun 28 2013. -* 0.12 (May 18, 2013): 0 12 May 18 2013. -* 0.11 (May 01, 2013): 0 11 May 01 2013. -* 0.10 (Apr 21, 2013): 0 10 Apr 21 2013. -* 0.9 (Apr 13, 2013): 0 9 Apr 13 2013. -* 0.8 (Apr 9, 2013): 0 8 Apr 9 2013. -* 0.7.1 (Feb 23, 2013): 0 7 1 Feb 23 2013. -* 0.7 (Feb 14, 2013): 0 7 Feb 14 2013. -* 0.6.1 (Jan 30, 2013): 0 6 1 Jan 30 2013. -* 0.6 (Jan 29, 2013): 0 6 Jan 29 2013. -* 0.5 (Dec 28, 2012): 0 5 Dec 28 2012. -* 0.4 (Nov 21, 2012): 0 4 Nov 21 2012. -* 0.3 (Nov 21, 2012): 0 3 Nov 21 2012. -* 0.2 (Oct 25, 2012): 0 2 Oct 25 2012. -* 0.1 (Oct 11, 2012): 0 1 Oct 11 2012. - - -File: flycheck.info, Node: master in development, Next: 0 22 Dec 23 2014, Up: Changelog - -8.2.1 master (in development) ------------------------------ - - - New syntax checkers: - - - R with ‘lintr’ [GH-512](1) - - - Improvements: - - - ‘chef-foodcritic’ handles relative paths correctly now - [GH-556](2) - - - Bug fixes: - - - Cache last used syntax checker only when actually checking the - buffer [GH-559](3) - - - Fix void variable error when trying to use ‘flycheck-compile’ - with a non-command checker [GH-563](4) - - - Fix faulty mode line reporting [GH-564](5) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/512 - - (2) https://github.com/flycheck/flycheck/issues/556 - - (3) https://github.com/flycheck/flycheck/issues/559 - - (4) https://github.com/flycheck/flycheck/issues/563 - - (5) https://github.com/flycheck/flycheck/issues/564 - - -File: flycheck.info, Node: 0 22 Dec 23 2014, Next: 0 21 Oct 26 2014, Prev: master in development, Up: Changelog - -8.2.2 0.22 (Dec 23, 2014) -------------------------- - - - *Breaking changes*: - - - Never allow use of disabled checkers anymore, even with - ‘flycheck-select-checker’ - - - Error parsers *must* set the ‘:buffer’ and ‘:checker’ slots of - ‘flycheck-error’ now - - - The internals of syntax checker definitions have changed - again. *All packages depending on Flycheck must be - recompiled!* [GH-524](1) - - - ‘flycheck-error-list-refresh’ is not an interactive command - anymore - - - Replace ‘flycheck-perlcritic-verbosity’ with - ‘flycheck-perlcritic-severity’ - - - Replace ‘flycheck-copy-messages-as-kill’ with - ‘flycheck-copy-errors-as-kill’ [GH-529](2) - - - Remove ‘flycheck-google-messages’ command - - - Options and config file variables are not buffer-local anymore - [GH-546](3) - - - New syntax checkers: - - - Python with ‘py_compile’ [GH-484](4) - - - New features: - - - ‘flycheck-ert.el’ library to write unit tests for Flycheck - extensions - - - Add ‘flycheck-define-generic-checker’ to define syntax - checkers over arbitrary Emacs Lisp functions [GH-169](5) - [GH-524](6) - - - Add ‘flycheck-define-command-checker’ as non-macro variant of - ‘flycheck-define-checker’ [GH-524](7) - - - Add support for IDs of errors [GH-529](8) - - - Add special ‘id’ sexp to parse error ids with - ‘:error-patterns’ [GH-529](9) - - - Parse error IDs from Checkstyle XML [GH-259](10) - - - ‘flycheck-copy-errors-as-kill’ can put error ids into kill - ring now [GH-529](11) - - - Parse error IDs from many error checkers [GH-259](12) - - - Verify Flycheck setup in a buffer with ‘flycheck-verify-setup’ - [GH-338](13) - - - Add options for arbitrary arguments to some syntax checkers - [GH-542](14) - - - Add ‘flycheck-flake8-error-level-alist’ to customize error - levels from flake8 [GH-454](15) - - - Improvements: - - - Automatically disable syntax checkers that report too many - errors [GH-476](16) - - - Reduce filesystem access when parsing errors to improve - parsing speed - - - Add explicit ‘load-path’ inheritance to - ‘flycheck-emacs-lisp-load-path’, via new ‘inherit’ value - [GH-511](17) - - - Parse help messages from ‘rustc’ [GH-517](18) - - - ‘g’ in the error list checks the source buffer again - [GH-532](19) - - - ‘haskell-ghc’ supports literate Haskell now [GH-535](20) - - - Bug fixes: - - - Properly parse notes in ‘sh-shellcheck’ [GH-508](21) - - - Fix shell quoting in ‘flycheck-compile’ [GH-522](22) - [GH-523](23) - - - Fix faulty properties of customize options which broke - ‘customize-changed’ and related functions - - - Fix use deprecated option in ‘coffee-coffeelint’ - - - Fix error columns of ‘python-pylint’ and ‘tex-chktex’ - [GH-536](24) - - - Correctly compute error level of errors on included files in - ‘c/c++-clang’ and ‘c/c++-gcc’ [GH-451](25) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/524 - - (2) https://github.com/flycheck/flycheck/issues/529 - - (3) https://github.com/flycheck/flycheck/issues/546 - - (4) https://github.com/flycheck/flycheck/issues/484 - - (5) https://github.com/flycheck/flycheck/issues/169 - - (6) https://github.com/flycheck/flycheck/issues/524 - - (7) https://github.com/flycheck/flycheck/issues/524 - - (8) https://github.com/flycheck/flycheck/issues/529 - - (9) https://github.com/flycheck/flycheck/issues/529 - - (10) https://github.com/flycheck/flycheck/issues/259 - - (11) https://github.com/flycheck/flycheck/issues/529 - - (12) https://github.com/flycheck/flycheck/issues/259 - - (13) https://github.com/flycheck/flycheck/issues/338 - - (14) https://github.com/flycheck/flycheck/issues/542 - - (15) https://github.com/flycheck/flycheck/issues/454 - - (16) https://github.com/flycheck/flycheck/issues/476 - - (17) https://github.com/flycheck/flycheck/issues/511 - - (18) https://github.com/flycheck/flycheck/issues/517 - - (19) https://github.com/flycheck/flycheck/issues/532 - - (20) https://github.com/flycheck/flycheck/issues/535 - - (21) https://github.com/flycheck/flycheck/issues/508 - - (22) https://github.com/flycheck/flycheck/issues/522 - - (23) https://github.com/flycheck/flycheck/issues/523 - - (24) https://github.com/flycheck/flycheck/issues/536 - - (25) https://github.com/flycheck/flycheck/issues/451 - - -File: flycheck.info, Node: 0 21 Oct 26 2014, Next: 0 20 Aug 12 2014, Prev: 0 22 Dec 23 2014, Up: Changelog - -8.2.3 0.21 (Oct 26, 2014) -------------------------- - - - *Breaking changes*: - - - ‘html-tidy’ is not enabled in Web Mode anymore [GH-464](1) - - - ‘d-dmd’ now requires DMD 2.066 or newer [GH-460](2) - - - ‘:next-checkers’ now requires the maximum permissible level - instead of a custom predicate [GH-472](3) - - - Remove ‘flycheck-error-list-highlight-at-point’ face and - related functionality [GH-490](4) - - - New syntax checkers: - - - Coq - - - RPM spec files with ‘rpmlint’ [GH-480](5) [GH-481](6) - - - New features: - - - Add ‘null-device’ symbol for syntax checker commands - - - Add ‘flycheck-display-error-messages-unless-error-list’ for - ‘flycheck-error-display-function’ - - - Add ‘flycheck-error-list-after-refresh-hook’ to run after the - error list refreshes - - - Add ‘flycheck-navigation-minimum-level’ to restrict error - levels available for navigation [GH-398](7) [GH-485](8) - - - The error list can be sorted by message and syntax checker - name now [GH-500](9) - - - Add ‘flycheck-error-list-checker-name’ face to customize the - appearance of the syntax checker name in the error list - [GH-500](10) - - - Add ‘flycheck-shellcheck-excluded-warnings’ to exclude - warnings from ShellCheck reports [GH-499](11) - - - Add ‘flycheck-add-mode’ to add a new major mode to a syntax - checker [GH-506](12) - - - Add ‘flycheck-gcc-openmp’ to enable OpenMP for GCC in C/C++ - [GH-507](13) - - - Improvements: - - - Improve GCC syntax checking by expanding templates - [GH-459](14) - - - ‘d-dmd’ reports errors with columns now [GH-460](15) - - - Remove Projectile-based config file search [GH-461](16) - - - Do not change point when navigating in the error list - [GH-487](17) - - - ShellCheck warnings now include the corresponding warning code - - - Bug fixes: - - - Expand ‘default-directory’ before using it, to handle - abbreviated paths gracefully [GH-434](18) - - - Restore mouse support in the error list [GH-468](19) - - - ‘less’ now correctly resolves relative paths in ‘data-uri’ - [GH-471](20) - - - ‘go-errcheck’ now properly uses package names as syntax - checker arguments - - - ‘c/c++-clang’ now handles empty error messages [GH-497](21) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/464 - - (2) https://github.com/flycheck/flycheck/issues/460 - - (3) https://github.com/flycheck/flycheck/issues/472 - - (4) https://github.com/flycheck/flycheck/issues/490 - - (5) https://github.com/flycheck/flycheck/issues/480 - - (6) https://github.com/flycheck/flycheck/issues/481 - - (7) https://github.com/flycheck/flycheck/issues/398 - - (8) https://github.com/flycheck/flycheck/issues/485 - - (9) https://github.com/flycheck/flycheck/issues/500 - - (10) https://github.com/flycheck/flycheck/issues/500 - - (11) https://github.com/flycheck/flycheck/issues/499 - - (12) https://github.com/flycheck/flycheck/issues/506 - - (13) https://github.com/flycheck/flycheck/issues/507 - - (14) https://github.com/flycheck/flycheck/issues/459 - - (15) https://github.com/flycheck/flycheck/issues/460 - - (16) https://github.com/flycheck/flycheck/issues/461 - - (17) https://github.com/flycheck/flycheck/issues/487 - - (18) https://github.com/flycheck/flycheck/issues/434 - - (19) https://github.com/flycheck/flycheck/issues/468 - - (20) https://github.com/flycheck/flycheck/issues/471 - - (21) https://github.com/flycheck/flycheck/issues/497 - - -File: flycheck.info, Node: 0 20 Aug 12 2014, Next: 0 19 Jun 12 2014, Prev: 0 21 Oct 26 2014, Up: Changelog - -8.2.4 0.20 (Aug 12, 2014) -------------------------- - - - *Breaking changes*: - - - The internal names of syntax checker properties changed. *All - packages depending on Flycheck must be recompiled!* - - - ‘flycheck-substitute-argument’ always returns a list now - - - The special meaning of a trailing ‘=’ in ‘(option …)’ and - ‘(config-file …)’ is removed. Both arguments must now - explicitly specify ‘concat’ to prepend the option as string. - - - New syntax checkers: - - - C/C++ with GCC [GH-408](1) - - - Scala with scalastyle [GH-425](2) - - - Fortran with GFortran [GH-414](3) [GH-450](4) - - - Ada with GNAT [GH-414](5) [GH-457](6) - - - New features: - - - Add ‘flycheck-clang-no-exceptions’ and - ‘flycheck-gcc-no-exceptions’ to flag exceptions as errors in - C++ [GH-412](7) - - - Add ‘flycheck-rust-crate-root’ to resolve inter-crate - references in ‘rust’ [GH-417](8) - - - Add ‘flycheck-clang-blocks’ to enable the block syntax in - Clang [GH-420](9) - - - ‘read-flycheck-checker’ now accepts a default value - - - Add ‘flycheck-status-changed-functions’ to react on status - changes - - - Make the mode line lighter of Flycheck customizable with - ‘flycheck-mode-line’ - - - Add ‘flycheck-rubylintrc’ to support configuration files for - ‘ruby-rubylint’ [GH-424](10) - - - Add ‘flycheck-rust-crate-type’ to make the Crate type - customizable [GH-446](11) - - - The mode line of the error list is now customizable with - ‘flycheck-error-list-mode-line’ [GH-454](12) - - - Pressing ‘n’ or ‘p’ in the error list now shows the error at - point in a separate window [GH-452](13) [GH-454](14) - - - Pressing ‘RET’ in the error list now jumps to the error at - point [GH-454](15) - - - The error list can now be sorted by error level by clicking on - the corresponding list header, or by pressing ‘S’ with point - on the column text [GH-454](16) - - - Error levels defined with ‘flycheck-define-error-level’ can - now have a numeric severity used for sorting [GH-454](17) - - - Improvements: - - - Use proper temporary files in ‘python-flake8’ [GH-421](18) - - - Demote errors from ‘package-initialize’ in the ‘emacs-lisp’ - checker [GH-423](19) - - - ‘flycheck-select-checker’ now uses the last used syntax - checker as default when reading from minibuffer - - - ‘flycheck-compile’ now prompts for the syntax checker to run - as ‘compile’ command [GH-428](20) - - - The ‘rust’ syntax checker shows info messages now [GH-439](21) - - - The ‘sass’ and ‘scss’ syntax checkers now use a temporary - directory for their cache [GH-443](22) [GH-454](23) - - - Change the default of ‘flycheck-eslintrc’ to ‘nil’ - [GH-447](24) - - - Show the menu on the mode line lighter [GH-365](25) - - - Greatly improve Flycheck’s menu - - - ‘n’ and ‘p’ now navigate the error list by errors, not by - lines [GH-452](26) [GH-444](27) - - - ‘c/c++-clang’ does not use in-place temporary files anymore - [GH-456](28) - - - Bug fixes: - - - Properly support ‘unload-feature’ now - - - Other changes: - - - Remove dependencies on f.el and s.el - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/408 - - (2) https://github.com/flycheck/flycheck/issues/425 - - (3) https://github.com/flycheck/flycheck/issues/414 - - (4) https://github.com/flycheck/flycheck/issues/450 - - (5) https://github.com/flycheck/flycheck/issues/414 - - (6) https://github.com/flycheck/flycheck/issues/457 - - (7) https://github.com/flycheck/flycheck/issues/412 - - (8) https://github.com/flycheck/flycheck/issues/417 - - (9) https://github.com/flycheck/flycheck/issues/420 - - (10) https://github.com/flycheck/flycheck/issues/424 - - (11) https://github.com/flycheck/flycheck/issues/446 - - (12) https://github.com/flycheck/flycheck/issues/454 - - (13) https://github.com/flycheck/flycheck/issues/452 - - (14) https://github.com/flycheck/flycheck/issues/454 - - (15) https://github.com/flycheck/flycheck/issues/454 - - (16) https://github.com/flycheck/flycheck/issues/454 - - (17) https://github.com/flycheck/flycheck/issues/454 - - (18) https://github.com/flycheck/flycheck/issues/421 - - (19) https://github.com/flycheck/flycheck/issues/423 - - (20) https://github.com/flycheck/flycheck/issues/428 - - (21) https://github.com/flycheck/flycheck/issues/439 - - (22) https://github.com/flycheck/flycheck/issues/443 - - (23) https://github.com/flycheck/flycheck/issues/454 - - (24) https://github.com/flycheck/flycheck/issues/447 - - (25) https://github.com/flycheck/flycheck/issues/365 - - (26) https://github.com/flycheck/flycheck/issues/452 - - (27) https://github.com/flycheck/flycheck/issues/444 - - (28) https://github.com/flycheck/flycheck/issues/456 - - -File: flycheck.info, Node: 0 19 Jun 12 2014, Next: 0 18 Mar 24 2014, Prev: 0 20 Aug 12 2014, Up: Changelog - -8.2.5 0.19 (Jun 12, 2014) -------------------------- - - - Flycheck now has an official logo [GH-331](1) - - - *Breaking changes*: - - - The ‘ruby-rubylint’ syntax checker now requires Ruby Lint 2.0 - or newer. [GH-405](2) - - - New syntax checkers: - - - Go with ‘errcheck’ [GH-393](3) - - - New features: - - - Add ‘flycheck-keymap-prefix’ to change the prefix key for - Flycheck keybindings [GH-381](4) - - - Make the prefix of Flycheck’s temporary files customizable - with ‘flycheck-temp-prefix’ [GH-387](5) - - - Add ‘:error-filter’ property for syntax checkers to apply a - custom function to modify or filter errors after parsing - [GH-397](6) - - - Add ‘flycheck-rust-check-tests’ to disable syntax checking of - test code in Rust [GH-406](7) - - - Add ‘flycheck-cppcheck-inconclusive’ to enable cppcheck tests - that might give false positives [GH-407](8) - - - Improvements: - - - Collapse redundant whitespace in messages from ‘emacs-lisp’ - [GH-397](9) - - - Dedent messages from ‘haskell-ghc’ [GH-397](10) - - - Fold errors in included files into the error messages of the - corresponding include in ‘c/c++-clang’ [GH-397](11) - - - The ‘ruby-rubylint’ syntax checker now supports ruby-lint 2.0 - and newer [GH-405](12) - - - Bug fixes: - - - When stopping Flycheck, correctly kill running processes and - cleanup their temporary files [GH-334](13) - - - Do not choke on files without extensions in ‘haskell-ghc’ - - - Fix spurious warning when a syntax checker reports errors, but - not for the file being checked [GH-391](14) - - - Do not signal errors in Go Mode, when ‘go’ is not available - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/331 - - (2) https://github.com/flycheck/flycheck/issues/405 - - (3) https://github.com/flycheck/flycheck/issues/393 - - (4) https://github.com/flycheck/flycheck/issues/381 - - (5) https://github.com/flycheck/flycheck/issues/387 - - (6) https://github.com/flycheck/flycheck/issues/397 - - (7) https://github.com/flycheck/flycheck/issues/406 - - (8) https://github.com/flycheck/flycheck/issues/407 - - (9) https://github.com/flycheck/flycheck/issues/397 - - (10) https://github.com/flycheck/flycheck/issues/397 - - (11) https://github.com/flycheck/flycheck/issues/397 - - (12) https://github.com/flycheck/flycheck/issues/405 - - (13) https://github.com/flycheck/flycheck/issues/334 - - (14) https://github.com/flycheck/flycheck/issues/391 - - -File: flycheck.info, Node: 0 18 Mar 24 2014, Next: 0 17 Feb 1 2014, Prev: 0 19 Jun 12 2014, Up: Changelog - -8.2.6 0.18 (Mar 24, 2014) -------------------------- - - - *Breaking changes*: - - - The POSIX script syntax checkers ‘sh-bash’ and ‘sh-dash’ were - renamed to ‘sh-posix-bash’ and ‘sh-posix-dash’ respectively. - The ‘bash’ and ‘zsh’ syntax checkers were renamed to ‘sh-bash’ - and ‘sh-zsh’ respectively. Thus, all shell script syntax - checkers now live in the ‘sh-’ prefix. - - - ‘rst-sphinx’ requires Sphinx 1.2 or newer now. - - - ‘rustc’ requires Rust 0.10 (not yet released at the time of - writing) or newer now [GH-353](1) - - - New syntax checkers: - - - Perl with Perl Critic [GH-88](2) - - - Replace GNU Make with POSIX Make [GH-322](3) - - - Shellcheck [GH-267](4) - - - Go with ‘golint’ [GH-328](5) - - - Go with ‘go tool vet’ [GH-329](6) - - - New features: - - - Add ‘flycheck-rust-library-path’ to specify library locations - for ‘rust’ - - - Add ‘flycheck-dmd-include-path’ to change the include path of - ‘d-dmd’ [GH-344](7) - - - Improvements: - - - ‘flycheck-parse-checkstyle’ supports ‘info’ level messages now - - - Correctly parse multiline error messages of ‘go-build’ and - ‘go-test’ - - - ‘rst-sphinx’ supports custom nodes without explicit writer - support now, by using the ‘pseudoxml’ builder. - - - Avoid warnings about missing main functions in ‘rust’ - - - Properly resolve relative filenames in ‘.. include::’ - directives in ‘rst’ - - - Use ‘--unix_mode’ option in ‘javascript-gjslint’ to get the - file name [GH-348](8) - - - Puppet Lint messages now include the name of the corresponding - check - - - ‘rustc’ supports upcoming Rust 0.10 now [GH-353](9) - - - Flycheck now handles Clang errors from included files - [GH-367](10) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/353 - - (2) https://github.com/flycheck/flycheck/issues/88 - - (3) https://github.com/flycheck/flycheck/issues/322 - - (4) https://github.com/flycheck/flycheck/issues/267 - - (5) https://github.com/flycheck/flycheck/issues/328 - - (6) https://github.com/flycheck/flycheck/issues/329 - - (7) https://github.com/flycheck/flycheck/issues/344 - - (8) https://github.com/flycheck/flycheck/issues/348 - - (9) https://github.com/flycheck/flycheck/issues/353 - - (10) https://github.com/flycheck/flycheck/issues/367 - - -File: flycheck.info, Node: 0 17 Feb 1 2014, Next: 0 16 Jan 11 2014, Prev: 0 18 Mar 24 2014, Up: Changelog - -8.2.7 0.17 (Feb 1, 2014) ------------------------- - - - The manual was ported to Sphinx(1) and is now located at - ‘http://flycheck.readthedocs.org’ [GH-274](2) - - - *Breaking changes*: - - - The default ‘flycheck-completion-system’ was changed to nil, - i.e. the built-in ‘completing-read’, for compliance with - Emacs’ defaults. To restore the previous behaviour, add - ‘(eval-after-load 'flycheck '(setq flycheck-completion-system - 'ido))’ to your ‘init.el’. - - - ‘flycheck-count-errors’ counts errors of all levels now, and - returns an alist mapping error symbols to error counts. - - - New syntax checkers: - - - RST (ReStructuredText) using Sphinx - - - GNU Make [GH-321](3) - - - New features: - - - Extend syntax checkers with ‘flycheck-add-next-checkers’ - [GH-266](4) - - - Improvements: - - - Immediately re-check the buffer when it was changed during a - syntax check [GH-301](5) - - - Do not defer syntax checker after idle change timeout - [GH-305](6) - - - Do not use the generic ‘rst’ syntax checker in Sphinx projects - anymore, to avoid false positives by Sphinx-only markup - - - Check for more than just syntax errors in ‘rust’ [GH-314](7) - - - ‘chef-foodcritic’ supports ‘enh-ruby-mode’ now - - - Bug fixes - - - Do not attach syntax checker processes to the buffer anymore - [GH-298](8) - - - Do not visit the file to check in ‘emacs-lisp’ and - ‘emacs-lisp-checkdoc’ to avoid unintended side effects - [GH-319](9) - - ---------- Footnotes ---------- - - (1) http://sphinx-doc.org - - (2) https://github.com/flycheck/flycheck/issues/274 - - (3) https://github.com/flycheck/flycheck/issues/321 - - (4) https://github.com/flycheck/flycheck/issues/266 - - (5) https://github.com/flycheck/flycheck/issues/301 - - (6) https://github.com/flycheck/flycheck/issues/305 - - (7) https://github.com/flycheck/flycheck/issues/314 - - (8) https://github.com/flycheck/flycheck/issues/298 - - (9) https://github.com/flycheck/flycheck/issues/319 - - -File: flycheck.info, Node: 0 16 Jan 11 2014, Next: 0 15 Nov 15 2013, Prev: 0 17 Feb 1 2014, Up: Changelog - -8.2.8 0.16 (Jan 11, 2014) -------------------------- - - - *Breaking changes*: - - - Argument substitution is no longer performed on syntax checker - executables. The executable must be a string. - - - Split out ‘haskell-hdevtools’ into a separate package. See - flycheck-hdevtools(1) [GH-275](2) - - - Drop support for coffeelint 0.x - - - The error list is reimplemented on top of Tabulated List Mode. - This greatly changes the appearance and behaviour of the error - list [GH-230](3) - - - New syntax checkers: - - - Ruby with ‘ruby-lint’ [GH-250](4) - - - Handlebars [GH-270](5) - - - YAML with ‘yaml-jsyaml’ [GH-253](6) - - - Chef recipes with ‘foodcritic’ [GH-255](7) - - - AsciiDoc [GH-276](8) - - - CFEngine [GH-271](9) - - - Racket [GH-277](10) - - - Texinfo - - - Verilog [GH-296](11) - - - Javascript with ‘eslint’ [GH-291](12) - - - ERuby [GH-285](13) - - - New features: - - - Define variables to override the executables of syntax - checkers [GH-272](14) - - - Interactively set the executable of a syntax checker with - ‘flycheck-set-checker-executable’ [GH-272](15) - - - Disable syntax checkers easily with - ‘flycheck-disabled-checkers’ [GH-269](16) - - - Add support for the Compass CSS framework in the ‘sass’ and - ‘scss’ checkers, with ‘flycheck-sass-compass’ and - ‘flycheck-scss-compass’ respectively [GH-268](17) - - - Disable style checks in ‘ruby-rubocop’ with - ‘flycheck-rubocop-lint-only’ [GH-287](18) - - - Add support for Microsoft extensions in ‘c/c++-clang’ via - ‘flycheck-clang-ms-extensions’ [GH-283](19) - - - New faces ‘flycheck-error-list-info’, - ‘flycheck-error-list-warning’, ‘flycheck-error-list-error’, - ‘flycheck-error-list-line-number’ and - ‘flycheck-error-list-column-number’ [GH-230](20) - - - Add ‘flycheck-ghc-no-user-package-database’ to disable the - user package database for ‘haskell-ghc’ - - - Add ‘flycheck-ghc-package-databases’ to add additional package - databases to ‘haskell-ghc’ - - - Add ‘flycheck-ghc-search-path’ to add additional directories - to the search path of ‘haskell-ghc’ - - - Improvements: - - - Demote Rubocop convention messages to ‘info’ level - - - Stop Flycheck before the buffer is reverted [GH-282](21) - - - Properly resolve local module imports in ‘haskell-ghc’ - - - Bug fixes: - - - Make relative imports work with ‘python-pylint’ [GH-280](22) - - - Fix parsing of errors in ‘scss’ and ‘sass’ - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck-hdevtools - - (2) https://github.com/flycheck/flycheck/issues/275 - - (3) https://github.com/flycheck/flycheck/issues/230 - - (4) https://github.com/flycheck/flycheck/issues/250 - - (5) https://github.com/flycheck/flycheck/issues/270 - - (6) https://github.com/flycheck/flycheck/issues/253 - - (7) https://github.com/flycheck/flycheck/issues/255 - - (8) https://github.com/flycheck/flycheck/issues/276 - - (9) https://github.com/flycheck/flycheck/issues/271 - - (10) https://github.com/flycheck/flycheck/issues/277 - - (11) https://github.com/flycheck/flycheck/issues/296 - - (12) https://github.com/flycheck/flycheck/issues/291 - - (13) https://github.com/flycheck/flycheck/issues/285 - - (14) https://github.com/flycheck/flycheck/issues/272 - - (15) https://github.com/flycheck/flycheck/issues/272 - - (16) https://github.com/flycheck/flycheck/issues/269 - - (17) https://github.com/flycheck/flycheck/issues/268 - - (18) https://github.com/flycheck/flycheck/issues/287 - - (19) https://github.com/flycheck/flycheck/issues/283 - - (20) https://github.com/flycheck/flycheck/issues/230 - - (21) https://github.com/flycheck/flycheck/issues/282 - - (22) https://github.com/flycheck/flycheck/issues/280 - - -File: flycheck.info, Node: 0 15 Nov 15 2013, Next: 0 14 1 Aug 16 2013, Prev: 0 16 Jan 11 2014, Up: Changelog - -8.2.9 0.15 (Nov 15, 2013) -------------------------- - - - Flycheck has a new home at ‘https://github.com/flycheck/flycheck’, - the online manual moved to ‘http://flycheck.github.io’. - - - *Breaking changes*: - - - Do not add the current directory to the ‘emacs-lisp’ syntax - checker load path - - - ‘flycheck-list-errors’ cannot list errors at point anymore. - It does not accept a prefix argument anymore, and takes zero - arguments now [GH-214](1) - - - ‘flycheck-display-errors-in-list’ is gone. The error list - automatically highlights the error at point now [GH-214](2) - - - Remove obsolete ‘flycheck-declare-checker’ - - - New syntax checkers: - - - YAML [GH-236](3) - - - Javascript with ‘gjslint’ [GH-245](4) - - - Slim [GH-246](5) - - - PHP using ‘phpmd’ [GH-249](6) - - - New features: - - - Support IDO or Grizzl(7) as completion systems for - ‘flycheck-select-checker’ at ‘C-c ! s’ - - - Disable standard error navigation with - ‘flycheck-standard-error-navigation’ [GH-202](8) - - - Add ‘flycheck-clang-language-standard’ to choose the language - standard for C/C++ syntax checking [GH-207](9) - - - Add ‘flycheck-clang-definitions’ to set additional definitions - for C/C++ syntax checking [GH-207](10) - - - Add ‘flycheck-clang-no-rtti’ to disable RTTI for C/C++ syntax - checking [GH-207](11) - - - Add new option cell ‘option-flag’ for boolean flags in syntax - checker commands - - - Add ‘flycheck-clang-includes’ to include additional files for - C/C++ syntax checking [GH-207](12) - - - Add configuration file variable ‘flycheck-pylintrc’ for Pylint - - - New faces ‘flycheck-error-list-highlight-at-point’ and - ‘flycheck-error-list-highlight’ to highlight the errors at - point and at the current line respectively in the error list - [GH-214](13) - - - The error list now automatically updates to show the errors of - the current buffer [GH-214](14) - - - Define new error levels with ‘flycheck-define-error-level’ - [GH-212](15) - - - Add ‘flycheck-clang-standard-library’ to choose the standard - library for C/C++ syntax checking [GH-234](16) - - - Customize the delay for displaying errors via - ‘flycheck-display-errors-delay’ [GH-243](17) - - - Add ‘info’ level for informational annotations by syntax - checkers [GH-215](18) - - - Add a new symbol ‘temporary-file-name’ to pass temporary file - names to syntax checkers [GH-259](19) - - - Improvements: - - - The error list now refreshes automatically after each syntax - check [GH-214](20) - - - The errors at point are now automatically highlighted in the - error list [GH-214](21) - - - ‘emacs-lisp-checkdoc’ does not longer check ‘.dir-locals.el’ - files - - - Do not automatically check syntax in encrypted files - [GH-222](22) - - - Parse notes from ‘c/c++-clang’ into info level messages - [GH-215](23) - - - Parse convention warnings from ‘pylint’ to info level - [GH-204](24) - - - Demote naming warnings from ‘python-flake8’ to info level - [GH-215](25) - - - Support ‘enh-ruby-mode’ in Ruby syntax checkers [GH-256](26) - - - Parse columns from ‘python-pylint’ errors - - - Do not compress temporary files for syntax checks if the - original file was compressed - - - Bug fixes: - - - Find local includes in the Clang syntax checker [GH-225](27) - - - Do not emit spurious flawed definition warning in the ‘rst’ - syntax checker - - - Handle abbreviated file names in ‘luac’ output, by simply - ignoring them [GH-251](28) - - - Correctly redirect the output binary of the ‘go-build’ syntax - checker [GH-259](29) - - - Fix Cppcheck parsing with the built-in Emacs XML parser - [GH-263](30) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/214 - - (2) https://github.com/flycheck/flycheck/issues/214 - - (3) https://github.com/flycheck/flycheck/issues/236 - - (4) https://github.com/flycheck/flycheck/issues/245 - - (5) https://github.com/flycheck/flycheck/issues/246 - - (6) https://github.com/flycheck/flycheck/issues/249 - - (7) https://github.com/d11wtq/grizzl - - (8) https://github.com/flycheck/flycheck/issues/202 - - (9) https://github.com/flycheck/flycheck/issues/207 - - (10) https://github.com/flycheck/flycheck/issues/207 - - (11) https://github.com/flycheck/flycheck/issues/207 - - (12) https://github.com/flycheck/flycheck/issues/207 - - (13) https://github.com/flycheck/flycheck/issues/214 - - (14) https://github.com/flycheck/flycheck/issues/214 - - (15) https://github.com/flycheck/flycheck/issues/212 - - (16) https://github.com/flycheck/flycheck/issues/234 - - (17) https://github.com/flycheck/flycheck/issues/243 - - (18) https://github.com/flycheck/flycheck/issues/215 - - (19) https://github.com/flycheck/flycheck/issues/259 - - (20) https://github.com/flycheck/flycheck/issues/214 - - (21) https://github.com/flycheck/flycheck/issues/214 - - (22) https://github.com/flycheck/flycheck/issues/222 - - (23) https://github.com/flycheck/flycheck/issues/215 - - (24) https://github.com/flycheck/flycheck/issues/204 - - (25) https://github.com/flycheck/flycheck/issues/215 - - (26) https://github.com/flycheck/flycheck/issues/256 - - (27) https://github.com/flycheck/flycheck/issues/225 - - (28) https://github.com/flycheck/flycheck/issues/251 - - (29) https://github.com/flycheck/flycheck/issues/259 - - (30) https://github.com/flycheck/flycheck/issues/263 - - -File: flycheck.info, Node: 0 14 1 Aug 16 2013, Next: 0 14 Aug 15 2013, Prev: 0 15 Nov 15 2013, Up: Changelog - -8.2.10 0.14.1 (Aug 16, 2013) ----------------------------- - - - Bug fixes: - - - Add a missing dependency [GH-194](1) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/194 - - -File: flycheck.info, Node: 0 14 Aug 15 2013, Next: 0 13 Jun 28 2013, Prev: 0 14 1 Aug 16 2013, Up: Changelog - -8.2.11 0.14 (Aug 15, 2013) --------------------------- - - - *Breaking changes*: - - - Introduce ‘flycheck-define-checker’ and obsolete - ‘flycheck-declare-checker’ [GH-163](1) - - - Remove the obsolete ‘flycheck-error-face’ and - ‘flycheck-warning-face’ - - - Do not initialize packages by default in ‘emacs-lisp’ syntax - checker for non-configuration files [GH-176](2) - - - Change the default ‘flycheck-highlighting-mode’ to ‘symbols’ - [GH-179](3) - - - Drop support for Pylint 0.x in ‘python-pylint’ [GH-184](4) - - - New features: - - - List errors at point only with prefix arg to - ‘flycheck-list-errors’ [GH-166](5) - - - Add new display function ‘flycheck-display-errors-in-list’ to - display errors at point in the error list [GH-166](6) - - - New ‘option-list’ argument cell to pass option lists to a - syntax checker - - - New ‘flycheck-emacs-lisp-load-path’ option to customize the - ‘load-path’ used by the ‘emacs-lisp’ syntax checker - [GH-174](7) - - - New ‘flycheck-emacs-lisp-initialize-packages’ option to - initialize packages in the ‘emacs-lisp’ syntax checker - [GH-176](8) - - - New ‘flycheck-emacs-lisp-package-user-dir’ option to configure - the package directory for the ‘emacs-lisp’ syntax checker - [GH-176](9) - - - New option filter ‘flycheck-option-comma-separated-list’ for - options with comma separated lists as values - - - New highlighting mode ‘symbols’ to highlight the symbol - pointed to by an error [GH-179](10) - - - New syntax checkers: - - - LESS [GH-160](11) - - - Haskell with ‘ghc’, ‘hdevtools’ and ‘hlint’ [GH-162](12) - - - C/C++ with ‘cppcheck’ [GH-170](13) - - - C/C++ with ‘clang’ [GH-172](14) - - - CoffeeScript with ‘coffee’ - - - XML with ‘xmllint’ [GH-180](15) - - - D with ‘dmd’ [GH-167](16) - - - Improvements: - - - Support Web Mode in ‘html-tidy’ syntax checker [GH-157](17) - - - Support Rubocop 0.9 and drop support for older Rubocop - releases [GH-159](18) - - - Include the message ID in error messages from ‘python-pylint’ - - - Bug fixes: - - - Fix warnings about flawed definitions in ‘emacs-lisp’ and - ‘emacs-lisp-checkdoc’, caused by faulty formatting of sexps - - - Refresh error lists when pressing ‘g’ [GH-166](19) - - - Do not obscure active minibuffer input when displaying errors - in the echo area [GH-175](20) - - - Fix universal prefix argument for ‘flycheck-next-error’ at - ‘C-c ! n’ - - - Correctly parse output of ‘coffeelint’ 0.5.7 [GH-192](21) - - - Correctly parse output of ‘pylint’ 1.0 [GH-184](22) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/163 - - (2) https://github.com/flycheck/flycheck/issues/176 - - (3) https://github.com/flycheck/flycheck/issues/179 - - (4) https://github.com/flycheck/flycheck/issues/184 - - (5) https://github.com/flycheck/flycheck/issues/166 - - (6) https://github.com/flycheck/flycheck/issues/166 - - (7) https://github.com/flycheck/flycheck/issues/174 - - (8) https://github.com/flycheck/flycheck/issues/176 - - (9) https://github.com/flycheck/flycheck/issues/176 - - (10) https://github.com/flycheck/flycheck/issues/179 - - (11) https://github.com/flycheck/flycheck/issues/160 - - (12) https://github.com/flycheck/flycheck/issues/162 - - (13) https://github.com/flycheck/flycheck/issues/170 - - (14) https://github.com/flycheck/flycheck/issues/172 - - (15) https://github.com/flycheck/flycheck/issues/180 - - (16) https://github.com/flycheck/flycheck/issues/167 - - (17) https://github.com/flycheck/flycheck/issues/157 - - (18) https://github.com/flycheck/flycheck/issues/159 - - (19) https://github.com/flycheck/flycheck/issues/166 - - (20) https://github.com/flycheck/flycheck/issues/175 - - (21) https://github.com/flycheck/flycheck/issues/192 - - (22) https://github.com/flycheck/flycheck/issues/184 - - -File: flycheck.info, Node: 0 13 Jun 28 2013, Next: 0 12 May 18 2013, Prev: 0 14 Aug 15 2013, Up: Changelog - -8.2.12 0.13 (Jun 28, 2013) --------------------------- - - - *Breaking changes*: - - - Obsolete ‘flycheck-warning-face’ and ‘flycheck-error-face’ in - favor ‘flycheck-warning’ and ‘flycheck-error’ respectively - - - Obsolete ‘:predicate’ forms in favor of ‘:predicate’ functions - - - ‘flycheck-def-config-file-var’ does not automatically mark - variables as safe anymore - - - New features: - - - Make fringe indicator faces customizable independently with - ‘flycheck-fringe-error’ and ‘flycheck-fringe-warning’ - - - Improve the default faces by using underlines instead of - foreground colors, if possible - - - Customizable error processing with - ‘flycheck-process-error-functions’ [GH-141](1) - - - Make the delay before starting a syntax check customizable via - ‘flycheck-idle-change-delay’ [GH-144](2) - - - Make display of errors under point customizable via - ‘flycheck-display-errors-function’ [GH-156](3) - - - Improvements - - - Always highlight errors on top of warnings now - - - Do not trigger syntax checks in the middle of commands - [GH-141](4) - - - Add the current directory to load path in the ‘emacs-lisp’ - syntax checker - - - Do not longer use the ‘emacs-lisp-checkdoc’ syntax checker in - Scratch buffers - - - Do not flush temporary files onto disk [GH-149](5) - - - Syntax checkers may have error patterns and error parser now - - - Predicate forms are now wrapped into functions and compiled - into functions during byte compilation - - - Copy each message separately in - ‘flycheck-copy-messages-as-kill’ - - - Mark some customizable variables as safe for file variable - usage, most notably ‘flycheck-indication-mode’, - ‘flycheck-highlighting-mode’ and ‘flycheck-idle-change-delay’. - - - Bug fixes: - - - Fix error when searching for a configuration file outside a - Projectile project - - - Do not start a syntax check before the ‘flycheck-mode-hook’ - was run - - - Do not start automatic syntax checks if Flycheck Mode is - disabled - - - Defer the initial syntax check until after the current - interactive command [GH-143](6) - - - Correctly clean up information about running processes - - - Fix compatibility with Emacs 24.2 and earlier [GH-150](7) - - - Fix version information on Emacs trunk builds - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/141 - - (2) https://github.com/flycheck/flycheck/issues/144 - - (3) https://github.com/flycheck/flycheck/issues/156 - - (4) https://github.com/flycheck/flycheck/issues/141 - - (5) https://github.com/flycheck/flycheck/issues/149 - - (6) https://github.com/flycheck/flycheck/issues/143 - - (7) https://github.com/flycheck/flycheck/issues/150 - - -File: flycheck.info, Node: 0 12 May 18 2013, Next: 0 11 May 01 2013, Prev: 0 13 Jun 28 2013, Up: Changelog - -8.2.13 0.12 (May 18, 2013) --------------------------- - - - New syntax checkers: - - - Ruby using ‘jruby’ [GH-136](1) - - - Puppet [GH-138](2) - - - New features: - - - Highlight error expressions by default, with the new ‘sexps’ - highlighting mode - - - Automatically check syntax some time after the last change in - the buffer [GH-140](3) - - - Add ‘flycheck-version’ to determine the installed Flycheck - version - - - Add ‘flycheck-list-errors’, mapped to ‘C-c ! l’, to list all - errors in a separate buffer - - - Improvements: - - - Defer syntax checks while a buffer is reverted, to avoid race - conditions - - - Bug fixes: - - - Correctly parse syntax errors from JRuby [GH-136](4) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/136 - - (2) https://github.com/flycheck/flycheck/issues/138 - - (3) https://github.com/flycheck/flycheck/issues/140 - - (4) https://github.com/flycheck/flycheck/issues/136 - - -File: flycheck.info, Node: 0 11 May 01 2013, Next: 0 10 Apr 21 2013, Prev: 0 12 May 18 2013, Up: Changelog - -8.2.14 0.11 (May 01, 2013) --------------------------- - - - New syntax checkers: - - - Scala [GH-124](1) - - - New features: - - - Customizable error indication with control of the fringe side, - via ‘flycheck-indication-mode’ - - - Customizable automatic syntax checking, via - ‘flycheck-check-syntax-automatically’ [GH-128](2) - - - Customizable configuration file search, via - ‘flycheck-locate-config-file-functions’ [GH-133](3) - - - Find configuration files in Projectile(4) projects - - - Add ‘flycheck-before-syntax-check-hook’ and - ‘flycheck-syntax-check-failed-hook’ - - - Improvements: - - - The ‘ruby’ syntax checker now differentiates warnings from - errors [GH-123](5) - - - Faces are now in a separate customization group - - - Bug fixes: - - - Add missing customization group for syntax checker options - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/124 - - (2) https://github.com/flycheck/flycheck/issues/128 - - (3) https://github.com/flycheck/flycheck/issues/133 - - (4) https://github.com/bbatsov/projectile - - (5) https://github.com/flycheck/flycheck/issues/123 - - -File: flycheck.info, Node: 0 10 Apr 21 2013, Next: 0 9 Apr 13 2013, Prev: 0 11 May 01 2013, Up: Changelog - -8.2.15 0.10 (Apr 21, 2013) --------------------------- - - - Flycheck uses ‘cl-lib’ now. This library is built-in as of GNU - Emacs 24.3. For earlier releases of GNU Emacs 24 an additional - compatibility library will be installed from GNU ELPA. - - - New syntax checkers: - - - POSIX Shell script using ‘bash’ [GH-112](1) - - - Ruby using ‘rubocop’ [GH-113](2) - - - Elixir [GH-108](3) - - - Erlang [GH-122](4) - - - Removed syntax checkers: - - - Python using Pyflakes. Use the superior Flake8 syntax checker - [GH-115](5) - - - New features: - - - Add ‘flycheck-copy-messages-as-kill’, mapped to ‘C-c ! C-w’, - to copy all error messages under point into kill ring - - - Add ‘flycheck-google-messages’, mapped to ‘C-c ! /’, to google - for error messages under point. Needs the Google This(6) - library - - - Syntax checkers can redirect output to a temporary directory - now using the ‘temporary-directory’ argument symbol - - - Improvements: - - - Call option filters for ‘nil’ values, too - - - Improve error parsing in Bash syntax checker [GH-112](7) - - - Error navigation does not cross restrictions in narrowed - buffers anymore - - - Try to preserve the non-directory part of the buffer’s file - name when substituting the ‘source’ symbol [GH-99](8) - - - Bug fixes: - - - Fix error highlighting and navigation in narrowed buffers - - - Use a hopefully more reliable way to parse output of PHP - CodeSniffer [GH-118](9) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/112 - - (2) https://github.com/flycheck/flycheck/issues/113 - - (3) https://github.com/flycheck/flycheck/issues/108 - - (4) https://github.com/flycheck/flycheck/issues/122 - - (5) https://github.com/flycheck/flycheck/issues/115 - - (6) https://github.com/Bruce-Connor/emacs-google-this - - (7) https://github.com/flycheck/flycheck/issues/112 - - (8) https://github.com/flycheck/flycheck/issues/99 - - (9) https://github.com/flycheck/flycheck/issues/118 - - -File: flycheck.info, Node: 0 9 Apr 13 2013, Next: 0 8 Apr 9 2013, Prev: 0 10 Apr 21 2013, Up: Changelog - -8.2.16 0.9 (Apr 13, 2013) -------------------------- - - - New syntax checkers: - - - SCSS using ‘scss’ [GH-103](1) - - - RST (ReStructuredText) using Docutils - - - Go using ‘go build’ and ‘go test’ [GH-107](2) - - - Improvements: - - - Quit the error message window when navigating away from error - locations - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/103 - - (2) https://github.com/flycheck/flycheck/issues/107 - - -File: flycheck.info, Node: 0 8 Apr 9 2013, Next: 0 7 1 Feb 23 2013, Prev: 0 9 Apr 13 2013, Up: Changelog - -8.2.17 0.8 (Apr 9, 2013) ------------------------- - - - New syntax checkers: - - - Go using ‘gofmt’ [GH-91](1) - - - Rust using ‘rustc’ [GH-101](2) - - - New features: - - - Add a global Flycheck mode. ‘(global-flycheck-mode)’ is now - the recommended way to enable Flycheck [GH-29](3) - - - Add support for syntax checker options [GH-72](4) - - - Add option for the coding standard used by the ‘php-phpcs’ - syntax checker - - - Add options for the maximum McCabe complexity and the maximum - line length to ‘python-flake8’ - - - Improvements: - - - Support McCabe warnings in ‘python-flake8’ - - - Support warnings from ‘flake8’ 2 - - - Show long error messages in a popup buffer [GH-94](5) - - - Show all error messages at point [GH-96](6) - - - Add support for naming warings from ‘flake8’ 2 [GH-98](7) - - - Flycheck mode is not longer enabled for buffers whose names - start with a space - - - Improve highlighting to reduce screen flickering [GH-100](8) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/91 - - (2) https://github.com/flycheck/flycheck/issues/101 - - (3) https://github.com/flycheck/flycheck/issues/29 - - (4) https://github.com/flycheck/flycheck/issues/72 - - (5) https://github.com/flycheck/flycheck/issues/94 - - (6) https://github.com/flycheck/flycheck/issues/96 - - (7) https://github.com/flycheck/flycheck/issues/98 - - (8) https://github.com/flycheck/flycheck/issues/100 - - -File: flycheck.info, Node: 0 7 1 Feb 23 2013, Next: 0 7 Feb 14 2013, Prev: 0 8 Apr 9 2013, Up: Changelog - -8.2.18 0.7.1 (Feb 23, 2013) ---------------------------- - - - Bug fixes: - - - Do not signal errors from ‘flycheck-mode’ [GH-87](1) - - - Correctly fall back to ‘$HOME’ when searching configuration - files - - - Correctly ascend to parent directory when searching - configuration files - - - API changes: - - - Rename ‘config’ cell to ‘config-file’ - - - Allow to pass the result of ‘config-file’ cells as single - argument - - - Add support for evaluating Lisp forms in syntax checker - commands [GH-86](2) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/87 - - (2) https://github.com/flycheck/flycheck/issues/86 - - -File: flycheck.info, Node: 0 7 Feb 14 2013, Next: 0 6 1 Jan 30 2013, Prev: 0 7 1 Feb 23 2013, Up: Changelog - -8.2.19 0.7 (Feb 14, 2013) -------------------------- - - - New features: - - - Navigate to source of syntax checker declarations from syntax - checker help - - - Add online Info manual [GH-60](1) - - - Improvements: - - - Use pipes instead of TTYs to read output from syntax checkers - - - Defer syntax checks for invisible buffers [GH-80](2) - - - Immediately display error messages after error navigation - [GH-62](3) - - - Bug fixes: - - - Never select deleted buffers - - - Do not let the debugger interfere with necessary cleanup - actions - - - Do not attempt to parse empty XML trees [GH-78](4) - - - Fix infinite recursion on Windows [GH-81](5) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/60 - - (2) https://github.com/flycheck/flycheck/issues/80 - - (3) https://github.com/flycheck/flycheck/issues/62 - - (4) https://github.com/flycheck/flycheck/issues/78 - - (5) https://github.com/flycheck/flycheck/issues/81 - - -File: flycheck.info, Node: 0 6 1 Jan 30 2013, Next: 0 6 Jan 29 2013, Prev: 0 7 Feb 14 2013, Up: Changelog - -8.2.20 0.6.1 (Jan 30, 2013) ---------------------------- - - - Fix package dependencies - - -File: flycheck.info, Node: 0 6 Jan 29 2013, Next: 0 5 Dec 28 2012, Prev: 0 6 1 Jan 30 2013, Up: Changelog - -8.2.21 0.6 (Jan 29, 2013) -------------------------- - - - New syntax checkers: - - - Emacs Lisp with ‘checkdoc-current-buffer’ [GH-53](1) - - - PHP with PHP CodeSniffer [GH-72](2) - - - Removed syntax checkers: - - - Javascript with ‘jsl’ - - - New features: - - - Error navigation with ‘next-error’ and ‘previous-error’ - [GH-26](3) - - - Fringe icons instead of error indicators [GH-33](4) - - - Menu entry for Flycheck [GH-59](5) - - - Customizable error highlighting, taking the column number into - account [GH-35](6) - - - Configuration files for syntax checkers - - - Add configuration file support to the syntax checkers - ‘coffee-coffeelint’, ‘html-tidy’, ‘javascript-jshint’, - ‘pyton-flake8’ and ‘tex-chktex’ - - - Allow to compile a buffer with a syntax checker for testing - purposes [GH-58](7) - - - Use multiple syntax checkers during a syntax check [GH-31](8) - - - Add dedicated help for syntax checkers [GH-52](9) - - - Improvements: - - - Match error patterns in order of declaration [GH-55](10) - - - Bug fixes: - - - Inherit highlighting faces from built-in faces [GH-24](11) - - - Correct error patterns of the HTML syntax checker [GH-36](12) - - - Detect syntax errors in the ‘python-flake8’ syntax checker - [GH-42](13) - - - Fix various regressions after introducing unit tests - - - Inhibit syntax checking during package installation - [GH-45](14) - - - Disable syntax checking in Tramp buffers [GH-54](15) - - - Preserve whitespace in error messages [GH-65](16) - - - API changes: - - - Replace syntax checker variables with syntax checker - declarations [GH-41](17) - - - Support parsing errors with arbitrary functions instead of - error patterns [GH-38](18) - - - Add an error parser for Checkstyle-like XML output [GH-38](19) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/53 - - (2) https://github.com/flycheck/flycheck/issues/72 - - (3) https://github.com/flycheck/flycheck/issues/26 - - (4) https://github.com/flycheck/flycheck/issues/33 - - (5) https://github.com/flycheck/flycheck/issues/59 - - (6) https://github.com/flycheck/flycheck/issues/35 - - (7) https://github.com/flycheck/flycheck/issues/58 - - (8) https://github.com/flycheck/flycheck/issues/31 - - (9) https://github.com/flycheck/flycheck/issues/52 - - (10) https://github.com/flycheck/flycheck/issues/55 - - (11) https://github.com/flycheck/flycheck/issues/24 - - (12) https://github.com/flycheck/flycheck/issues/36 - - (13) https://github.com/flycheck/flycheck/issues/42 - - (14) https://github.com/flycheck/flycheck/issues/45 - - (15) https://github.com/flycheck/flycheck/issues/54 - - (16) https://github.com/flycheck/flycheck/issues/65 - - (17) https://github.com/flycheck/flycheck/issues/41 - - (18) https://github.com/flycheck/flycheck/issues/38 - - (19) https://github.com/flycheck/flycheck/issues/38 - - -File: flycheck.info, Node: 0 5 Dec 28 2012, Next: 0 4 Nov 21 2012, Prev: 0 6 Jan 29 2013, Up: Changelog - -8.2.22 0.5 (Dec 28, 2012) -------------------------- - - - New syntax checkers: - - - SASS [GH-15](1) - - - Perl [GH-21](2) - - - XML - - - Lua [GH-30](3) - - - New features: - - - Support manual buffer-local selection of syntax checker - [GH-25](4) - - - Add customizable error indicators [GH-28](5) - - - Echo error messages at point without 3rd-party libraries like - flymake-cursor [GH-27](6) - - - Improvements: - - - Remember the last automatically selected syntax checker - [GH-24](7) - - - Bug fixes: - - - Fix syntax checking of buffers without backing files - [GH-19](8) - - - API changes: - - - Replace underlying Flymake API with a custom syntax checking - implementation [GH-15](9) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/15 - - (2) https://github.com/flycheck/flycheck/issues/21 - - (3) https://github.com/flycheck/flycheck/issues/30 - - (4) https://github.com/flycheck/flycheck/issues/25 - - (5) https://github.com/flycheck/flycheck/issues/28 - - (6) https://github.com/flycheck/flycheck/issues/27 - - (7) https://github.com/flycheck/flycheck/issues/24 - - (8) https://github.com/flycheck/flycheck/issues/19 - - (9) https://github.com/flycheck/flycheck/issues/15 - - -File: flycheck.info, Node: 0 4 Nov 21 2012, Next: 0 3 Nov 21 2012, Prev: 0 5 Dec 28 2012, Up: Changelog - -8.2.23 0.4 (Nov 21, 2012) -------------------------- - - - Rename the project to Flycheck [GH-5](1) - - - New syntax checkers - - - HAML [GH-9](2) - - - CSS [GH-9](3) - - - Javascript with ‘jsl’ [GH-9](4) - - - Javascript with ‘jshint’ [GH-16](5) - - - JSON [GH-12](6) - - - LaTeX with ‘lacheck’ - - - Bug fixes: - - - Fix type error when checking compressed Emacs Lisp [GH-10](7) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/5 - - (2) https://github.com/flycheck/flycheck/issues/9 - - (3) https://github.com/flycheck/flycheck/issues/9 - - (4) https://github.com/flycheck/flycheck/issues/9 - - (5) https://github.com/flycheck/flycheck/issues/16 - - (6) https://github.com/flycheck/flycheck/issues/12 - - (7) https://github.com/flycheck/flycheck/issues/10 - - -File: flycheck.info, Node: 0 3 Nov 21 2012, Next: 0 2 Oct 25 2012, Prev: 0 4 Nov 21 2012, Up: Changelog - -8.2.24 0.3 (Nov 21, 2012) -------------------------- - - - Replace ‘flymake-mode’ with a custom syntax checking minor mode - [GH-4](1) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/4 - - -File: flycheck.info, Node: 0 2 Oct 25 2012, Next: 0 1 Oct 11 2012, Prev: 0 3 Nov 21 2012, Up: Changelog - -8.2.25 0.2 (Oct 25, 2012) -------------------------- - - - New syntax checkers: - - - PHP - - - API changes: - - - Simplify syntax checker declarations [GH-2](1) - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues/2 - - -File: flycheck.info, Node: 0 1 Oct 11 2012, Prev: 0 2 Oct 25 2012, Up: Changelog - -8.2.26 0.1 (Oct 11, 2012) -------------------------- - -Initial release as flymake-checkers - - - New syntax checkers: - - - TeX/LaTeX - - - Shell scripts - - - Python - - - Ruby - - - Coffeescript - - - Emacs Lisp - - -File: flycheck.info, Node: Extending Flycheck, Next: Flycheck API, Prev: Flycheck releases, Up: Top - -9 Extending Flycheck -******************** - -This chapter explains how to add new syntax checkers and how to extend -built-in syntax checkers, by example. For a detailed reference on the -involved types, functions and macros, please refer to the *note Flycheck -API: 1fc. - - Note: If you define a new syntax checker or have an extension to a - built-in syntax checker, please report it to Flycheck (see *note - Reporting issues: 8d.), so that we can consider it for inclusion to - make it available to all other users of Flycheck. - - If you would like to contribute your extension or your new syntax - checker to Flycheck as a patch or pull request, please see *note - Contributing code: 1fd. and *note Contributing syntax checkers: - 1fe. - -* Menu: - -* Defining new syntax checkers:: -* Advanced syntax checker definitions:: -* Other ways to extend Flycheck:: - - -File: flycheck.info, Node: Defining new syntax checkers, Next: Advanced syntax checker definitions, Up: Extending Flycheck - -9.1 Defining new syntax checkers -================================ - -Flycheck provides the macro *note flycheck-define-checker: 19. to define -a new syntax checker. The following example defines a simple syntax -checker for the popular Pylint(1) tool for Python: - - (flycheck-define-checker python-pylint - "A Python syntax and style checker using Pylint. - - See URL `http://www.pylint.org/'." - :command ("pylint" - "--msg-template" "{path}:{line}:{column}:{C}:{msg} ({msg_id})" - source) - :error-patterns - ((error line-start (file-name) ":" line ":" column ":" - (or "E" "F") ":" (message) line-end) - (warning line-start (file-name) ":" line ":" column ":" - (or "W" "R") ":" (message) line-end) - (info line-start (file-name) ":" line ":" column ":" - "C:" (message) line-end)) - :modes python-mode) - -The first argument to *note flycheck-define-checker: 19. 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 *note flycheck-describe-checker: 3a. or ‘C-c ! ?’, e.g. -‘C-c ! ? texinfo’. - -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: - - - The ‘:command’ specifies the command Flycheck should run to check - the buffer. It’s a simple list containing the executable and its - arguments. - - In our example we first the ‘--msg-template’ option to Pylint to - configure a comprehensive and parseable output format. - - Then we use the “special” ‘source’ argument to pass the contents of - the buffer as input file to ‘pylint’. Whenever it sees the - ‘source’ argument, Flycheck creates a temporary file, fills it with - the current contents of the buffer and passes that file to the - syntax checker. This allows to check the real contents of a buffer - even if the buffer is not saved to disk. - - - The ‘: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. - - See also -............. - - *note flycheck-define-error-level: 27.; to define custom error - levels - - Flycheck provides special ‘rx’ forms to extract the relevant - information from each error: - - - The ‘(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. - - - The ‘line’ and ‘column’ forms match a sequence of one or more - digits as line and column respectively of the error. - - See also -............. - - *note flycheck-rx-to-string: 200.; for a list of all special ‘rx’ - forms provided by Flycheck and their reference - - - The ‘:modes’ property denotes the major modes, in which Flycheck - may use this syntax checker. JSHint checks Javascript, so the - ‘:modes’ of our example specifies Emacs’ builtin Javascript Mode, - and the popular 3rd-party JS2 Mode. - -See also -........ - -*note flycheck-substitute-argument: 201.; for a complete list of all -special arguments - -* Menu: - -* Finding the right error patterns:: -* Trying a new syntax checker:: -* Registering new syntax checkers:: - - ---------- Footnotes ---------- - - (1) http://www.pylint.org/ - - -File: flycheck.info, Node: Finding the right error patterns, Next: Trying a new syntax checker, Up: Defining new syntax checkers - -9.1.1 Finding the right error patterns --------------------------------------- - -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 -*note flycheck-compile: 19c. - - -- Command: C -c ! C-c - -- Command: M -x 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. - -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 *note Parsing structured output format: 204. for more -information. - - -File: flycheck.info, Node: Trying a new syntax checker, Next: Registering new syntax checkers, Prev: Finding the right error patterns, Up: Defining new syntax checkers - -9.1.2 Trying a new syntax checker ---------------------------------- - -After evaluating a syntax checker definition you can try whether it -works for normal syntax checks by selecting it manually with ‘C-c ! s’ -(*note flycheck-select-checker: 24.). 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. - - -File: flycheck.info, Node: Registering new syntax checkers, Prev: Trying a new syntax checker, Up: Defining new syntax checkers - -9.1.3 Registering new syntax checkers -------------------------------------- - -To register a new syntax checker for automatic syntax checking, just add -it to *note flycheck-checkers: 5e.: - - (add-to-list 'flycheck-checkers 'flycheck-jshint) - -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. - - Note: Do *not* use *note flycheck-checker: 23. and *note - flycheck-select-checker: 24. 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 *note - flycheck-checker: 23. or by calling *note flycheck-select-checker: - 24. 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 *note - flycheck-checkers: 5e. and let Flycheck automatically pick the best - syntax checker. In other words, this is *good*: - - (add-to-list 'flycheck-checkers 'my-new-syntax-checker) - - -File: flycheck.info, Node: Advanced syntax checker definitions, Next: Other ways to extend Flycheck, Prev: Defining new syntax checkers, Up: Extending Flycheck - -9.2 Advanced syntax checker definitions -======================================= - -* Menu: - -* Parsing structured output format:: -* Passing options and configuration files to syntax checkers:: -* Controlling the use of a syntax checker:: -* Applying more than one syntax checker:: - - -File: flycheck.info, Node: Parsing structured output format, Next: Passing options and configuration files to syntax checkers, Up: Advanced syntax checker definitions - -9.2.1 Parsing structured output format --------------------------------------- - -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(1) -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 *note flycheck-parse-checkstyle: 17a. 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 also -........ - -*note Error parsers: 20a.; for more information about error parsers - - ---------- Footnotes ---------- - - (1) http://www.jshint.com/ - - -File: flycheck.info, Node: Passing options and configuration files to syntax checkers, Next: Controlling the use of a syntax checker, Prev: Parsing structured output format, Up: Advanced syntax checker definitions - -9.2.2 Passing options and configuration files to syntax checkers ----------------------------------------------------------------- - -Many linting tools provide a rich set of options to configure their -analysis. Flycheck makes it to define proper Emacs options and map them -to options of commands. - -For instance, the Rubocop(1) 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, other Flycheck omits the entire argument. - -Flycheck also supports other special ‘option-’ arguments for plain -values or lists of values. - -See also -........ - -flycheck-substitute-argument; for a list of all special ‘option-’ -arguments - -Flycheck also provides a convenience macro *note -flycheck-def-option-var: 20d. 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. - -By a similar mechanism you can also pass paths to configuration files to -a syntax checker tool. The aforementioned Pylint(2) 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 *note Syntax checker configuration files: 6b. -and *note Configuration files for command syntax checkers: 20e. for -details. - - ---------- Footnotes ---------- - - (1) https://github.com/bbatsov/rubocop - - (2) http://www.pylint.org/ - - -File: flycheck.info, Node: Controlling the use of a syntax checker, Next: Applying more than one syntax checker, Prev: Passing options and configuration files to syntax checkers, Up: Advanced syntax checker definitions - -9.2.3 Controlling the use of a syntax checker ---------------------------------------------- - -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. - - -File: flycheck.info, Node: Applying more than one syntax checker, Prev: Controlling the use of a syntax checker, Up: Advanced syntax checker definitions - -9.2.4 Applying more than one syntax checker -------------------------------------------- - -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(1) 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: 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 *note flycheck-add-next-checker: 212.: - - (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 -*note flycheck-checkers: 5e, so we need to *note register our new syntax -checker: 206.: - - (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’. - - Warning: Make sure to append chained syntax checkers to *note - flycheck-checkers: 5e. - - 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 *note -flycheck-define-checker: 19. with the ‘:next-checkers’ property. -Instead of calling *note flycheck-add-next-checker: 212, 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))) - - Note: If you control the definition of both syntax checkers, this - style is *preferable* to *note flycheck-add-next-checker: 212. Use - this function only if you cannot change the definition of the prior - syntax checker. - - ---------- Footnotes ---------- - - (1) https://github.com/koalaman/shellcheck/ - - -File: flycheck.info, Node: Other ways to extend Flycheck, Prev: Advanced syntax checker definitions, Up: Extending Flycheck - -9.3 Other ways to extend Flycheck -================================= - -* Menu: - -* Use arbitrary functions to check buffers:: -* Hooking into Flycheck:: - - -File: flycheck.info, Node: Use arbitrary functions to check buffers, Next: Hooking into Flycheck, Up: Other ways to extend Flycheck - -9.3.1 Use arbitrary functions to check buffers ----------------------------------------------- - -Beyond commands, Flycheck also supports arbitrary functions as syntax -checkers with *note flycheck-define-generic-checker: 1b. - - -File: flycheck.info, Node: Hooking into Flycheck, Prev: Use arbitrary functions to check buffers, Up: Other ways to extend Flycheck - -9.3.2 Hooking into Flycheck ---------------------------- - -Flycheck has a rich hook interface which you can use for your own -extensions. - -* Menu: - -* Status changes:: -* Error processing:: -* Error display:: - - -File: flycheck.info, Node: Status changes, Next: Error processing, Up: Hooking into Flycheck - -9.3.2.1 Status changes -...................... - -*note flycheck-before-syntax-check-hook: 218. 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(1) uses these hooks to colour -your mode-line according to the result of the last syntax check. -Additionally, *note flycheck-status-changed-functions: 19e. runs on -every single status change of Flycheck, and provides a fine-grained -reporting about what Flycheck is currently doing. - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck-color-mode-line - - -File: flycheck.info, Node: Error processing, Next: Error display, Prev: Status changes, Up: Hooking into Flycheck - -9.3.2.2 Error processing -........................ - -The functions in *note flycheck-process-error-functions: 21a. 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 -*note flycheck-add-overlay: 21b. is responsible for adding error -highlighting to the buffer. As a consequence, you can *entirely opt -out* from highlighting with a custom hook. - diff --git a/elpa/flycheck-20150125.601/flycheck.info-2 b/elpa/flycheck-20150125.601/flycheck.info-2 deleted file mode 100644 index 03cd9b46..00000000 --- a/elpa/flycheck-20150125.601/flycheck.info-2 +++ /dev/null @@ -1,3771 +0,0 @@ -This is flycheck.info, produced by makeinfo version 5.2 from -flycheck.texi. - -This manual is for Flycheck version 0.23-cvs. - -Copyright © 2014-2015 Sebastian Wiesner - - Permission is granted to copy, distribute and/or modify this - documentation 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.”. - - 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 - . - -INFO-DIR-SECTION Emacs -START-INFO-DIR-ENTRY -* flycheck: (flycheck.info). On the fly syntax checking for GNU Emacs -END-INFO-DIR-ENTRY - - - Generated by Sphinx 1.2.3. - - -File: flycheck.info, Node: Error display, Prev: Error processing, Up: Hooking into Flycheck - -9.3.2.3 Error display -..................... - -The function *note flycheck-display-errors-function: 2b. is called to -display an error at point. The flycheck-pos-tip(1) extension uses this -hook to show errors in a GUI popup like conventional IDEs do. - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck-pos-tip - - -File: flycheck.info, Node: Flycheck API, Next: Flycheck ERT API, Prev: Extending Flycheck, Up: Top - -10 Flycheck API -*************** - -This chapter defines and documents the public API of Flycheck. You can -use this API to define your own syntax checkers, or extend existing -syntax checkers, or by extending Flycheck in entirely new ways, e.g. to -add some sophisticated error analysis. - -You will also find this document helpful if you want to develop Flycheck -itself. - -* Menu: - -* Syntax checks:: -* Generic syntax checkers: Generic syntax checkers<2>. -* Command syntax checkers:: -* Errors:: -* Flycheck buffer status:: -* Utilities:: - - -File: flycheck.info, Node: Syntax checks, Next: Generic syntax checkers<2>, Up: Flycheck API - -10.1 Syntax checks -================== - -A syntax check performs the following steps: - - 1. Run hooks in *note flycheck-before-syntax-check-hook: 218. - - 2. Clear error information from previous syntax checks. - - 3. Select a *note suitable syntax checker: 53. - - 4. Copy the contents of the buffer to be checked to a temporary file. - - 5. Run the syntax checker. - - 6. Parse the output of the tool, and report all errors and warnings, - via *note flycheck-process-error-functions: 21a. - - 7. If the buffer can be checked with another syntax checker, continue - from step 4, but with the next syntax checker. This is called - *note chaining: a0. of syntax checkers. - - 8. Run hooks in *note flycheck-after-syntax-check-hook: 222. - - -- Hook: flycheck -after-syntax-check-hook - - Variable properties: This variable may be risky if used as a - file-local variable. - - Functions to run after each syntax check. - - This hook is run after a syntax check was finished. - - At this point, *all* chained checkers were run, and all errors - were parsed, highlighted and reported. The variable - *note ‘flycheck-current-errors’: 91. contains all errors from all syntax - checkers run during the syntax check, so you can apply any error - analysis functions. - - Note that this hook does *not* run after each individual syntax - checker in the syntax checker chain, but only after the *last - checker*. - - This variable is a normal hook. See Info node *note (elisp)Hooks::. - - -- Hook: flycheck -before-syntax-check-hook - - Variable properties: This variable may be risky if used as a - file-local variable. - - Functions to run before each syntax check. - - This hook is run right before a syntax check starts. - - Error information from the previous syntax check is *not* - cleared before this hook runs. - - Note that this hook does *not* run before each individual syntax - checker in the syntax checker chain, but only before the *first - checker*. - - This variable is a normal hook. See Info node *note (elisp)Hooks::. - - -- Hook: flycheck -syntax-check-failed-hook - - Variable properties: This variable may be risky if used as a - file-local variable. - - Functions to run if a syntax check failed. - - This hook is run whenever an error occurs during Flycheck’s - internal processing. No information about the error is given to - this hook. - - You should use this hook to conduct additional cleanup actions - when Flycheck failed. - - This variable is a normal hook. See Info node *note (elisp)Hooks::. - - -File: flycheck.info, Node: Generic syntax checkers<2>, Next: Command syntax checkers, Prev: Syntax checks, Up: Flycheck API - -10.2 Generic syntax checkers -============================ - -Generic syntax checkers are the most basic syntax checkers in Flycheck. -These syntax checkers use an Emacs Lisp function to check the current -buffer. - - -- Function: flycheck -define-generic-checker symbol docstring &rest - properties - - Define SYMBOL as generic syntax checker. - - Any syntax checker defined with this macro is eligible for manual - syntax checker selection with *note ‘flycheck-select-checker’: 24. To make - the new syntax checker available for automatic selection, it must - be registered in *note ‘flycheck-checkers’: 5e. - - DOCSTRING is the documentation of the syntax checker, for - *note ‘flycheck-describe-checker’: 3a. The following PROPERTIES constitute - a generic syntax checker. Unless otherwise noted, all properties - are mandatory. - - ‘:start FUNCTION’ - A function to start the syntax checker. - - FUNCTION shall take two arguments and return a context - object if the checker is started successfully. Otherwise it - shall signal an error. - - The first argument is the syntax checker being started. The - second is a callback function to report state changes to - Flycheck. The callback takes two arguments STATUS DATA, - where STATUS is a symbol denoting the syntax checker status - and DATA an optional argument with additional data for the - status report. See ‘`flycheck-report-buffer-checker-status'’ - for more information about STATUS and DATA. - - FUNCTION may be synchronous or asynchronous, i.e. it may - call the given callback either immediately, or at some later - point (e.g. from a process sentinel). - - A syntax checker _must_ call CALLBACK at least once with a - STATUS that finishes the current syntax checker. Otherwise - Flycheck gets stuck at the current syntax check with this - syntax checker. - - The context object returned by FUNCTION is passed to - ‘`:interrupt'’. - - ‘:interrupt FUNCTION’ - A function to interrupt the syntax check. - - FUNCTION is called with the syntax checker and the context - object returned by the ‘`:start'’ function and shall try to - interrupt the syntax check. The context may be nil, if the - syntax check is interrupted before actually started. - FUNCTION should handle this situation. - - If it cannot interrupt the syntax check, it may either - signal an error or silently ignore the attempt to interrupt - the syntax checker, depending on the severity of the - situation. - - If interrupting the syntax check failed, Flycheck will let - the syntax check continue, but ignore any status reports. - Notably, it won’t highlight any errors reported by the - syntax check in the buffer. - - This property is optional. If omitted, Flycheck won’t - attempt to interrupt syntax checks wit this syntax checker, - and simply ignore their results. - - ‘:print-doc FUNCTION’ - A function to print additional documentation into the Help - buffer of this checker. - - FUNCTION is called when creating the Help buffer for the - syntax checker, with the syntax checker as single argument, - after printing the name of the syntax checker and its modes - and predicate, but before printing DOCSTRING. It may insert - additional documentation into the current buffer. - - The call occurs within ‘`with-help-window'’. Hence - ‘`standard-output'’ points to the current buffer, so you may - use ‘`princ'’ and friends to add content. Also, the current - buffer is put into Help mode afterwards, which automatically - turns symbols into references, if possible. - - This property is optional. If omitted, no additional - documentation is printed for this syntax checker. - - :verify FUNCTION - A function to verify the checker for the current buffer. - - FUNCTION is called with the syntax checker as single - argument, and shall return a list of - ‘`flycheck-verification-result'’ objects indicating whether - the syntax checker could be used in the current buffer, and - highlighting potential setup problems. - - This property is optional. If omitted, no additional - verification occurs for this syntax checker. It is however - absolutely recommended that you add a ‘`:verify'’ function to - your syntax checker, because it will help users to spot - potential setup problems. - - ‘:modes MODES’ - A major mode symbol or a list thereof, denoting major modes - to use this syntax checker in. - - If given this syntax checker is only used in buffers whose - ‘`major-mode'’ is ‘`eq'’ to any mode in MODES. - - If ‘`:predicate'’ is also given, the syntax checker will only - be used in buffers for which the ‘`:predicate'’ returns - non-nil. - - This property is optional, however at least one of ‘`:modes'’ - or ‘`:predicate'’ must be given. - - ‘:predicate FUNCTION’ - A function to determine whether to use the syntax checker in - the current buffer. - - FUNCTION is called without arguments and shall return - non-nil if this syntax checker shall be used to check the - current buffer. Otherwise it shall return nil. - - If ‘`:modes'’ is also given, FUNCTION is only called in - matching major modes. - - This property is optional, however at least one of ‘`:modes'’ - or ‘`:predicate'’ must be given. - - ‘:error-filter FUNCTION’ - A function to filter the errors returned by this checker. - - FUNCTION is called with the list of ‘`flycheck-error'’ objects - returned by the syntax checker and shall return another list - of ‘`flycheck-error'’ objects, which is considered the final - result of this syntax checker. - - FUNCTION is free to add, remove or modify errors, whether in - place or by copying. - - This property is optional. The default filter is - ‘`identity'’. - - ‘:next-checkers NEXT-CHECKERS’ - A list denoting syntax checkers to apply after this syntax - checker, in what we call "chaining" of syntax checkers. - - Each ITEM is a cons cell ‘(LEVEL . CHECKER)’. CHECKER is a - syntax checker to run after this syntax checker. LEVEL is - an error level. CHECKER will only be used if there are no - current errors of at least LEVEL. LEVEL may also be t, in - which case CHECKER is used regardless of the current errors. - - ITEM may also be a syntax checker symbol, which is - equivalent to ‘(t . ITEM)’. - - Flycheck tries all items in order of declaration, and uses - the first whose LEVEL matches and whose CHECKER is - registered and can be used for the current buffer. - - This feature is typically used to apply more than one syntax - checker to a buffer. For instance, you might first use a - compiler to check a buffer for syntax and type errors, and - then run a linting tool that checks for insecure code, or - questionable style. - - This property is optional. If omitted, it defaults to the - nil, i.e. no other syntax checkers are applied after this - syntax checker. - - Signal an error, if any property has an invalid value. - - See also -............. - - *note Status callback protocol: 226. - -To make new syntax checkers available for automatic selection you need -to register them by adding them to *note flycheck-checkers: 5e. - - -- Function: flycheck -registered-checker-p checker - - Determine whether CHECKER is registered. - - A checker is registered if it is contained in - *note ‘flycheck-checkers’: 5e. - -You can extend generic syntax checkers to add new modes or chain further -syntax checkers: - - -- Function: flycheck -add-mode checker mode - - Add a new major MODE to CHECKER. - - CHECKER and MODE are symbols denoting a syntax checker and a - major mode respectively. - - Add MODE to the ‘`:modes'’ property of CHECKER, so that CHECKER - will be used in buffers with MODE. - - -- Function: flycheck -add-next-checker checker next &optional append - - Add a NEXT checker after CHECKER. - - CHECKER is a syntax checker symbol, to which to add NEXT checker. - - NEXT is a cons cell ‘(LEVEL . NEXT-CHECKER)’. NEXT-CHECKER is a - symbol denoting the syntax checker to run after CHECKER. LEVEL - is an error level. NEXT-CHECKER will only be used if there is no - current error whose level is more severe than LEVEL. LEVEL may - also be t, in which case NEXT-CHECKER is used regardless of the - current errors. - - NEXT can also be a syntax checker symbol only, which is - equivalent to ‘(t . NEXT)’. - - NEXT-CHECKER is prepended before other next checkers, unless - APPEND is non-nil. - -* Menu: - -* Status callback protocol:: -* Predicates for syntax checkers:: -* Error filters:: - - -File: flycheck.info, Node: Status callback protocol, Next: Predicates for syntax checkers, Up: Generic syntax checkers<2> - -10.2.1 Status callback protocol -------------------------------- - -The ‘callback’ argument to the ‘:start’ function of a syntax checker -defined with *note flycheck-define-generic-checker: 1b. is a function -taking two arguments: - - -- Function: status -callback status &optional data - - ‘status’ is one of the following symbols, denoting the status being - reported: - - ‘errored’ (_finishing_) - - The syntax checker has errored. ‘data’ is an optional error - message as string. - - ‘interrupted’ (_finishing_) - - The syntax checker was interrupted. ‘data’ is ignored in this - case. - - ‘finished’ (_finishing_) - - The syntax checker has finished to check the buffer and - reported some errors. DATA is the list of *note - flycheck-error: 169. objects reported by the syntax check. - - ‘suspicious’ - - The syntax checker encountered some suspicious state (like a - potential fault in the syntax checker definition), which the - user needs to be informed about. - - A _finishing_ ‘status’ symbol finishes the current syntax check, - and allows Flycheck to conduct further syntax checks. A syntax - checker *must* call the callback at least once with a _finishing_ - ‘status’ symbol. - - Warning: Failure to call the callback will cause Flycheck to - get stuck at the current syntax check. - - -File: flycheck.info, Node: Predicates for syntax checkers, Next: Error filters, Prev: Status callback protocol, Up: Generic syntax checkers<2> - -10.2.2 Predicates for syntax checkers -------------------------------------- - -Flycheck provides some ready-to-use predicates for generic checkers: - - -- Function: flycheck -buffer-saved-p &optional buffer - - Determine whether BUFFER is saved to a file. - - BUFFER is the buffer to check. If omitted or nil, use the - current buffer as BUFFER. - - Return non-nil if the BUFFER is backed by a file, and not - modified, or nil otherwise. - - -File: flycheck.info, Node: Error filters, Prev: Predicates for syntax checkers, Up: Generic syntax checkers<2> - -10.2.3 Error filters --------------------- - -Additionally, Flycheck has some built-in error filters for generic -checkers: - - -- Function: flycheck -sanitize-errors errors - - Sanitize ERRORS. - - Sanitize ERRORS by trimming leading and trailing whitespace in - all error messages, and by replacing 0 columns and empty error - messages with nil. - - Returns sanitized ERRORS. - - -- Function: flycheck -increment-error-columns errors &optional offset - - Increment all columns of ERRORS by OFFSET. - - Use this as ‘`:error-filter'’ if a syntax checker outputs 0-based - columns. - - -- Function: flycheck -collapse-error-message-whitespace errors - - Collapse whitespace in all messages of ERRORS. - - Return ERRORS. - - -- Function: flycheck -dedent-error-messages errors - - Dedent all messages of ERRORS. - - For each error in ERRORS, determine the indentation offset from - the leading whitespace of the first line, and dedent all further - lines accordingly. - - Return ERRORS, with in-place modifications. - - -- Function: flycheck -fold-include-levels errors sentinel-message - - Fold levels of ERRORS from included files. - - ERRORS is a list of ‘`flycheck-error'’ objects. SENTINEL-MESSAGE - is a regular expression matched against the error message to - determine whether the errror denotes errors from an included - file. Alternatively, it is a function that is given an error and - shall return non-nil, if the error denotes errors from an - included file. - - -- Function: flycheck -dequalify-error-ids errors - - De-qualify error ids in ERRORS. - - Remove all qualifications from error ids in ERRORS, by stripping - all leading dotted components from error IDs. For instance, if - the error ID is com.foo.E100, replace it with E100. - - This error filter is mainly useful to simplify error IDs obtained - from parsing Checkstyle XML, which frequently has very verbose - IDs, that include the name of the tool. - - -- Function: flycheck -remove-error-ids errors - - Remove all error ids from ERRORS. - - -File: flycheck.info, Node: Command syntax checkers, Next: Errors, Prev: Generic syntax checkers<2>, Up: Flycheck API - -10.3 Command syntax checkers -============================ - -Command syntax checkers are a specialised variant of generic syntax -checkers which use an external command to check the contents of the -current buffer. To define a new command syntax checker, use *note -flycheck-define-command-checker: 177.: - - -- Function: flycheck -define-command-checker symbol docstring &rest - properties - - Define SYMBOL as syntax checker which runs a command. - - Define SYMBOL as generic syntax checker via - *note ‘flycheck-define-generic-checker’: 1b, which uses an external command - to check the buffer. SYMBOL and DOCSTRING are the same as for - *note ‘flycheck-define-generic-checker’: 1b. - - In addition to the properties understood by - *note ‘flycheck-define-generic-checker’: 1b, the following PROPERTIES - constitute a command syntax checker. Unless otherwise noted, all - properties are mandatory. Note that the default ‘`:error-filter'’ - of command checkers is *note ‘flycheck-sanitize-errors’: 22c. - - ‘:command COMMAND’ - The command to run for syntax checking. - - COMMAND is a list of the form ‘(EXECUTABLE [ARG ...])’. - - EXECUTABLE is a string with the executable of this syntax - checker. It can be overridden with the variable - ‘`flycheck-SYMBOL-executable'’. Note that this variable is - NOT implicitly defined by this function. Use - *note ‘flycheck-def-executable-var’: 233. to define this variable. - - Each ARG is an argument to the executable, either as string, - or as special symbol or form for - *note ‘flycheck-substitute-argument’: 201, which see. - - ‘:error-patterns PATTERNS’ - A list of patterns to parse the output of the ‘`:command'’. - - Each ITEM in PATTERNS is a list ‘(LEVEL SEXP ...)’, where - LEVEL is a Flycheck error level (see - *note ‘flycheck-define-error-level’: 27.), followed by one or more RX - ‘`SEXP'’s which parse an error of that level and extract line, - column, file name and the message. - - See ‘`rx'’ for general information about RX, and - *note ‘flycheck-rx-to-string’: 200. for some special RX forms provided - by Flycheck. - - All patterns are applied in the order of declaration to the - whole output of the syntax checker. Output already matched - by a pattern will not be matched by subsequent patterns. In - other words, the first pattern wins. - - This property is optional. If omitted, however, an - ‘`:error-parser'’ is mandatory. - - ‘:error-parser FUNCTION’ - A function to parse errors with. - - The function shall accept three arguments OUTPUT CHECKER - BUFFER. OUTPUT is the syntax checker output as string, - CHECKER the syntax checker that was used, and BUFFER a - buffer object representing the checked buffer. The function - must return a list of ‘`flycheck-error'’ objects parsed from - OUTPUT. - - This property is optional. If omitted, it defaults to - *note ‘flycheck-parse-with-patterns’: 234. In this case, - ‘`:error-patterns'’ is mandatory. - - Note that you may not give ‘`:start'’, ‘`:interrupt'’, and - ‘`:print-doc'’ for a command checker. You can give a custom - ‘`:verify'’ function, but you should take care to call - ‘`flycheck-verify-command-checker'’ in a custom ‘`:verify'’ - function. - -Each command checker uses an accompanying variable to override the -executable, which you can define with *note flycheck-def-executable-var: -233.: - - -- Macro: flycheck -def-executable-var checker default-executable - - Define the executable variable for CHECKER. - - DEFAULT-EXECUTABLE is the default executable. It is only used in - the docstring of the variable. - - The variable is defined with ‘`defcustom'’ in the - ‘`flycheck-executables'’ group. It’s also defined to be risky as - file-local variable, to avoid arbitrary executables being used - for syntax checking. - -Since command syntax checkers are by far the most common kind of syntax -checkers, Flycheck provides a convenience macro *note -flycheck-define-checker: 19. which wraps up *note -flycheck-define-command-checker: 177. and *note -flycheck-def-executable-var: 233. into a single macro, and reduces -syntactic clutter by allowing unquoted arguments: - - -- Macro: flycheck -define-checker symbol docstring &rest properties - - Define SYMBOL as command syntax checker with DOCSTRING and PROPERTIES. - - Like *note ‘flycheck-define-command-checker’: 177, but PROPERTIES must not - be quoted. Also, implicitly define the executable variable for - SYMBOL with *note ‘flycheck-def-executable-var’: 233. - -* Menu: - -* Command arguments:: -* Options for command syntax checkers:: -* Configuration files for command syntax checkers:: -* Error parsing with regular expressions:: -* Error parsers:: - - -File: flycheck.info, Node: Command arguments, Next: Options for command syntax checkers, Up: Command syntax checkers - -10.3.1 Command arguments ------------------------- - -The arguments passed to the external command of a command syntax checker -are subject to substitution with *note flycheck-substitute-argument: -201, which replaces special symbols and forms with strings for -consumption by the external command: - - -- Function: flycheck -substitute-argument arg checker - - Substitute ARG for CHECKER. - - Return a list of real arguments for the executable of CHECKER, - substituted for the symbolic argument ARG. Single arguments, - e.g. if ARG is a literal strings, are wrapped in a list. - - ARG may be one of the following forms: - - STRING - Return ARG unchanged. - - ‘`source'’, ‘`source-inplace'’ - Create a temporary file to check and return its path. With - ‘`source-inplace'’ create the temporary file in the same - directory as the original file. The value of - *note ‘flycheck-temp-prefix’: 5b. is used as prefix of the file name. - - With ‘`source'’, try to retain the non-directory component of - the buffer’s file name in the temporary file. - - ‘`source'’ is the preferred way to pass the input file to a - syntax checker. ‘`source-inplace'’ should only be used if the - syntax checker needs other files from the source directory, - such as include files in C. - - ‘`source-original'’ - Return the path of the actual file to check, or an empty - string if the buffer has no file name. - - Note that the contents of the file may not be up to date - with the contents of the buffer to check. Do not use this - as primary input to a checker, unless absolutely necessary. - - When using this symbol as primary input to the syntax - checker, add *note ‘flycheck-buffer-saved-p’: 22a. to the ‘`:predicate'’. - - ‘`temporary-directory'’ - Create a unique temporary directory and return its path. - - ‘`temporary-file-name'’ - Return a unique temporary filename. The file is *not* - created. - - To ignore the output of syntax checkers, try ‘`null-device'’ - first. - - ‘`null-device'’ - Return the value of ‘`null-device'’, i.e the system null - device. - - Use this option to ignore the output of a syntax checker. - If the syntax checker cannot handle the null device, or - won’t write to an existing file, try ‘`temporary-file-name'’ - instead. - - ‘(config-file OPTION VARIABLE [PREPEND-FN])’ - Search the configuration file bound to VARIABLE with - *note ‘flycheck-locate-config-file’: 236. and return a list of arguments - that pass this configuration file to the syntax checker, or - nil if the configuration file was not found. - - PREPEND-FN is called with the OPTION and the located - configuration file, and should return OPTION prepended - before the file, either a string or as list. If omitted, - PREPEND-FN defaults to ‘`list'’. - - ‘(option OPTION VARIABLE [PREPEND-FN [FILTER]])’ - Retrieve the value of VARIABLE and return a list of - arguments that pass this value as value for OPTION to the - syntax checker. - - PREPEND-FN is called with the OPTION and the value of - VARIABLE, and should return OPTION prepended before the - file, either a string or as list. If omitted, PREPEND-FN - defaults to ‘`list'’. - - FILTER is an optional function to be applied to the value of - VARIABLE before prepending. This function must return nil - or a string. In the former case, return nil. In the latter - case, return a list of arguments as described above. - - ‘(option-list OPTION VARIABLE [PREPEND-FN [FILTER]])’ - Retrieve the value of VARIABLE, which must be a list, - and prepend OPTION before each item in this list, using - PREPEND-FN. - - PREPEND-FN is called with the OPTION and each item of the - list as second argument, and should return OPTION prepended - before the item, either as string or as list. If omitted, - PREPEND-FN defaults to ‘`list'’. - - FILTER is an optional function to be applied to each item in - the list before prepending OPTION. It shall return the - option value for each item as string, or nil, if the item is - to be ignored. - - ‘(option-flag OPTION VARIABLE)’ - Retrieve the value of VARIABLE and return OPTION, if the - value is non-nil. Otherwise return nil. - - ‘(eval FORM)’ - Return the result of evaluating FORM in the buffer to be - checked. FORM must either return a string or a list of - strings, or nil to indicate that nothing should be - substituted for CELL. For all other return types, signal an - error - - _No_ further substitutions are performed, neither in FORM - before it is evaluated, nor in the result of evaluating - FORM. - - In all other cases, signal an error. - - Note that substitution is *not* recursive. No symbols or cells - are substituted within the body of cells! - - -File: flycheck.info, Node: Options for command syntax checkers, Next: Configuration files for command syntax checkers, Prev: Command arguments, Up: Command syntax checkers - -10.3.2 Options for command syntax checkers ------------------------------------------- - -Command syntax checkers can define options, whose values are substituted -into the external command. - - -- Macro: flycheck -def-option-var symbol init-value checker docstring - &rest custom-args - - Define SYMBOL as option variable with INIT-VALUE for CHECKER. - - SYMBOL is declared as customizable variable using ‘`defcustom'’, to - provide an option for the given syntax CHECKER. INIT-VALUE is - the initial value of the variable, and DOCSTRING is its - docstring. CUSTOM-ARGS are forwarded to ‘`defcustom'’. - - Use this together with the ‘`option'’, ‘`option-list'’ and - ‘`option-flag'’ forms in the ‘`:command'’ argument to - *note ‘flycheck-define-checker’: 19. - - -- Macro: flycheck -def-args-var symbol checker &rest custom-args - - Define SYMBOL as argument variable for CHECKER. - - SYMBOL is declared as customizable, risky and buffer-local - variable using ‘`defcustom'’ to provide an option for arbitrary - arguments for the given syntax CHECKER. CUSTOM-ARGS is forwarded - to ‘`defcustom'’. - - Use the ‘`eval'’ form to splice this variable into the - ‘`:command'’. - -Flycheck provides some built-in filters for such options: - - -- Function: flycheck -option-int value - - Convert an integral option VALUE to a string. - - If VALUE is nil, return nil. Otherwise return VALUE converted to - a string. - - -- Function: flycheck -option-comma-separated-list value &optional - separator filter - - Convert VALUE into a list separated by SEPARATOR. - - SEPARATOR is a string to separate items in VALUE, defaulting to - ",". FILTER is an optional function, which takes a single - argument and returns either a string or nil. - - If VALUE is a list, apply FILTER to each item in VALUE, remove - all nil items, and return a single string of all remaining items - separated by SEPARATOR. - - Otherwise, apply FILTER to VALUE and return the result. - SEPARATOR is ignored in this case. - - -File: flycheck.info, Node: Configuration files for command syntax checkers, Next: Error parsing with regular expressions, Prev: Options for command syntax checkers, Up: Command syntax checkers - -10.3.3 Configuration files for command syntax checkers ------------------------------------------------------- - -Additionally, command syntax checkers can pass configuration files to -external commands. - - -- Macro: flycheck -def-config-file-var symbol checker &optional - file-name &rest custom-args - - Define SYMBOL as config file variable for CHECKER, with default FILE-NAME. - - SYMBOL is declared as customizable variable using ‘`defcustom'’, to - provide a configuration file for the given syntax CHECKER. - CUSTOM-ARGS are forwarded to ‘`defcustom'’. - - FILE-NAME is the initial value of the new variable. If omitted, - the default value is nil. - - Use this together with the ‘`config-file'’ form in the ‘`:command'’ - argument to *note ‘flycheck-define-checker’: 19. - -Flycheck tries to find an appropriate file based on the value of -configuration file variables, and substitutes the path to that file into -the external command. - - -- Function: flycheck -locate-config-file filename checker - - Locate the configuration file FILENAME for CHECKER. - - Locate the configuration file using - *note ‘flycheck-locate-config-file-functions’: 6d. - - Return the absolute path of the configuration file, or nil if no - configuration file was found. - - -File: flycheck.info, Node: Error parsing with regular expressions, Next: Error parsers, Prev: Configuration files for command syntax checkers, Up: Command syntax checkers - -10.3.4 Error parsing with regular expressions ---------------------------------------------- - -Normally, command syntax checkers use regular expressions to extract -errors from the output. For simplicity and readability, Flycheck uses -RX expressions instead of standard regular expressions, and provides -some custom RX forms for frequent patterns, implemented by *note -flycheck-rx-to-string: 200.: - - -- Function: flycheck -rx-to-string form &optional no-group - - Like ‘`rx-to-string'’ for FORM, but with special keywords: - - ‘`line'’ - matches the line number. - - ‘`column'’ - matches the column number. - - ‘(file-name SEXP ...)’ - matches the file name. SEXP describes the file name. If no - SEXP is given, use a default body of ‘(minimal-match - (one-or-more not-newline))’. - - ‘(message SEXP ...)’ - matches the message. SEXP constitutes the body of the message. If no SEXP - is given, use a default body of ‘(one-or-more not-newline)’. - - ‘(id SEXP ...)’ - matches an error ID. SEXP describes the ID. - - NO-GROUP is passed to ‘`rx-to-string'’. - -Internally, error parsing with regular expressions is implemented with a -special error parser: - - -- Function: flycheck -parse-with-patterns output checker buffer - - Parse OUTPUT from CHECKER with error patterns. - - Uses the error patterns of CHECKER to tokenize the output and - tries to parse each error token with all patterns, in the order - of declaration. Hence an error is never matched twice by two - different patterns. The pattern declared first always wins. - - _BUFFER is ignored. - - Return a list of parsed errors and warnings (as ‘`flycheck-error'’ - objects). - - -File: flycheck.info, Node: Error parsers, Prev: Error parsing with regular expressions, Up: Command syntax checkers - -10.3.5 Error parsers --------------------- - -Alternatively, command syntax checkers can use custom functions to parse -errors from the command output. Flycheck provides some built-in error -parsers for standard output formats: - - -- Function: flycheck -parse-checkstyle output checker buffer - - Parse Checkstyle errors from OUTPUT. - - Parse Checkstyle-like XML output. Use this error parser for - checkers that have an option to output errors in this format. - - See URL ‘http://checkstyle.sourceforge.net/’(1) for information - about Checkstyle. - -You can also write your own error parsers. An error parser is a -function with the following signature: - - -- Function: flycheck -error-parser output checker buffer - - ‘output’ is the output of the command as string. ‘checker’ is the - syntax checker from which the output comes, and ‘buffer’ is the - buffer that was checked. - -The following functions can aid you in writing custom parsers: - - -- Function: flycheck -parse-xml-string xml - - Parse an XML string. - - Return the document tree parsed from XML in the form ‘(ROOT ATTRS - BODY...)’. ROOT is a symbol identifying the name of the root - element. ATTRS is an alist of the attributes of the root node. - BODY is zero or more body elements, either as strings (in case of - text nodes) or as XML nodes, in the same for as the root node. - - ---------- Footnotes ---------- - - (1) http://checkstyle.sourceforge.net/ - - -File: flycheck.info, Node: Errors, Next: Flycheck buffer status, Prev: Command syntax checkers, Up: Flycheck API - -10.4 Errors -=========== - -The list of errors in a buffer is stored in the local variable *note -flycheck-current-errors: 91.: - - -- Variable: flycheck -current-errors - - Variable properties: Automatically becomes buffer-local when - set. - - A list of all errors and warnings in the current buffer. - -Flycheck errors are represented by the CL structure *note -flycheck-error: 169. See *note (cl)Structures:: for more information -about CL structures. - - -- CL Struct: flycheck -error - - A Flycheck error with the following slots. Each of these slots may - be ‘nil’. - - -- Slot: buffer - - The buffer object referring to the buffer this error belongs - to. - - -- Slot: checker - - The syntax checker that reported this error. - - -- Slot: filename - - A string containing the filename the error refers to. - - -- Slot: line - - An integer providing the line the error refers to. - - -- Slot: column - - An _optional_ integer providing the column the error refers - to. - - If this attribute is ‘nil’, Flycheck will assume that the - error refers to the whole line. - - Warning: For compatibility with external programs and - *unlike* Emacs itself (e.g. in Compile Mode), Flycheck - uses 1-based columns, not 0-based: The first character on - a line is column 1. - - This is the format used by most external programs, but - occasionally a program tries to proactively adapt to - Emacs’ convention, and outputs 0-based columns. In this - case, you need to adapt the column numbers for Flycheck, - via *note flycheck-increment-error-columns: 22d. as - ‘:error-filter’. - - -- Slot: message - - The human-readable error message as string. - - -- Slot: level - - The error level of the message, as symbol denoting an error - level defined with *note flycheck-define-error-level: 27. - - -- Slot: id - - An _optional_ unique identifier for this kind of error. - - This field should identify the kind of an error, not the - individual error itself. - - There are two constructors to create new *note flycheck-error: 169. - objects: - - -- Function: flycheck -error-new-at line column &optional level - message &key checker id filename buffer - - Create a new Flycheck error at the given LINE and COLUMN. - - LINE and COLUMN refer to the *note line: 244. and *note - column: 245. of the new error. The optional LEVEL and MESSAGE - arguments fill the *note level: 247. and cl-slot:‘message’ - slots respectively. - - CHECKER, ID, FILENAME and BUFFER are keyword arguments, for - *note checker: 168, *note id: 179, *note filename: 243. and - *note buffer: 167. respectively. BUFFER defaults to the - current buffer and FILENAME to the file name of the current - buffer. The other keyword arguments default to ‘nil’. - - Warning: Due to a limitation of Common Lisp functions in - Emacs Lisp, you must specify *all* optional arguments, - that is, *both* LEVEL *and* MESSAGE, to pass any keyword - arguments. - - -- Function: flycheck -error-new &rest attributes - - Create a new *note flycheck-error: 169. with the given - ATTRIBUTES. - - ATTRIBUTES is a property list, where each property specifies - the value for the corresponding slot of *note flycheck-error: - 169, for instance: - - (flycheck-error-new :line 10 :column 5 :message "Foo" :level 'warning) - - The following functions and macros work on errors: - - -- Macro: flycheck -error-with-buffer err &rest forms - - Switch to the buffer of ERR and evaluate FORMS. - - If the buffer of ERR is not live, FORMS are not evaluated. - - -- Function: flycheck -error-line-region err - - Get the line region of ERR. - - ERR is a Flycheck error whose region to get. - - Return a cons cell ‘(BEG . END)’ where BEG is the first - non-whitespace character on the line ERR refers to, and END the - end of the line. - - -- Function: flycheck -error-column-region err - - Get the error column region of ERR. - - ERR is a Flycheck error whose region to get. - - Return a cons cell ‘(BEG . END)’ where BEG is the character - before the error column, and END the actual error column, or nil - if ERR has no column. - - -- Function: flycheck -error-thing-region thing err - - Get the region of THING at the column of ERR. - - ERR is a Flycheck error whose region to get. THING is a - understood by ‘`thing-at-point'’. - - Return a cons cell ‘(BEG . END)’ where BEG is the beginning of - the THING at the error column, and END the end of the symbol. If - ERR has no error column, or if there is no THING at this column, - return nil. - - -- Function: flycheck -error-pos err - - Get the buffer position of ERR. - - ERR is a Flycheck error whose position to get. - - The error position is the error column, or the first - non-whitespace character of the error line, if ERR has no error column. - - -- Function: flycheck -error-format err - - Format ERR as human-readable string. - - Return a string that represents the given ERR. This string does - _not_ include the file name. - - -- Function: flycheck -error-< err1 err2 - - Determine whether ERR1 goes before ERR2 by location. - - Compare by line numbers and then by column numbers. - - -- Function: flycheck -error-level-< err1 err2 - - Determine whether ERR1 goes before ERR2 by error level. - - Like *note ‘flycheck-error-<’: 250, but compares by error level severity - first. Levels of the same severity are compared by name. - -* Menu: - -* Error processing: Error processing<2>. -* Error analysis:: -* Error levels: Error levels<2>. - - -File: flycheck.info, Node: Error processing<2>, Next: Error analysis, Up: Errors - -10.4.1 Error processing ------------------------ - - -- Hook: flycheck -process-error-functions - - -- Function: flycheck -add-overlay - - -File: flycheck.info, Node: Error analysis, Next: Error levels<2>, Prev: Error processing<2>, Up: Errors - -10.4.2 Error analysis ---------------------- - -Flycheck provides some functions for rudimentary error analysis: - - -- Function: flycheck -count-errors errors - - Count the number of ERRORS, grouped by level.. - - Return an alist, where each ITEM is a cons cell whose ‘`car'’ is an - error level, and whose ‘`cdr'’ is the number of errors of that - level. - - -- Function: flycheck -has-errors-p errors level - - Determine if there are any ERRORS with LEVEL. - - -- Function: flycheck -has-max-errors-p - -- Function: :auto - - -File: flycheck.info, Node: Error levels<2>, Prev: Error analysis, Up: Errors - -10.4.3 Error levels -------------------- - -Flycheck provides three built-in error levels: - -‘error’ - - Severe errors which cannot be ignored - -‘warning’ - - Potential errors which can be ignored - -‘info’ - - Informational annotations - -You can define new error levels with *note flycheck-define-error-level: -27.: - - -- Function: flycheck -define-error-level level &rest properties - - Define a new error LEVEL with PROPERTIES. - - The following PROPERTIES constitute an error level: - - ‘:severity SEVERITY’ - A number denoting the severity of this level. The higher - the number, the more severe is this level compared to other - levels. Defaults to 0. - - The severity is used by *note ‘flycheck-error-level-<’: 251. to - determine the ordering of errors according to their levels. - - ‘:overlay-category CATEGORY’ - A symbol denoting the overlay category to use for error - highlight overlays for this level. See Info - node *note (elisp)Overlay Properties:: for more information about - overlay categories. - - A category for an error level overlay should at least define - the ‘`face'’ property, for error highlighting. Other useful - properties for error level categories are ‘`priority'’ to - influence the stacking of multiple error level overlays, and - ‘`help-echo'’ to define a default error messages for errors - without messages. - - ‘:fringe-bitmap BITMAP’ - A fringe bitmap symbol denoting the bitmap to use for fringe - indicators for this level. See Info node *note (elisp)Fringe Bitmaps:: for more information about fringe bitmaps, - including a list of built-in fringe bitmaps. - - ‘:fringe-face FACE’ - A face symbol denoting the face to use for fringe indicators - for this level. - - ‘:error-list-face FACE’ - A face symbol denoting the face to use for messages of this - level in the error list. See *note ‘flycheck-list-errors’: 4b. - - -- Function: flycheck -error-level-p level - - Determine whether LEVEL is a Flycheck error level. - - -File: flycheck.info, Node: Flycheck buffer status, Next: Utilities, Prev: Errors, Up: Flycheck API - -10.5 Flycheck buffer status -=========================== - - -- Hook: flycheck -status-changed-functions - - Variable properties: This variable may be risky if used as a - file-local variable. - - Functions to run if the Flycheck status changed. - - This hook is run whenever the status of Flycheck changes. Each - hook function takes the status symbol as sinlge argument, as - given to *note ‘flycheck-report-status’: 25a, which see. - - This variable is a abnormal hook. See Info - node *note (elisp)Hooks::. - - This hook was introduced, or its default value was changed, in - version 0.20 of the flycheck package. - - -- Function: flycheck -report-status status - - Report Flycheck STATUS. - - STATUS is one of the following symbols: - - ‘`not-checked'’ - The current buffer was not checked. - - ‘`no-checker'’ - Automatic syntax checker selection did not find a suitable - syntax checker. - - ‘`running'’ - A syntax check is now running in the current buffer. - - ‘`errored'’ - The current syntax check has errored. - - ‘`finished'’ - The current syntax check was finished normally. - - ‘`interrupted'’ - The current syntax check was interrupted. - - ‘`suspicious'’ - The last syntax check had a suspicious result. - - Set *note ‘flycheck-last-status-change’: 90. and call - *note ‘flycheck-status-changed-functions’: 19e. with STATUS. Afterwards - refresh the mode line. - - -- Variable: flycheck -last-status-change - - Variable properties: Automatically becomes buffer-local when - set. - - The last status change in the current buffer. - - -- Function: flycheck -mode-line-status-text &optional status - - Get a text describing STATUS for use in the mode line. - - STATUS defaults to *note ‘flycheck-last-status-change’: 90. if omitted or - nil. - - -File: flycheck.info, Node: Utilities, Prev: Flycheck buffer status, Up: Flycheck API - -10.6 Utilities -============== - - -- Function: flycheck -string-list-p obj - - Determine if OBJ is a list of strings. - - -- Function: flycheck -symbol-list-p obj - - Determine if OBJ is a list of symbols. - - -File: flycheck.info, Node: Flycheck ERT API, Next: Contribution guidelines, Prev: Flycheck API, Up: Top - -11 Flycheck ERT API -******************* - -This chapter documents the Flycheck ERT API, which is used throughout -Flycheck’s own test suite, and available for use in test suites for your -own Flycheck extensions. - -* Menu: - -* Compatibility:: -* Loading and initializing:: -* Utilities: Utilities<2>. -* Defining test cases:: - - -File: flycheck.info, Node: Compatibility, Next: Loading and initializing, Up: Flycheck ERT API - -11.1 Compatibility -================== - -‘flycheck-ert’ is compatible with all ERT versions included in Emacs -from 24.1 onwards. - - Note: Test skipping - - ERT in Emacs 24.3 and earlier does not support skipped tests. For - these versions, ‘flycheck-ert’ provides limited support for skipped - tests by marking them as expected to fail. - - For this feature to work, you *must* call ‘flycheck-ert-initialize’ - after defining all test cases. - - -File: flycheck.info, Node: Loading and initializing, Next: Utilities<2>, Prev: Compatibility, Up: Flycheck ERT API - -11.2 Loading and initializing -============================= - -The ERT API is provided by the ‘flycheck-ert’ library, which is part of -the Flycheck package. If the Flycheck package is installed (see *note -Installation: 31.), you can load the ERT API with: - - (require 'flycheck-ert) - -This will also load the ‘ert’ and ‘flycheck’ libraries. - -Flycheck ERT supports test resources (see *note Accessing test -resources: 261.). For this feature, you need to initialize Flycheck ERT -with a resource directory by calling *note flycheck-ert-initialize: -262.: - - -- Function: flycheck -ert-initialize resource-dir - - Initialize a test suite with RESOURCE-DIR. - - RESOURCE-DIR is the directory, *note ‘flycheck-ert-resource-filename’: 263. - should use to lookup resource files. - - -File: flycheck.info, Node: Utilities<2>, Next: Defining test cases, Prev: Loading and initializing, Up: Flycheck ERT API - -11.3 Utilities -============== - -* Menu: - -* Creating temporary buffers:: -* Scoping resource access:: -* Accessing test resources:: -* Obtaining information about the environment:: - - -File: flycheck.info, Node: Creating temporary buffers, Next: Scoping resource access, Up: Utilities<2> - -11.3.1 Creating temporary buffers ---------------------------------- - - -- Macro: flycheck -ert-with-temp-buffer &rest body - - Eval BODY within a temporary buffer. - - Like ‘`with-temp-buffer'’, but resets the modification state of the - temporary buffer to make sure that it is properly killed even if - it has a backing file and is modified. - - -- Macro: flycheck -ert-with-file-buffer file-name &rest body - - Create a buffer from FILE-NAME and eval BODY. - - BODY is evaluated with ‘`current-buffer'’ being a buffer with the - contents FILE-NAME. - - -File: flycheck.info, Node: Scoping resource access, Next: Accessing test resources, Prev: Creating temporary buffers, Up: Utilities<2> - -11.3.2 Scoping resource access ------------------------------- - - -- Macro: flycheck -ert-with-help-buffer &rest body - - Execute BODY and kill the help buffer afterwards. - - Use this macro to test functions that create a Help buffer. - - -- Macro: flycheck -ert-with-env env &rest body - - Add ENV to ‘`process-environment'’ in BODY. - - Execute BODY with a ‘`process-environment'’ with contains all - variables from ENV added. - - ENV is an alist, where each cons cell ‘(VAR . VALUE)’ is a - environment variable VAR to be added to ‘`process-environment'’ - with VALUE. - - -- Macro: flycheck -ert-with-global-mode &rest body - - Execute BODY with Global Flycheck Mode enabled. - - After BODY, restore the old state of Global Flycheck Mode. - - -File: flycheck.info, Node: Accessing test resources, Next: Obtaining information about the environment, Prev: Scoping resource access, Up: Utilities<2> - -11.3.3 Accessing test resources -------------------------------- - -The following functions and macros load resources from the directory -given to *note flycheck-ert-initialize: 262. - - -- Function: flycheck -ert-resource-filename resource-file - - Determine the absolute file name of a RESOURCE-FILE. - - Relative file names are expanded against - ‘`flycheck-ert-resources-directory'’. - - -- Macro: flycheck -ert-with-resource-buffer resource-file &rest body - - Create a temp buffer from a RESOURCE-FILE and execute BODY. - - The absolute file name of RESOURCE-FILE is determined with - *note ‘flycheck-ert-resource-filename’: 263. - - -- Function: flycheck -ert-locate-config-file filename _checker - - Find a configuration FILENAME within unit tests. - - _CHECKER is ignored. - - -File: flycheck.info, Node: Obtaining information about the environment, Prev: Accessing test resources, Up: Utilities<2> - -11.3.4 Obtaining information about the environment --------------------------------------------------- - - -- Constant: flycheck -ert-user-error-type - - The ‘`user-error'’ type used by Flycheck. - - -- Function: flycheck -ert-travis-ci-p - - Determine whether we are running on Travis CI. - - -- Function: flycheck -ert-check-gpg - - Check whether GPG is available. - - -- Function: flycheck -ert-extract-version-command re executable &rest - args - - Use RE to extract the version from EXECUTABLE with ARGS. - - Run EXECUTABLE with ARGS, catch the output, and apply RE to find - the version number. Return the text captured by the first group - in RE, or nil, if EXECUTABLE is missing, or if RE failed to - match. - - -File: flycheck.info, Node: Defining test cases, Prev: Utilities<2>, Up: Flycheck ERT API - -11.4 Defining test cases -======================== - -In addition to the standard ‘ert-deftest’ from ERT, this library -provides macros for specialized test case definitions: - - -- Macro: flycheck -ert-def-checker-test checker language name &rest - keys-and-body - - Define a test case for a syntax CHECKER for LANGUAGE. - - CHECKER is a symbol or a list of symbols denoting syntax checkers - being tested by the test. The test case is skipped, if any of - these checkers cannot be used. LANGUAGE is a symbol or a list of - symbols denoting the programming languages supported by the - syntax checkers. This is currently only used for tagging the - test appropriately. - - NAME is a symbol denoting the local name of the test. The test - itself is ultimately named - ‘`flycheck-define-checker/CHECKER/NAME'’. If CHECKER is a list, - the first checker in the list is used for naming the test. - - Optionally, the keyword arguments ‘`:tags'’ and ‘`:expected-result'’ - may be given. They have the same meaning as in ‘`ert-deftest.'’, - and are added to the tags and result expectations set up by this - macro. - - The remaining forms denote the body of the test case, including - assertions and setup code. - -* Menu: - -* Checking results of test cases:: -* Invoking syntax checkers in test cases:: -* Writing assertions:: - - -File: flycheck.info, Node: Checking results of test cases, Next: Invoking syntax checkers in test cases, Up: Defining test cases - -11.4.1 Checking results of test cases -------------------------------------- - -Flycheck ERT provides some functions to check the results of test cases, -which are handy in ‘:expected-result’ forms. - - -- Function: flycheck -ert-syntax-check-timed-out-p result - - Whether RESULT denotes a timed-out test. - - RESULT is an ERT test result object. - - -File: flycheck.info, Node: Invoking syntax checkers in test cases, Next: Writing assertions, Prev: Checking results of test cases, Up: Defining test cases - -11.4.2 Invoking syntax checkers in test cases ---------------------------------------------- - - -- Function: flycheck -ert-buffer-sync - - Like *note ‘flycheck-buffer’: 47, but synchronously. - - -- Function: flycheck -ert-ensure-clear - - Clear the current buffer. - - Raise an assertion error if the buffer is not clear afterwards. - - -File: flycheck.info, Node: Writing assertions, Prev: Invoking syntax checkers in test cases, Up: Defining test cases - -11.4.3 Writing assertions -------------------------- - - -- Function: flycheck -ert-should-overlay error - - Test that ERROR has a proper overlay in the current buffer. - - ERROR is a Flycheck error object. - - -- Function: flycheck -ert-should-errors &rest errors - - Test that the current buffers has ERRORS. - - ERRORS is a list of errors expected to be present in the current - buffer. Each error is given as a list of arguments to - *note ‘flycheck-error-new-at’: 248. - - If ERRORS are omitted, test that there are no errors at all in - the current buffer. - - With ERRORS, test that each error in ERRORS is present in the - current buffer, and that the number of errors in the current - buffer is equal to the number of given ERRORS. In other words, - check that the buffer has all ERRORS, and no other errors. - - -- Function: flycheck -ert-should-syntax-check resource-file modes - &rest errors - - Test a syntax check in RESOURCE-FILE with MODES. - - RESOURCE-FILE is the file to check. MODES is a single major mode - symbol or a list thereof, specifying the major modes to syntax - check with. If more than one major mode is specified, the test - is run for each mode separately, so if you give three major - modes, the entire test will run three times. ERRORS is the list - of expected errors, as in *note ‘flycheck-ert-should-errors’: 27d. If - omitted, the syntax check must not emit any errors. The errors - are cleared after each test. - - The syntax checker is selected via standard syntax checker - selection. To test a specific checker, you need to set - *note ‘flycheck-checker’: 23. or *note ‘flycheck-disabled-checkers’: 5f. accordingly - before using this predicate, depending on whether you want to use - manual or automatic checker selection. - - During the syntax check, configuration files of syntax checkers - are also searched in the ‘`config-files'’ sub-directory of the - resource directory. - - -- Function: flycheck -ert-at-nth-error n - - Determine whether point is at the N’th Flycheck error. - - Return non-nil if the point is at the N’th Flycheck error in the - current buffer. Otherwise return nil. - - -File: flycheck.info, Node: Contribution guidelines, Next: Testing Flycheck, Prev: Flycheck ERT API, Up: Top - -12 Contribution guidelines -************************** - -If you discovered bugs and issues, have ideas for improvements or new -features, or want to contribute a new syntax checker, please report to -the issue tracker(1) the repository and send a pull request, but respect -the following guidelines. - -* Menu: - -* Reporting issues:: -* Contributing code:: - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues - - -File: flycheck.info, Node: Reporting issues, Next: Contributing code, Up: Contribution guidelines - -12.1 Reporting issues -===================== - -Please report issues to the issue tracker(1). - - - Check that the issue has not already been reported. - - - Check that the issue has not already been fixed in the latest code. - - - Check that your setup is fine with ‘M-x flycheck-verify-setup’. - - - Be clear and precise (do not prose, but name functions and commands - exactly). - - - Include the version of Flycheck as shown by ‘M-x flycheck-version’. - - - Open an issue with a clear title and description in grammatically - correct, complete sentences. - - ---------- Footnotes ---------- - - (1) https://github.com/flycheck/flycheck/issues - - -File: flycheck.info, Node: Contributing code, Prev: Reporting issues, Up: Contribution guidelines - -12.2 Contributing code -====================== - -Contributions of code, either as pull requests or as patches, are _very_ -welcome, but please respect the following guidelines. - -* Menu: - -* General:: -* Code style:: -* Commit messages:: -* Contributing syntax checkers:: -* Pull requests:: - - -File: flycheck.info, Node: General, Next: Code style, Up: Contributing code - -12.2.1 General --------------- - - - Write good and _complete_ code. - - - Provide use cases and rationale for new features. - - -File: flycheck.info, Node: Code style, Next: Commit messages, Prev: General, Up: Contributing code - -12.2.2 Code style ------------------ - - - Generally, use the same coding style and spacing. - - - Do not use tabs for indentation. - - - Add docstrings for every declaration. - - - Make sure your code compiles without warnings with ‘make compile’, - and has no checkdoc issues with ‘M-x checkdoc-buffer’ or ‘C-c ? d’. - If you are using Flycheck, just make sure that your code has no - Flycheck warnings. - - -File: flycheck.info, Node: Commit messages, Next: Contributing syntax checkers, Prev: Code style, Up: Contributing code - -12.2.3 Commit messages ----------------------- - -Write commit messages according to Tim Pope’s guidelines(1). In short: - - - Start with a capitalized, short (50 characters or less) summary, - followed by a blank line. - - - If necessary, add one or more paragraphs with details, wrapped at - 72 characters. - - - Use present tense and write in the imperative: “Fix bug”, not - “fixed bug” or “fixes bug”. - - - Separate paragraphs by blank lines. - - - Do _not_ use special markup (e.g. Markdown). Commit messages are - plain text. You may use ‘*emphasis*’ or ‘_underline_’ though, - following conventions established on mailing lists. - -This is a model commit message: - - Capitalized, short (50 chars or less) summary - - More detailed explanatory text, if necessary. Wrap it to about 72 - characters or so. In some contexts, the first line is treated as the - subject of an email and the rest of the text as the body. The blank - line separating the summary from the body is critical (unless you omit - the body entirely); tools like rebase can get confused if you run the - two together. - - Write your commit message in the imperative: "Fix bug" and not "Fixed bug" - or "Fixes bug." This convention matches up with commit messages generated - by commands like git merge and git revert. - - Further paragraphs come after blank lines. - - - Bullet points are okay, too - - - Typically a hyphen or asterisk is used for the bullet, followed by a - single space, with blank lines in between, but conventions vary here - - - Use a hanging indent - -Git Commit Mode(2) and Magit(3) provide a major mode for Git commit -messages, which helps you to comply to these guidelines. - - ---------- Footnotes ---------- - - (1) -http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html - - (2) https://github.com/magit/git-modes/ - - (3) https://github.com/magit/magit/ - - -File: flycheck.info, Node: Contributing syntax checkers, Next: Pull requests, Prev: Commit messages, Up: Contributing code - -12.2.4 Contributing syntax checkers ------------------------------------ - -For syntax checkers, some special guidelines apply in addition to the -above: - - - Provide a link to the website of the syntax checker tool in the - comments of your pull request. - - - Add a proper docstring to your syntax checker, including this URL. - - - Add unit tests for your syntax checker, or provide example code - that triggers errors for each error pattern of the syntax checker. - - - Extend the Ansible playbooks in ‘playbooks/’ to install the - required tools in the CI environment and the local testing VM, or - explain how to install the tool on an Ubuntu 12.04 system. - - Note: Unit tests that can run on Travis CI are *mandatory* for all - syntax checkers in Flycheck. - - -File: flycheck.info, Node: Pull requests, Prev: Contributing syntax checkers, Up: Contributing code - -12.2.5 Pull requests --------------------- - - - Use a *topic branch* to easily amend a pull request later, if - necessary. - - - Do *not* open new pull requests, when asked to improve your patch. - Instead, amend your commits with ‘git rebase -i’, and then update - the pull request with ‘git push --force’ - - - Open a pull request(1) that relates to but one subject with a clear - title and description in grammatically correct, complete sentences. - - Note: Pull requests *must* pass all tests on Travis CI before being - merged. - - ---------- Footnotes ---------- - - (1) https://help.github.com/articles/using-pull-requests - - -File: flycheck.info, Node: Testing Flycheck, Next: Writing documentation, Prev: Contribution guidelines, Up: Top - -13 Testing Flycheck -******************* - -Flycheck comes with a large unit test suite, which tests all syntax -checkers and large parts of Flychecks internal API and interactive -commands. - -This document explains how to use this test suite. - -* Menu: - -* Test suite layout:: -* Test running:: -* Virtual test environment:: -* Travis CI:: - - -File: flycheck.info, Node: Test suite layout, Next: Test running, Up: Testing Flycheck - -13.1 Test suite layout -====================== - -The library ‘flycheck-ert.el’ provides many extensions to ERT, generic -ones as well as specific utilities for testing Flycheck code and syntax -checkers. You may use this library to write test cases for your own -Flycheck extensions: It is part of the Flycheck package. - -All test code is contained in the ‘test/’ sub-directory, which has the -following contents: - - - ‘flycheck-test.el’: The actual unit test suite, that is, the test - cases plus some local utility functions and macros. - - - ‘resources/’: Resource files used by the test suite, including - example code in various programming languages to test syntax - checkers. - - - ‘run.el’: A simple test runner for non-interactive use, which reads - ERT selectors from the command line and runs all matching tests. - - -File: flycheck.info, Node: Test running, Next: Virtual test environment, Prev: Test suite layout, Up: Testing Flycheck - -13.2 Test running -================= - -First install Emacs Lisp dependencies using Cask(1): - - $ make deps - -Then install the syntax checkers that you’d like to test: - - $ brew install go - $ pip install --user pylint - $ npm install --global coffee coffee-lint jshint - $ cabal install hlint shellcheck - - Note: If you’d like to keep your environment clean, use the *note - Virtual test environment: 290. instead. - -Run the entire test suite: - - $ make test - - Note: Tests which can’t be run because of missing tools are - gracefully skipped. - -You may also run a specific subset of test cases by passing an ERT -selector expression. The following example runs all tests for C and -C++, except those whose name matches ‘gcc’: - - $ make ERTSELECTOR='(and (or (tag language-c) (tag language-c++)) (not "gcc"))' test - -See *note (ert)Test Selectors:: for the syntax of test selectors. - -You can also use a different Emacs to run the tests with: - - $ make EMACS=emacs-snapshot test - - Note: Keep in mind that you must quote the expression for your - shell _and_ for Emacs Lisp. - - ---------- Footnotes ---------- - - (1) http://cask.readthedocs.org - - -File: flycheck.info, Node: Virtual test environment, Next: Travis CI, Prev: Test running, Up: Testing Flycheck - -13.3 Virtual test environment -============================= - -To run all tests successfully, you need a large amount of external -tools. To keep your environment clean, and test against a reference -environment, Flycheck provides a virtual machine with a complete test -environment, based on VirtualBox and Vagrant. - -The virtual machine contains - - - The latest stable Emacs release - - - A nightly build of Emacs trunk - - - ‘make’ and Cask(1) - - - All syntax checkers supported by Flycheck - -To use this VM, first install the following tools on your system: - - - VirtualBox(2) - - - Vagrant(3) - - - Ansible(4) - -On Linux, these packages are typically available from the package -manager of your distribution. On OS X, use the binaries provided for -Vagrant and VirtualBox, and install Ansible from Homebrew(5) with ‘brew -install ansible’. - -To start the VM run the following command in the root directory of -Flycheck: - - $ vagrant up - - Warning: On the first time, this command will setup and provision - the VM, and *download and install over 1GB* of images and packages - along the way. Depending on your network connection and disk - speed, this can take an hour or more. - -After the VM is started, you can connect to it: - - $ vagrant ssh - -This will give you a bash prompt within the VM, on which you can run the -tests as explained in *note Test running: 28e. - -To switch between Emacs versions, pass ‘EMACS’ to ‘make test’: - - $ make EMACS=emacs24 test - $ make EMACS=emacs-snapshot test - -The latter is the default. - -When finished, you can shutdown the VM with: - - $ vagrant halt - -Occasionally you should provision the test environment again, to update -to the latest Emacs nightly build, and to follow updates of syntax -checker tools. To do so, use the ‘--provision’ flag when starting the -VM: - - $ vagrant up --provision - -You can also provision a running machine with: - - $ vagrant provision - -The VM is provisioned from Ansible playbooks in the ‘playbooks/’ -sub-directory of the top-level source directory. - - ---------- Footnotes ---------- - - (1) http://cask.readthedocs.org - - (2) https://www.virtualbox.org/ - - (3) https://www.vagrantup.com/ - - (4) http://www.ansible.com/home - - (5) http://brew.sh/ - - -File: flycheck.info, Node: Travis CI, Prev: Virtual test environment, Up: Testing Flycheck - -13.4 Travis CI -============== - -The entire test suite continuously runs on *note Travis CI: 293. after -every push, with the latest Emacs release and a nightly Emacs snapshot. - -Travis CI is configured from ‘.travis.yml’ in the top-level source -directory, and uses mostly the same playbooks for provisioning. - - Note: Travis CI is the *reference environment* for Flycheck’s test - suite. All tests *must pass* on Travis CI. - - In case Travis CI diverges from the *note VM: 290, Travis CI is - authoritative. - - -File: flycheck.info, Node: Writing documentation, Next: Maintenance tasks, Prev: Testing Flycheck, Up: Top - -14 Writing documentation -************************ - -This document explains how to edit and building the documentation of -Flycheck. - -* Menu: - -* Build environment setup:: -* Building HTML and Texinfo:: -* Verifying references:: - - -File: flycheck.info, Node: Build environment setup, Next: Building HTML and Texinfo, Up: Writing documentation - -14.1 Build environment setup -============================ - -Flycheck’s documentation is written using Sphinx(1) and -sphinxcontrib-emacs(2). To build the documentation locally, you need to -install these tools first. This section guides you through the process -of installing them. - -First make sure, that you have Python 2.7 and virtualenv(3) available. -To install virtualenv, use: - - $ pip install --user virtualenv - - Note: You probably need to install pip(4) first. It is available - in the package repositories of most Linux distributions, as - ‘python-pip’ or similar. If ‘pip’ is not available for your Linux - distribution, or if you are using OS X, please follow the - instructions to install pip(5). - -Then add ‘~/Library/Python/2.7/bin’ (on OS X) or ‘~/.local/bin’ (on -other Unix variants) to ‘$PATH’. - -Now create a virtual environment and install the requirements of the -documentation: - - $ mkdir -p ~/.virtualenvs - $ virtualenv -p python2.7 ~/.virtualenvs/cask - $ pip install -r doc/requirements.txt - -Now you are set up to build the documentation. - - ---------- Footnotes ---------- - - (1) http://sphinx-doc.org - - (2) http://sphinxcontrib-emacs.readthedocs.org/en/latest/ - - (3) http://virtualenv.readthedocs.org/en/latest/ - - (4) https://pip.pypa.io/ - - (5) https://pip.pypa.io/en/latest/installing.html - - -File: flycheck.info, Node: Building HTML and Texinfo, Next: Verifying references, Prev: Build environment setup, Up: Writing documentation - -14.2 Building HTML and Texinfo -============================== - -First, switch to the virtual environment you created in the *note Build -environment setup: 296, and make sure that the requirements are up to -date: - - $ source ~/.virtualenvs/cask/bin/activate - $ pip install -r doc/requirements.txt - -Now build the documentation: - - $ make html - $ make texinfo - -The HTML documentation is build to ‘build/doc/html/’, where you can -preview it. The Texinfo build goes to ‘doc/flycheck.texi’. - - Warning: Unlike the HTML output, the Texinfo output is _committed_ - to the repository, since it is needed by MELPA(1) to build an Info - manual for inclusion in the Flycheck packages. - - ---------- Footnotes ---------- - - (1) http://melpa.org/ - - -File: flycheck.info, Node: Verifying references, Prev: Building HTML and Texinfo, Up: Writing documentation - -14.3 Verifying references -========================= - -Sphinx emits warnings for internal references and cross-references to -Emacs Lisp symbols that could not be resolved. Your documentation -should build without any such warnings. - -You can additionally verify all external references with: - - $ source ~/.virtualenvs/cask/bin/activate - $ make linkcheck - - -File: flycheck.info, Node: Maintenance tasks, Next: GNU General Public License, Prev: Writing documentation, Up: Top - -15 Maintenance tasks -******************** - -This document explains various maintenance tasks for Flycheck, that -contributors have to perform under specific circumstances. - -* Menu: - -* Rebuilding the Texinfo:: -* Rasterized logo files:: - - -File: flycheck.info, Node: Rebuilding the Texinfo, Next: Rasterized logo files, Up: Maintenance tasks - -15.1 Rebuilding the Texinfo -=========================== - -Flycheck contains a Texinfo version of the documentation at -‘doc/flycheck.texi’, to allow MELPA(1) to build the Info manual for -Flycheck. - - Warning: Do *not* edit this file. It is generated automatically - from Flycheck’s documentation. - -When making changes to the documentation, you need to rebuild the -Texinfo version with, by following the *note instructions to build the -documentation: 298. - - ---------- Footnotes ---------- - - (1) http://melpa.org/ - - -File: flycheck.info, Node: Rasterized logo files, Prev: Rebuilding the Texinfo, Up: Maintenance tasks - -15.2 Rasterized logo files -========================== - -The source of the Flycheck logo is ‘flycheck.svg’. The documentation -contains rasterized versions of this logo at - - - ‘doc/images/logo.png’ (the logo shown in the documentation and the - README) - - - ‘doc/images/favicon.ico’ (the logo for use as favicon of the - documentation) - - Warning: Do *not* change these files directly. They are generated - automatically from the SVG source. - -When changing the Flycheck logo, you need to rebuild these files with: - - make images - -You need *convert* from ImageMagick(1) and Inkscape(2). Make sure that -‘inkscape’ is in ‘$PATH’, because ImageMagick’s own SVG renderer cannot -properly render the logo. - - ---------- Footnotes ---------- - - (1) http://www.imagemagick.org/ - - (2) https://www.inkscape.org/ - - -File: flycheck.info, Node: GNU General Public License, Next: GNU Free Documentation License, Prev: Maintenance tasks, Up: Top - -16 GNU General Public License -***************************** - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for - software and other kinds of works. - - The licenses for most software and other practical works are designed - to take away your freedom to share and change the works. By contrast, - the GNU General Public License is intended to guarantee your freedom to - share and change all versions of a program--to make sure it remains free - software for all its users. We, the Free Software Foundation, use the - GNU General Public License for most of our software; it applies also to - any other work released this way by its authors. You can apply it to - your programs, too. - - When we speak of free software, we are referring to freedom, not - price. Our General Public Licenses are designed to make sure that you - have the freedom to distribute copies of free software (and charge for - them if you wish), that you receive source code or can get it if you - want it, that you can change the software or use pieces of it in new - free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you - these rights or asking you to surrender the rights. Therefore, you have - certain responsibilities if you distribute copies of the software, or if - you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether - gratis or for a fee, you must pass on to the recipients the same - freedoms that you received. You must make sure that they, too, receive - or can get the source code. And you must show them these terms so they - know their rights. - - Developers that use the GNU GPL protect your rights with two steps: - (1) assert copyright on the software, and (2) offer you this License - giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains - that there is no warranty for this free software. For both users' and - authors' sake, the GPL requires that modified versions be marked as - changed, so that their problems will not be attributed erroneously to - authors of previous versions. - - Some devices are designed to deny users access to install or run - modified versions of the software inside them, although the manufacturer - can do so. This is fundamentally incompatible with the aim of - protecting users' freedom to change the software. The systematic - pattern of such abuse occurs in the area of products for individuals to - use, which is precisely where it is most unacceptable. Therefore, we - have designed this version of the GPL to prohibit the practice for those - products. If such problems arise substantially in other domains, we - stand ready to extend this provision to those domains in future versions - of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. - States should not allow patents to restrict development and use of - software on general-purpose computers, but in those that do, we wish to - avoid the special danger that patents applied to a free program could - make it effectively proprietary. To prevent this, the GPL assures that - patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and - modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of - works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this - License. Each licensee is addressed as "you". "Licensees" and - "recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work - in a fashion requiring copyright permission, other than the making of an - exact copy. The resulting work is called a "modified version" of the - earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based - on the Program. - - To "propagate" a work means to do anything with it that, without - permission, would make you directly or secondarily liable for - infringement under applicable copyright law, except executing it on a - computer or modifying a private copy. Propagation includes copying, - distribution (with or without modification), making available to the - public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other - parties to make or receive copies. Mere interaction with a user through - a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" - to the extent that it includes a convenient and prominently visible - feature that (1) displays an appropriate copyright notice, and (2) - tells the user that there is no warranty for the work (except to the - extent that warranties are provided), that licensees may convey the - work under this License, and how to view a copy of this License. If - the interface presents a list of user commands or options, such as a - menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work - for making modifications to it. "Object code" means any non-source - form of a work. - - A "Standard Interface" means an interface that either is an official - standard defined by a recognized standards body, or, in the case of - interfaces specified for a particular programming language, one that - is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other - than the work as a whole, that (a) is included in the normal form of - packaging a Major Component, but which is not part of that Major - Component, and (b) serves only to enable use of the work with that - Major Component, or to implement a Standard Interface for which an - implementation is available to the public in source code form. A - "Major Component", in this context, means a major essential component - (kernel, window system, and so on) of the specific operating system - (if any) on which the executable work runs, or a compiler used to - produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all - the source code needed to generate, install, and (for an executable - work) run the object code and to modify the work, including scripts to - control those activities. However, it does not include the work's - System Libraries, or general-purpose tools or generally available free - programs which are used unmodified in performing those activities but - which are not part of the work. For example, Corresponding Source - includes interface definition files associated with source files for - the work, and the source code for shared libraries and dynamically - linked subprograms that the work is specifically designed to require, - such as by intimate data communication or control flow between those - subprograms and other parts of the work. - - The Corresponding Source need not include anything that users - can regenerate automatically from other parts of the Corresponding - Source. - - The Corresponding Source for a work in source code form is that - same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of - copyright on the Program, and are irrevocable provided the stated - conditions are met. This License explicitly affirms your unlimited - permission to run the unmodified Program. The output from running a - covered work is covered by this License only if the output, given its - content, constitutes a covered work. This License acknowledges your - rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not - convey, without conditions so long as your license otherwise remains - in force. You may convey covered works to others for the sole purpose - of having them make modifications exclusively for you, or provide you - with facilities for running those works, provided that you comply with - the terms of this License in conveying all material for which you do - not control copyright. Those thus making or running the covered works - for you must do so exclusively on your behalf, under your direction - and control, on terms that prohibit them from making any copies of - your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under - the conditions stated below. Sublicensing is not allowed; section 10 - makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological - measure under any applicable law fulfilling obligations under article - 11 of the WIPO copyright treaty adopted on 20 December 1996, or - similar laws prohibiting or restricting circumvention of such - measures. - - When you convey a covered work, you waive any legal power to forbid - circumvention of technological measures to the extent such circumvention - is effected by exercising rights under this License with respect to - the covered work, and you disclaim any intention to limit operation or - modification of the work as a means of enforcing, against the work's - users, your or third parties' legal rights to forbid circumvention of - technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you - receive it, in any medium, provided that you conspicuously and - appropriately publish on each copy an appropriate copyright notice; - keep intact all notices stating that this License and any - non-permissive terms added in accord with section 7 apply to the code; - keep intact all notices of the absence of any warranty; and give all - recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, - and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to - produce it from the Program, in the form of source code under the - terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent - works, which are not by their nature extensions of the covered work, - and which are not combined with it such as to form a larger program, - in or on a volume of a storage or distribution medium, is called an - "aggregate" if the compilation and its resulting copyright are not - used to limit the access or legal rights of the compilation's users - beyond what the individual works permit. Inclusion of a covered work - in an aggregate does not cause this License to apply to the other - parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms - of sections 4 and 5, provided that you also convey the - machine-readable Corresponding Source under the terms of this License, - in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded - from the Corresponding Source as a System Library, need not be - included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any - tangible personal property which is normally used for personal, family, - or household purposes, or (2) anything designed or sold for incorporation - into a dwelling. In determining whether a product is a consumer product, - doubtful cases shall be resolved in favor of coverage. For a particular - product received by a particular user, "normally used" refers to a - typical or common use of that class of product, regardless of the status - of the particular user or of the way in which the particular user - actually uses, or expects or is expected to use, the product. A product - is a consumer product regardless of whether the product has substantial - commercial, industrial or non-consumer uses, unless such uses represent - the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, - procedures, authorization keys, or other information required to install - and execute modified versions of a covered work in that User Product from - a modified version of its Corresponding Source. The information must - suffice to ensure that the continued functioning of the modified object - code is in no case prevented or interfered with solely because - modification has been made. - - If you convey an object code work under this section in, or with, or - specifically for use in, a User Product, and the conveying occurs as - part of a transaction in which the right of possession and use of the - User Product is transferred to the recipient in perpetuity or for a - fixed term (regardless of how the transaction is characterized), the - Corresponding Source conveyed under this section must be accompanied - by the Installation Information. But this requirement does not apply - if neither you nor any third party retains the ability to install - modified object code on the User Product (for example, the work has - been installed in ROM). - - The requirement to provide Installation Information does not include a - requirement to continue to provide support service, warranty, or updates - for a work that has been modified or installed by the recipient, or for - the User Product in which it has been modified or installed. Access to a - network may be denied when the modification itself materially and - adversely affects the operation of the network or violates the rules and - protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, - in accord with this section must be in a format that is publicly - documented (and with an implementation available to the public in - source code form), and must require no special password or key for - unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this - License by making exceptions from one or more of its conditions. - Additional permissions that are applicable to the entire Program shall - be treated as though they were included in this License, to the extent - that they are valid under applicable law. If additional permissions - apply only to part of the Program, that part may be used separately - under those permissions, but the entire Program remains governed by - this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option - remove any additional permissions from that copy, or from any part of - it. (Additional permissions may be written to require their own - removal in certain cases when you modify the work.) You may place - additional permissions on material, added by you to a covered work, - for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you - add to a covered work, you may (if authorized by the copyright holders of - that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further - restrictions" within the meaning of section 10. If the Program as you - received it, or any part of it, contains a notice stating that it is - governed by this License along with a term that is a further - restriction, you may remove that term. If a license document contains - a further restriction but permits relicensing or conveying under this - License, you may add to a covered work material governed by the terms - of that license document, provided that the further restriction does - not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you - must place, in the relevant source files, a statement of the - additional terms that apply to those files, or a notice indicating - where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the - form of a separately written license, or stated as exceptions; - the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly - provided under this License. Any attempt otherwise to propagate or - modify it is void, and will automatically terminate your rights under - this License (including any patent licenses granted under the third - paragraph of section 11). - - 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, you do not qualify to receive new licenses for the same - material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or - run a copy of the Program. Ancillary propagation of a covered work - occurring solely as a consequence of using peer-to-peer transmission - to receive a copy likewise does not require acceptance. However, - nothing other than this License grants you permission to propagate or - modify any covered work. These actions infringe copyright if you do - not accept this License. Therefore, by modifying or propagating a - covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically - receives a license from the original licensors, to run, modify and - propagate that work, subject to this License. You are not responsible - for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an - organization, or substantially all assets of one, or subdividing an - organization, or merging organizations. If propagation of a covered - work results from an entity transaction, each party to that - transaction who receives a copy of the work also receives whatever - licenses to the work the party's predecessor in interest had or could - give under the previous paragraph, plus a right to possession of the - Corresponding Source of the work from the predecessor in interest, if - the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the - rights granted or affirmed under this License. For example, you may - not impose a license fee, royalty, or other charge for exercise of - rights granted under this License, and you may not initiate litigation - (including a cross-claim or counterclaim in a lawsuit) alleging that - any patent claim is infringed by making, using, selling, offering for - sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this - License of the Program or a work on which the Program is based. The - work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims - owned or controlled by the contributor, whether already acquired or - hereafter acquired, that would be infringed by some manner, permitted - by this License, of making, using, or selling its contributor version, - but do not include claims that would be infringed only as a - consequence of further modification of the contributor version. For - purposes of this definition, "control" includes the right to grant - patent sublicenses in a manner consistent with the requirements of - this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free - patent license under the contributor's essential patent claims, to - make, use, sell, offer for sale, import and otherwise run, modify and - propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express - agreement or commitment, however denominated, not to enforce a patent - (such as an express permission to practice a patent or covenant not to - sue for patent infringement). To "grant" such a patent license to a - party means to make such an agreement or commitment not to enforce a - patent against the party. - - If you convey a covered work, knowingly relying on a patent license, - and the Corresponding Source of the work is not available for anyone - to copy, free of charge and under the terms of this License, through a - publicly available network server or other readily accessible means, - then you must either (1) cause the Corresponding Source to be so - available, or (2) arrange to deprive yourself of the benefit of the - patent license for this particular work, or (3) arrange, in a manner - consistent with the requirements of this License, to extend the patent - license to downstream recipients. "Knowingly relying" means you have - actual knowledge that, but for the patent license, your conveying the - covered work in a country, or your recipient's use of the covered work - in a country, would infringe one or more identifiable patents in that - country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or - arrangement, you convey, or propagate by procuring conveyance of, a - covered work, and grant a patent license to some of the parties - receiving the covered work authorizing them to use, propagate, modify - or convey a specific copy of the covered work, then the patent license - you grant is automatically extended to all recipients of the covered - work and works based on it. - - A patent license is "discriminatory" if it does not include within - the scope of its coverage, prohibits the exercise of, or is - conditioned on the non-exercise of one or more of the rights that are - specifically granted under this License. You may not convey a covered - work if you are a party to an arrangement with a third party that is - in the business of distributing software, under which you make payment - to the third party based on the extent of your activity of conveying - the work, and under which the third party grants, to any of the - parties who would receive the covered work from you, a discriminatory - patent license (a) in connection with copies of the covered work - conveyed by you (or copies made from those copies), or (b) primarily - for and in connection with specific products or compilations that - contain the covered work, unless you entered into that arrangement, - or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting - any implied license or other defenses to infringement that may - otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or - otherwise) that contradict the conditions of this License, they do not - excuse you from the conditions of this License. If you cannot convey a - covered work so as to satisfy simultaneously your obligations under this - License and any other pertinent obligations, then as a consequence you may - not convey it at all. For example, if you agree to terms that obligate you - to collect a royalty for further conveying from those to whom you convey - the Program, the only way you could satisfy both those terms and this - License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have - permission to link or combine any covered work with a work licensed - under version 3 of the GNU Affero General Public License into a single - combined work, and to convey the resulting work. The terms of this - License will continue to apply to the part which is the covered work, - but the special requirements of the GNU Affero General Public License, - section 13, concerning interaction through a network will apply to the - combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of - the GNU General Public 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. - - Each version is given a distinguishing version number. If the - Program specifies that a certain numbered version of the GNU General - Public License "or any later version" applies to it, you have the - option of following the terms and conditions either of that numbered - version or of any later version published by the Free Software - Foundation. If the Program does not specify a version number of the - GNU General Public License, you may choose any version ever published - by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future - versions of the GNU General Public License can be used, that proxy's - public statement of acceptance of a version permanently authorizes you - to choose that version for the Program. - - Later license versions may give you additional or different - permissions. However, no additional obligations are imposed on any - author or copyright holder as a result of your choosing to follow a - later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY - APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT - HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY - OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, - THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM - IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF - ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING - WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS - THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY - GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE - USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF - DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD - PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), - EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF - SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided - above cannot be given local legal effect according to their terms, - reviewing courts shall apply local law that most closely approximates - an absolute waiver of all civil liability in connection with the - Program, unless a warranty or assumption of liability accompanies a - copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest - possible use to the public, the best way to achieve this is to make it - free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest - to attach them to the start of each source file to most effectively - state the exclusion of warranty; and each file should have at least - the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short - notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - - The hypothetical commands `show w' and `show c' should show the appropriate - parts of the General Public License. Of course, your program's commands - might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, - if any, to sign a "copyright disclaimer" for the program, if necessary. - For more information on this, and how to apply and follow the GNU GPL, see - . - - The GNU General Public License does not permit incorporating your program - into proprietary programs. If your program is a subroutine library, you - may consider it more useful to permit linking proprietary applications with - the library. If this is what you want to do, use the GNU Lesser General - Public License instead of this License. But first, please read - . - - -File: flycheck.info, Node: GNU Free Documentation License, Next: Index, Prev: GNU General Public License, Up: Top - -17 GNU Free Documentation License -********************************* - - - GNU Free Documentation License - Version 1.3, 3 November 2008 - - - Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - 0. PREAMBLE - - 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. - - - 1. APPLICABILITY AND DEFINITIONS - - 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. - - 2. VERBATIM COPYING - - 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. - - - 3. COPYING IN QUANTITY - - 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. - - - 4. MODIFICATIONS - - 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: - - A. Use in the Title Page (and on the covers, if any) a title distinct - from that of the Document, and from those of previous versions - (which should, if there were any, be listed in the History section - of the Document). You may use the same title as a previous version - if the original publisher of that version gives permission. - B. List on the Title Page, as authors, one or more persons or entities - responsible for authorship of the modifications in the Modified - Version, together with at least five of the principal authors of the - Document (all of its principal authors, if it has fewer than five), - unless they release you from this requirement. - C. State on the Title page the name of the publisher of the - Modified Version, as the publisher. - D. Preserve all the copyright notices of the Document. - E. Add an appropriate copyright notice for your modifications - adjacent to the other copyright notices. - F. Include, immediately after the copyright notices, a license notice - giving the public permission to use the Modified Version under the - terms of this License, in the form shown in the Addendum below. - G. Preserve in that license notice the full lists of Invariant Sections - and required Cover Texts given in the Document's license notice. - H. Include an unaltered copy of this License. - I. Preserve the section Entitled "History", Preserve its Title, and add - to it an item stating at least the title, year, new authors, and - publisher of the Modified Version as given on the Title Page. If - there is no section Entitled "History" in the Document, create one - stating the title, year, authors, and publisher of the Document as - given on its Title Page, then add an item describing the Modified - Version as stated in the previous sentence. - J. Preserve the network location, if any, given in the Document for - public access to a Transparent copy of the Document, and likewise - the network locations given in the Document for previous versions - it was based on. These may be placed in the "History" section. - You may omit a network location for a work that was published at - least four years before the Document itself, or if the original - publisher of the version it refers to gives permission. - K. For any section Entitled "Acknowledgements" or "Dedications", - Preserve the Title of the section, and preserve in the section all - the substance and tone of each of the contributor acknowledgements - and/or dedications given therein. - L. Preserve all the Invariant Sections of the Document, - unaltered in their text and in their titles. Section numbers - or the equivalent are not considered part of the section titles. - M. Delete any section Entitled "Endorsements". Such a section - may not be included in the Modified Version. - N. Do not retitle any existing section to be Entitled "Endorsements" - or to conflict in title with any Invariant Section. - O. Preserve any Warranty Disclaimers. - - 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. - - - 5. COMBINING DOCUMENTS - - 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". - - - 6. COLLECTIONS OF DOCUMENTS - - 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. - - - 7. AGGREGATION WITH INDEPENDENT WORKS - - 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. - - - 8. TRANSLATION - - 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. - - - 9. TERMINATION - - 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. - - - 10. FUTURE REVISIONS OF THIS LICENSE - - 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. - - 11. RELICENSING - - "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. - - - ADDENDUM: How to use this License for your documents - - 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. - - -File: flycheck.info, Node: Index, Prev: GNU Free Documentation License, Up: Top - -Index -***** - -[index] -* Menu: - -* ;auto; Emacs Lisp function: Error analysis. (line 20) -* ada-gnat; Emacs Lisp Flycheck syntax checker: Ada. (line 6) -* asciidoc; Emacs Lisp Flycheck syntax checker: AsciiDoc. (line 6) -* c/c++-clang; Emacs Lisp Flycheck syntax checker: C/C++. (line 6) -* c/c++-cppcheck; Emacs Lisp Flycheck syntax checker: C/C++. (line 375) -* c/c++-gcc; Emacs Lisp Flycheck syntax checker: C/C++. (line 209) -* cfengine; Emacs Lisp Flycheck syntax checker: CFEngine. (line 6) -* chaining: Glossary. (line 37) -* chef-foodcritic; Emacs Lisp Flycheck syntax checker: Chef. (line 11) -* coffee-coffeelint; Emacs Lisp Flycheck syntax checker: Coffeescript. - (line 20) -* coffee; Emacs Lisp Flycheck syntax checker: Coffeescript. (line 6) -* coq; Emacs Lisp Flycheck syntax checker: Coq. (line 6) -* css-csslint; Emacs Lisp Flycheck syntax checker: CSS. (line 6) -* d-dmd; Emacs Lisp Flycheck syntax checker: D. (line 6) -* disabled syntax checker: Glossary. (line 14) -* elixir; Emacs Lisp Flycheck syntax checker: Elixir. (line 6) -* emacs-lisp-checkdoc; Emacs Lisp Flycheck syntax checker: Emacs Lisp. - (line 98) -* emacs-lisp; Emacs Lisp Flycheck syntax checker: Emacs Lisp. (line 11) -* enabled syntax checker: Glossary. (line 20) -* erlang; Emacs Lisp Flycheck syntax checker: Erlang. (line 6) -* eruby-erubis; Emacs Lisp Flycheck syntax checker: ERuby. (line 6) -* flycheck-add-mode; Emacs Lisp function: Generic syntax checkers<2>. - (line 198) -* flycheck-add-next-checker; Emacs Lisp function: Generic syntax checkers<2>. - (line 208) -* flycheck-add-overlay; Emacs Lisp function: Error processing<2>. - (line 8) -* flycheck-after-syntax-check-hook; Emacs Lisp hook: Syntax checks. - (line 27) -* flycheck-before-syntax-check-hook; Emacs Lisp hook: Syntax checks. - (line 48) -* flycheck-buffer-saved-p; Emacs Lisp function: Predicates for syntax checkers. - (line 8) -* flycheck-buffer; Emacs Lisp command: Checking buffers. (line 75) -* flycheck-check-syntax-automatically; Emacs Lisp user option: Checking buffers. - (line 19) -* flycheck-checker-error-threshold; Emacs Lisp user option: Error reporting. - (line 18) -* flycheck-checker; Emacs Lisp variable: Selecting syntax checkers. - (line 155) -* flycheck-checkers; Emacs Lisp user option: Selecting syntax checkers. - (line 9) -* flycheck-chktexrc; Emacs Lisp user option: TeX/LaTeX. (line 20) -* flycheck-clang-args; Emacs Lisp user option: C/C++. (line 23) -* flycheck-clang-blocks; Emacs Lisp user option: C/C++. (line 35) -* flycheck-clang-definitions; Emacs Lisp user option: C/C++. (line 52) -* flycheck-clang-include-path; Emacs Lisp user option: C/C++. (line 69) -* flycheck-clang-includes; Emacs Lisp user option: C/C++. (line 86) -* flycheck-clang-language-standard; Emacs Lisp user option: C/C++. - (line 103) -* flycheck-clang-ms-extensions; Emacs Lisp user option: C/C++. - (line 120) -* flycheck-clang-no-exceptions; Emacs Lisp user option: C/C++. - (line 136) -* flycheck-clang-no-rtti; Emacs Lisp user option: C/C++. (line 152) -* flycheck-clang-standard-library; Emacs Lisp user option: C/C++. - (line 167) -* flycheck-clang-warnings; Emacs Lisp user option: C/C++. (line 187) -* flycheck-clear; Emacs Lisp command: Error reporting. (line 187) -* flycheck-coffeelintrc; Emacs Lisp user option: Coffeescript. - (line 31) -* flycheck-collapse-error-message-whitespace; Emacs Lisp function: Error filters. - (line 26) -* flycheck-compile; Emacs Lisp command: Finding the right error patterns. - (line 16) -* flycheck-completion-system; Emacs Lisp user option: Selecting syntax checkers. - (line 118) -* flycheck-copy-errors-as-kill; Emacs Lisp command: Copying killing errors. - (line 9) -* flycheck-count-errors; Emacs Lisp function: Error analysis. (line 8) -* flycheck-cppcheck-checks; Emacs Lisp user option: C/C++. (line 384) -* flycheck-cppcheck-inconclusive; Emacs Lisp user option: C/C++. - (line 406) -* flycheck-current-errors; Emacs Lisp variable: Errors. (line 9) -* flycheck-dedent-error-messages; Emacs Lisp function: Error filters. - (line 32) -* flycheck-def-args-var; Emacs Lisp macro: Options for command syntax checkers. - (line 23) -* flycheck-def-config-file-var; Emacs Lisp macro: Configuration files for command syntax checkers. - (line 9) -* flycheck-def-executable-var; Emacs Lisp macro: Command syntax checkers. - (line 87) -* flycheck-def-option-var; Emacs Lisp macro: Options for command syntax checkers. - (line 9) -* flycheck-define-checker; Emacs Lisp macro: Command syntax checkers. - (line 106) -* flycheck-define-command-checker; Emacs Lisp function: Command syntax checkers. - (line 11) -* flycheck-define-error-level; Emacs Lisp function: Error levels<2>. - (line 23) -* flycheck-define-generic-checker; Emacs Lisp function: Generic syntax checkers<2>. - (line 10) -* flycheck-dequalify-error-ids; Emacs Lisp function: Error filters. - (line 53) -* flycheck-describe-checker; Emacs Lisp command: Selecting syntax checkers. - (line 187) -* flycheck-disabled-checkers; Emacs Lisp user option: Selecting syntax checkers. - (line 34) -* flycheck-display-error-messages-unless-error-list; Emacs Lisp function: Error reporting. - (line 161) -* flycheck-display-error-messages; Emacs Lisp function: Error reporting. - (line 148) -* flycheck-display-errors-delay; Emacs Lisp user option: Error reporting. - (line 117) -* flycheck-display-errors-function; Emacs Lisp user option: Error reporting. - (line 133) -* flycheck-dmd-include-path; Emacs Lisp user option: D. (line 15) -* flycheck-emacs-lisp-initialize-packages; Emacs Lisp user option: Emacs Lisp. - (line 27) -* flycheck-emacs-lisp-load-path; Emacs Lisp user option: Emacs Lisp. - (line 46) -* flycheck-emacs-lisp-package-user-dir; Emacs Lisp user option: Emacs Lisp. - (line 74) -* flycheck-error-<; Emacs Lisp function: Errors. (line 169) -* flycheck-error-buffer; Emacs Lisp slot: Errors. (line 25) -* flycheck-error-checker; Emacs Lisp slot: Errors. (line 30) -* flycheck-error-column-region; Emacs Lisp function: Errors. (line 131) -* flycheck-error-column; Emacs Lisp slot: Errors. (line 42) -* flycheck-error-filename; Emacs Lisp slot: Errors. (line 34) -* flycheck-error-format; Emacs Lisp function: Errors. (line 162) -* flycheck-error-id; Emacs Lisp slot: Errors. (line 71) -* flycheck-error-level-<; Emacs Lisp function: Errors. (line 175) -* flycheck-error-level-p; Emacs Lisp function: Error levels<2>. - (line 63) -* flycheck-error-level; Emacs Lisp slot: Errors. (line 66) -* flycheck-error-line-region; Emacs Lisp function: Errors. (line 121) -* flycheck-error-line; Emacs Lisp slot: Errors. (line 38) -* flycheck-error-list-after-refresh-hook; Emacs Lisp hook: Listing errors. - (line 22) -* flycheck-error-list-checker-name; Emacs Lisp face: Listing errors. - (line 64) -* flycheck-error-list-column-number; Emacs Lisp face: Listing errors. - (line 57) -* flycheck-error-list-highlight; Emacs Lisp face: Listing errors. - (line 40) -* flycheck-error-list-line-number; Emacs Lisp face: Listing errors. - (line 50) -* flycheck-error-message; Emacs Lisp slot: Errors. (line 62) -* flycheck-error-new-at; Emacs Lisp function: Errors. (line 81) -* flycheck-error-new; Emacs Lisp function: Errors. (line 102) -* flycheck-error-parser; Emacs Lisp function: Error parsers. (line 23) -* flycheck-error-pos; Emacs Lisp function: Errors. (line 153) -* flycheck-error-thing-region; Emacs Lisp function: Errors. (line 141) -* flycheck-error-with-buffer; Emacs Lisp macro: Errors. (line 115) -* flycheck-error; Emacs Lisp CL struct: Errors. (line 20) -* flycheck-error; Emacs Lisp face: Error reporting. (line 72) -* flycheck-ert-at-nth-error; Emacs Lisp function: Writing assertions. - (line 52) -* flycheck-ert-buffer-sync; Emacs Lisp function: Invoking syntax checkers in test cases. - (line 6) -* flycheck-ert-check-gpg; Emacs Lisp function: Obtaining information about the environment. - (line 14) -* flycheck-ert-def-checker-test; Emacs Lisp macro: Defining test cases. - (line 9) -* flycheck-ert-ensure-clear; Emacs Lisp function: Invoking syntax checkers in test cases. - (line 10) -* flycheck-ert-extract-version-command; Emacs Lisp function: Obtaining information about the environment. - (line 18) -* flycheck-ert-initialize; Emacs Lisp function: Loading and initializing. - (line 19) -* flycheck-ert-locate-config-file; Emacs Lisp function: Accessing test resources. - (line 23) -* flycheck-ert-resource-filename; Emacs Lisp function: Accessing test resources. - (line 9) -* flycheck-ert-should-errors; Emacs Lisp function: Writing assertions. - (line 12) -* flycheck-ert-should-overlay; Emacs Lisp function: Writing assertions. - (line 6) -* flycheck-ert-should-syntax-check; Emacs Lisp function: Writing assertions. - (line 28) -* flycheck-ert-syntax-check-timed-out-p; Emacs Lisp function: Checking results of test cases. - (line 9) -* flycheck-ert-travis-ci-p; Emacs Lisp function: Obtaining information about the environment. - (line 10) -* flycheck-ert-user-error-type; Emacs Lisp constant: Obtaining information about the environment. - (line 6) -* flycheck-ert-with-env; Emacs Lisp macro: Scoping resource access. - (line 12) -* flycheck-ert-with-file-buffer; Emacs Lisp macro: Creating temporary buffers. - (line 14) -* flycheck-ert-with-global-mode; Emacs Lisp macro: Scoping resource access. - (line 23) -* flycheck-ert-with-help-buffer; Emacs Lisp macro: Scoping resource access. - (line 6) -* flycheck-ert-with-resource-buffer; Emacs Lisp macro: Accessing test resources. - (line 16) -* flycheck-ert-with-temp-buffer; Emacs Lisp macro: Creating temporary buffers. - (line 6) -* flycheck-eslint-rulesdir; Emacs Lisp user option: Javascript. - (line 32) -* flycheck-eslintrc; Emacs Lisp user option: Javascript. (line 56) -* flycheck-first-error; Emacs Lisp command: Navigating and jumping to errors. - (line 66) -* flycheck-flake8-error-level-alist; Emacs Lisp user option: Python. - (line 16) -* flycheck-flake8-maximum-complexity; Emacs Lisp user option: Python. - (line 41) -* flycheck-flake8-maximum-line-length; Emacs Lisp user option: Python. - (line 58) -* flycheck-flake8rc; Emacs Lisp user option: Python. (line 80) -* flycheck-fold-include-levels; Emacs Lisp function: Error filters. - (line 42) -* flycheck-fringe-error; Emacs Lisp face: Error reporting. (line 105) -* flycheck-fringe-info; Emacs Lisp face: Error reporting. (line 105) -* flycheck-fringe-warning; Emacs Lisp face: Error reporting. (line 105) -* flycheck-gcc-args; Emacs Lisp user option: C/C++. (line 226) -* flycheck-gcc-definitions; Emacs Lisp user option: C/C++. (line 238) -* flycheck-gcc-include-path; Emacs Lisp user option: C/C++. (line 255) -* flycheck-gcc-includes; Emacs Lisp user option: C/C++. (line 272) -* flycheck-gcc-language-standard; Emacs Lisp user option: C/C++. - (line 289) -* flycheck-gcc-no-exceptions; Emacs Lisp user option: C/C++. (line 306) -* flycheck-gcc-no-rtti; Emacs Lisp user option: C/C++. (line 322) -* flycheck-gcc-openmp; Emacs Lisp user option: C/C++. (line 337) -* flycheck-gcc-warnings; Emacs Lisp user option: C/C++. (line 353) -* flycheck-gfortran-args; Emacs Lisp user option: Fortran. (line 16) -* flycheck-gfortran-include-path; Emacs Lisp user option: Fortran. - (line 28) -* flycheck-gfortran-language-standard; Emacs Lisp user option: Fortran. - (line 45) -* flycheck-gfortran-layout; Emacs Lisp user option: Fortran. (line 62) -* flycheck-gfortran-warnings; Emacs Lisp user option: Fortran. - (line 82) -* flycheck-ghc-args; Emacs Lisp user option: Haskell. (line 23) -* flycheck-ghc-language-extensions; Emacs Lisp user option: Haskell. - (line 35) -* flycheck-ghc-no-user-package-database; Emacs Lisp user option: Haskell. - (line 52) -* flycheck-ghc-package-databases; Emacs Lisp user option: Haskell. - (line 68) -* flycheck-ghc-search-path; Emacs Lisp user option: Haskell. (line 85) -* flycheck-gjslintrc; Emacs Lisp user option: Javascript. (line 76) -* flycheck-gnat-args; Emacs Lisp user option: Ada. (line 16) -* flycheck-gnat-include-path; Emacs Lisp user option: Ada. (line 28) -* flycheck-gnat-language-standard; Emacs Lisp user option: Ada. - (line 45) -* flycheck-gnat-warnings; Emacs Lisp user option: Ada. (line 62) -* flycheck-go-vet-print-functions; Emacs Lisp user option: Go. - (line 72) -* flycheck-has-errors-p; Emacs Lisp function: Error analysis. (line 16) -* flycheck-has-max-errors-p; Emacs Lisp function: Error analysis. - (line 20) -* flycheck-highlighting-mode; Emacs Lisp user option: Error reporting. - (line 38) -* flycheck-idle-change-delay; Emacs Lisp user option: Checking buffers. - (line 55) -* flycheck-increment-error-columns; Emacs Lisp function: Error filters. - (line 19) -* flycheck-indication-mode; Emacs Lisp user option: Error reporting. - (line 89) -* flycheck-info; Emacs Lisp face: Error reporting. (line 72) -* flycheck-jshintrc; Emacs Lisp user option: Javascript. (line 15) -* flycheck-keymap-prefix; Emacs Lisp user option: Usage. (line 13) -* flycheck-last-status-change; Emacs Lisp variable: Flycheck buffer status. - (line 55) -* flycheck-lintr-caching; Emacs Lisp user option: R. (line 15) -* flycheck-lintr-linters; Emacs Lisp user option: R. (line 32) -* flycheck-list-errors; Emacs Lisp command: Listing errors. (line 9) -* flycheck-locate-config-file-functions; Emacs Lisp user option: Syntax checker configuration files. - (line 20) -* flycheck-locate-config-file; Emacs Lisp function: Configuration files for command syntax checkers. - (line 28) -* flycheck-mode-line-status-text; Emacs Lisp function: Flycheck buffer status. - (line 62) -* flycheck-mode-line; Emacs Lisp user option: Mode line reporting. - (line 44) -* flycheck-mode; Emacs Lisp command: Enabling syntax checking<2>. - (line 40) -* flycheck-mode; Emacs Lisp user option: Enabling syntax checking<2>. - (line 44) -* flycheck-navigation-minimum-level; Emacs Lisp user option: Navigating and jumping to errors. - (line 82) -* flycheck-next-error; Emacs Lisp command: Navigating and jumping to errors. - (line 48) -* flycheck-option-comma-separated-list; Emacs Lisp function: Options for command syntax checkers. - (line 44) -* flycheck-option-int; Emacs Lisp function: Options for command syntax checkers. - (line 37) -* flycheck-parse-checkstyle; Emacs Lisp function: Error parsers. - (line 10) -* flycheck-parse-with-patterns; Emacs Lisp function: Error parsing with regular expressions. - (line 39) -* flycheck-parse-xml-string; Emacs Lisp function: Error parsers. - (line 31) -* flycheck-perlcritic-severity; Emacs Lisp user option: Perl. (line 28) -* flycheck-phpcs-standard; Emacs Lisp user option: PHP. (line 63) -* flycheck-phpmd-rulesets; Emacs Lisp user option: PHP. (line 39) -* flycheck-previous-error; Emacs Lisp command: Navigating and jumping to errors. - (line 57) -* flycheck-process-error-functions; Emacs Lisp hook: Error processing<2>. - (line 6) -* flycheck-pylintrc; Emacs Lisp user option: Python. (line 99) -* flycheck-registered-checker-p; Emacs Lisp function: Generic syntax checkers<2>. - (line 188) -* flycheck-remove-error-ids; Emacs Lisp function: Error filters. - (line 65) -* flycheck-report-status; Emacs Lisp function: Flycheck buffer status. - (line 23) -* flycheck-rubocop-lint-only; Emacs Lisp user option: Ruby. (line 23) -* flycheck-rubocoprc; Emacs Lisp user option: Ruby. (line 42) -* flycheck-rubylintrc; Emacs Lisp user option: Ruby. (line 61) -* flycheck-rust-check-tests; Emacs Lisp user option: Rust. (line 17) -* flycheck-rust-crate-root; Emacs Lisp user option: Rust. (line 34) -* flycheck-rust-crate-type; Emacs Lisp user option: Rust. (line 54) -* flycheck-rust-library-path; Emacs Lisp user option: Rust. (line 67) -* flycheck-rx-to-string; Emacs Lisp function: Error parsing with regular expressions. - (line 12) -* flycheck-sanitize-errors; Emacs Lisp function: Error filters. - (line 9) -* flycheck-sass-compass; Emacs Lisp user option: Sass. (line 15) -* flycheck-scalastyle-jar; Emacs Lisp user option: Scala. (line 33) -* flycheck-scalastylerc; Emacs Lisp user option: Scala. (line 52) -* flycheck-scss-compass; Emacs Lisp user option: Scss. (line 15) -* flycheck-select-checker; Emacs Lisp command: Selecting syntax checkers. - (line 74) -* flycheck-set-checker-executable; Emacs Lisp command: Syntax checker executables. - (line 22) -* flycheck-shellcheck-excluded-warnings; Emacs Lisp user option: Shell script languages. - (line 81) -* flycheck-sphinx-warn-on-missing-references; Emacs Lisp user option: ReStructuredText. - (line 21) -* flycheck-standard-error-navigation; Emacs Lisp user option: Navigating and jumping to errors. - (line 21) -* flycheck-status-changed-functions; Emacs Lisp hook: Flycheck buffer status. - (line 6) -* flycheck-string-list-p; Emacs Lisp function: Utilities. (line 6) -* flycheck-substitute-argument; Emacs Lisp function: Command arguments. - (line 11) -* flycheck-symbol-list-p; Emacs Lisp function: Utilities. (line 10) -* flycheck-syntax-check-failed-hook; Emacs Lisp hook: Syntax checks. - (line 66) -* flycheck-temp-prefix; Emacs Lisp user option: Checking buffers. - (line 99) -* flycheck-tidyrc; Emacs Lisp user option: HTML. (line 15) -* flycheck-verify-setup; Emacs Lisp command: Checking buffers. - (line 86) -* flycheck-warning; Emacs Lisp face: Error reporting. (line 72) -* fortran-gfortran; Emacs Lisp Flycheck syntax checker: Fortran. - (line 6) -* global-flycheck-mode; Emacs Lisp command: Enabling syntax checking<2>. - (line 9) -* global-flycheck-mode; Emacs Lisp user option: Enabling syntax checking<2>. - (line 26) -* go-build; Emacs Lisp Flycheck syntax checker: Go. (line 93) -* go-errcheck; Emacs Lisp Flycheck syntax checker: Go. (line 121) -* go-gofmt; Emacs Lisp Flycheck syntax checker: Go. (line 6) -* go-golint; Emacs Lisp Flycheck syntax checker: Go. (line 32) -* go-test; Emacs Lisp Flycheck syntax checker: Go. (line 107) -* go-vet; Emacs Lisp Flycheck syntax checker: Go. (line 51) -* haml; Emacs Lisp Flycheck syntax checker: Haml. (line 6) -* handlebars; Emacs Lisp Flycheck syntax checker: Handlebars. (line 6) -* haskell-ghc; Emacs Lisp Flycheck syntax checker: Haskell. (line 6) -* haskell-hlint; Emacs Lisp Flycheck syntax checker: Haskell. (line 109) -* html-tidy; Emacs Lisp Flycheck syntax checker: HTML. (line 6) -* javascript-eslint; Emacs Lisp Flycheck syntax checker: Javascript. - (line 23) -* javascript-gjslint; Emacs Lisp Flycheck syntax checker: Javascript. - (line 67) -* javascript-jshint; Emacs Lisp Flycheck syntax checker: Javascript. - (line 6) -* json-jsonlint; Emacs Lisp Flycheck syntax checker: JSON. (line 6) -* less; Emacs Lisp Flycheck syntax checker: LESS. (line 6) -* lua; Emacs Lisp Flycheck syntax checker: Lua. (line 6) -* make; Emacs Lisp Flycheck syntax checker: Make. (line 6) -* perl-perlcritic; Emacs Lisp Flycheck syntax checker: Perl. (line 19) -* perl; Emacs Lisp Flycheck syntax checker: Perl. (line 6) -* php-phpcs; Emacs Lisp Flycheck syntax checker: PHP. (line 54) -* php-phpmd; Emacs Lisp Flycheck syntax checker: PHP. (line 23) -* php; Emacs Lisp Flycheck syntax checker: PHP. (line 6) -* puppet-lint; Emacs Lisp Flycheck syntax checker: Puppet. (line 20) -* puppet-parser; Emacs Lisp Flycheck syntax checker: Puppet. (line 6) -* python-flake8; Emacs Lisp Flycheck syntax checker: Python. (line 6) -* python-pycompile; Emacs Lisp Flycheck syntax checker: Python. - (line 107) -* python-pylint; Emacs Lisp Flycheck syntax checker: Python. (line 88) -* r-lintr; Emacs Lisp Flycheck syntax checker: R. (line 6) -* racket; Emacs Lisp Flycheck syntax checker: Racket. (line 6) -* registered syntax checker: Glossary. (line 9) -* rpm-rpmlint; Emacs Lisp Flycheck syntax checker: RPM SPEC. (line 6) -* rst-sphinx; Emacs Lisp Flycheck syntax checker: ReStructuredText. - (line 12) -* rst; Emacs Lisp Flycheck syntax checker: ReStructuredText. (line 6) -* ruby-jruby; Emacs Lisp Flycheck syntax checker: Ruby. (line 94) -* ruby-rubocop; Emacs Lisp Flycheck syntax checker: Ruby. (line 6) -* ruby-rubylint; Emacs Lisp Flycheck syntax checker: Ruby. (line 50) -* ruby; Emacs Lisp Flycheck syntax checker: Ruby. (line 72) -* rust; Emacs Lisp Flycheck syntax checker: Rust. (line 6) -* sass; Emacs Lisp Flycheck syntax checker: Sass. (line 6) -* scala-scalastyle; Emacs Lisp Flycheck syntax checker: Scala. - (line 20) -* scala; Emacs Lisp Flycheck syntax checker: Scala. (line 6) -* scss; Emacs Lisp Flycheck syntax checker: Scss. (line 6) -* sh-bash; Emacs Lisp Flycheck syntax checker: Shell script languages. - (line 6) -* sh-posix-bash; Emacs Lisp Flycheck syntax checker: Shell script languages. - (line 39) -* sh-posix-dash; Emacs Lisp Flycheck syntax checker: Shell script languages. - (line 20) -* sh-shellcheck; Emacs Lisp Flycheck syntax checker: Shell script languages. - (line 72) -* sh-zsh; Emacs Lisp Flycheck syntax checker: Shell script languages. - (line 58) -* slim; Emacs Lisp Flycheck syntax checker: Slim. (line 6) -* status-callback; Emacs Lisp function: Status callback protocol. - (line 10) -* suitable syntax checker: Glossary. (line 25) -* syntax checker: Glossary. (line 6) -* tex-chktex; Emacs Lisp Flycheck syntax checker: TeX/LaTeX. (line 11) -* tex-lacheck; Emacs Lisp Flycheck syntax checker: TeX/LaTeX. (line 28) -* texinfo; Emacs Lisp Flycheck syntax checker: Texinfo. (line 6) -* verilog-verilator; Emacs Lisp Flycheck syntax checker: Verilog. - (line 6) -* xml-xmllint; Emacs Lisp Flycheck syntax checker: XML. (line 12) -* xml-xmlstarlet; Emacs Lisp Flycheck syntax checker: XML. (line 6) -* yaml-jsyaml; Emacs Lisp Flycheck syntax checker: YAML. (line 6) -* yaml-ruby; Emacs Lisp Flycheck syntax checker: YAML. (line 12) - diff --git a/elpa/flycheck-20150703.359/dir b/elpa/flycheck-20150703.359/dir new file mode 100644 index 00000000..78c0b2c4 --- /dev/null +++ b/elpa/flycheck-20150703.359/dir @@ -0,0 +1,18 @@ +This is the file .../info/dir, which contains the +topmost node of the Info hierarchy, called (dir)Top. +The first time you invoke Info you start off looking at this node. + +File: dir, Node: Top This is the top of the INFO tree + + This (the Directory node) gives a menu of major topics. + Typing "q" exits, "?" lists all Info commands, "d" returns here, + "h" gives a primer for first-timers, + "mEmacs" visits the Emacs manual, etc. + + In Emacs, you can click mouse button 2 on a menu item or cross reference + to select it. + +* Menu: + +Emacs +* Flycheck: (flycheck). Modern on-the-fly syntax checking diff --git a/elpa/flycheck-20150703.359/fdl-1.3.info b/elpa/flycheck-20150703.359/fdl-1.3.info new file mode 100644 index 00000000..d0fd1fb5 --- /dev/null +++ b/elpa/flycheck-20150703.359/fdl-1.3.info @@ -0,0 +1,484 @@ +This is fdl-1.3.info, produced by makeinfo version 5.2 from +fdl-1.3.texi. + + Version 1.3, 3 November 2008 + + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + 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. + + 1. APPLICABILITY AND DEFINITIONS + + 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. + + 2. VERBATIM COPYING + + 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. + + 3. COPYING IN QUANTITY + + 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. + + 4. MODIFICATIONS + + 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: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled "History" in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + 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. + + 5. COMBINING DOCUMENTS + + 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." + + 6. COLLECTIONS OF DOCUMENTS + + 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. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + 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. + + 8. TRANSLATION + + 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. + + 9. TERMINATION + + 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. + + 10. FUTURE REVISIONS OF THIS LICENSE + + 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 + . + + 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. + + 11. RELICENSING + + "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. + +ADDENDUM: How to use this License for your documents +==================================================== + +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. + + + +Tag Table: + +End Tag Table diff --git a/elpa/flycheck-20150703.359/flycheck-autoloads.el b/elpa/flycheck-20150703.359/flycheck-autoloads.el new file mode 100644 index 00000000..b3a75a6e --- /dev/null +++ b/elpa/flycheck-20150703.359/flycheck-autoloads.el @@ -0,0 +1,222 @@ +;;; flycheck-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) + +;;;### (autoloads nil "flycheck" "flycheck.el" (21910 48941 0 0)) +;;; Generated autoloads from flycheck.el + +(autoload 'flycheck-info "flycheck" "\ +Open the Flycheck manual. + +\(fn)" t nil) + +(autoload 'flycheck-mode "flycheck" "\ +Minor mode for on-the-fly syntax checking. + +When called interactively, toggle `flycheck-mode'. With prefix +ARG, enable `flycheck-mode' if ARG is positive, otherwise disable +it. + +When called from Lisp, enable `flycheck-mode' if ARG is omitted, +nil or positive. If ARG is `toggle', toggle `flycheck-mode'. +Otherwise behave as if called interactively. + +In `flycheck-mode' the buffer is automatically syntax-checked +using the first suitable syntax checker from `flycheck-checkers'. +Use `flycheck-select-checker' to select a checker for the current +buffer manually. + +\\{flycheck-mode-map} + +\(fn &optional ARG)" t nil) + +(defvar global-flycheck-mode nil "\ +Non-nil if Global-Flycheck mode is enabled. +See the command `global-flycheck-mode' for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `global-flycheck-mode'.") + +(custom-autoload 'global-flycheck-mode "flycheck" nil) + +(autoload 'global-flycheck-mode "flycheck" "\ +Toggle Flycheck mode in all buffers. +With prefix ARG, enable Global-Flycheck mode if ARG is positive; +otherwise, disable it. If called from Lisp, enable the mode if +ARG is omitted or nil. + +Flycheck mode is enabled in all buffers where +`flycheck-mode-on-safe' would do it. +See `flycheck-mode' for more information on Flycheck mode. + +\(fn &optional ARG)" t nil) + +(autoload 'flycheck-define-error-level "flycheck" "\ +Define a new error LEVEL with PROPERTIES. + +The following PROPERTIES constitute an error level: + +`:severity SEVERITY' + A number denoting the severity of this level. The higher + the number, the more severe is this level compared to other + levels. Defaults to 0. + + The severity is used by `flycheck-error-level-<' to + determine the ordering of errors according to their levels. + +`:overlay-category CATEGORY' + A symbol denoting the overlay category to use for error + highlight overlays for this level. See Info + node `(elisp)Overlay Properties' for more information about + overlay categories. + + A category for an error level overlay should at least define + the `face' property, for error highlighting. Other useful + properties for error level categories are `priority' to + influence the stacking of multiple error level overlays, and + `help-echo' to define a default error messages for errors + without messages. + +`:fringe-bitmap BITMAP' + A fringe bitmap symbol denoting the bitmap to use for fringe + indicators for this level. See Info node `(elisp)Fringe + Bitmaps' for more information about fringe bitmaps, + including a list of built-in fringe bitmaps. + +`:fringe-face FACE' + A face symbol denoting the face to use for fringe indicators + for this level. + +`:error-list-face FACE' + A face symbol denoting the face to use for messages of this + level in the error list. See `flycheck-list-errors'. + +\(fn LEVEL &rest PROPERTIES)" nil nil) + +(put 'flycheck-define-error-level 'lisp-indent-function '1) + +(autoload 'flycheck-define-command-checker "flycheck" "\ +Define SYMBOL as syntax checker which runs a command. + +Define SYMBOL as generic syntax checker via +`flycheck-define-generic-checker', which uses an external command +to check the buffer. SYMBOL and DOCSTRING are the same as for +`flycheck-define-generic-checker'. + +In addition to the properties understood by +`flycheck-define-generic-checker', the following PROPERTIES +constitute a command syntax checker. Unless otherwise noted, all +properties are mandatory. Note that the default `:error-filter' +of command checkers is `flycheck-sanitize-errors'. + +`:command COMMAND' + The command to run for syntax checking. + + COMMAND is a list of the form `(EXECUTABLE [ARG ...])'. + + EXECUTABLE is a string with the executable of this syntax + checker. It can be overridden with the variable + `flycheck-SYMBOL-executable'. Note that this variable is + NOT implicitly defined by this function. Use + `flycheck-def-executable-var' to define this variable. + + Each ARG is an argument to the executable, either as string, + or as special symbol or form for + `flycheck-substitute-argument', which see. + +`:error-patterns PATTERNS' + A list of patterns to parse the output of the `:command'. + + Each ITEM in PATTERNS is a list `(LEVEL SEXP ...)', where + LEVEL is a Flycheck error level (see + `flycheck-define-error-level'), followed by one or more RX + `SEXP's which parse an error of that level and extract line, + column, file name and the message. + + See `rx' for general information about RX, and + `flycheck-rx-to-string' for some special RX forms provided + by Flycheck. + + All patterns are applied in the order of declaration to the + whole output of the syntax checker. Output already matched + by a pattern will not be matched by subsequent patterns. In + other words, the first pattern wins. + + This property is optional. If omitted, however, an + `:error-parser' is mandatory. + +`:error-parser FUNCTION' + A function to parse errors with. + + The function shall accept three arguments OUTPUT CHECKER + BUFFER. OUTPUT is the syntax checker output as string, + CHECKER the syntax checker that was used, and BUFFER a + buffer object representing the checked buffer. The function + must return a list of `flycheck-error' objects parsed from + OUTPUT. + + This property is optional. If omitted, it defaults to + `flycheck-parse-with-patterns'. In this case, + `:error-patterns' is mandatory. + +Note that you may not give `:start', `:interrupt', and +`:print-doc' for a command checker. You can give a custom +`:verify' function, but you should take care to call +`flycheck-verify-command-checker' in a custom `:verify' +function. + +\(fn SYMBOL DOCSTRING &rest PROPERTIES)" nil nil) + +(put 'flycheck-define-command-checker 'lisp-indent-function '1) + +(put 'flycheck-define-command-checker 'doc-string-elt '2) + +(autoload 'flycheck-def-config-file-var "flycheck" "\ +Define SYMBOL as config file variable for CHECKER, with default FILE-NAME. + +SYMBOL is declared as customizable variable using `defcustom', to +provide a configuration file for the given syntax CHECKER. +CUSTOM-ARGS are forwarded to `defcustom'. + +FILE-NAME is the initial value of the new variable. If omitted, +the default value is nil. + +Use this together with the `config-file' form in the `:command' +argument to `flycheck-define-checker'. + +\(fn SYMBOL CHECKER &optional FILE-NAME &rest CUSTOM-ARGS)" nil t) + +(put 'flycheck-def-config-file-var 'lisp-indent-function '3) + +(autoload 'flycheck-def-option-var "flycheck" "\ +Define SYMBOL as option variable with INIT-VALUE for CHECKER. + +SYMBOL is declared as customizable variable using `defcustom', to +provide an option for the given syntax CHECKER. INIT-VALUE is +the initial value of the variable, and DOCSTRING is its +docstring. CUSTOM-ARGS are forwarded to `defcustom'. + +Use this together with the `option', `option-list' and +`option-flag' forms in the `:command' argument to +`flycheck-define-checker'. + +\(fn SYMBOL INIT-VALUE CHECKER DOCSTRING &rest CUSTOM-ARGS)" nil t) + +(put 'flycheck-def-option-var 'lisp-indent-function '3) + +(put 'flycheck-def-option-var 'doc-string-elt '4) + +;;;*** + +;;;### (autoloads nil nil ("flycheck-ert.el" "flycheck-pkg.el") (21910 +;;;;;; 48941 793934 0)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; flycheck-autoloads.el ends here diff --git a/elpa/flycheck-20150703.359/flycheck-ert.el b/elpa/flycheck-20150703.359/flycheck-ert.el new file mode 100644 index 00000000..9d1b8c1b --- /dev/null +++ b/elpa/flycheck-20150703.359/flycheck-ert.el @@ -0,0 +1,470 @@ +;;; flycheck-ert.el --- Flycheck: ERT extensions -*- lexical-binding: t; -*- + +;; Copyright (C) 2013-2015 Sebastian Wiesner and Flycheck contributors + +;; Author: Sebastian Wiesner +;; Maintainer: Sebastian Wiesner +;; URL: https://github.com/flycheck/flycheck + +;; This file is not part of GNU Emacs. + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Unit testing library for Flycheck, the modern on-the-fly syntax checking +;; extension for GNU Emacs. + +;; Provide various utility functions and unit test helpers to test Flycheck and +;; Flycheck extensions. + +;;; Code: + +(require 'flycheck) +(require 'ert) +(require 'macroexp) ; For macro utilities + + +;;; Compatibility + +(eval-and-compile + ;; Provide `ert-skip' and friends for Emacs 24.3 + (defconst flycheck-ert-ert-can-skip (fboundp 'ert-skip) + "Whether ERT supports test skipping.") + + (unless flycheck-ert-ert-can-skip + ;; Fake skipping + + (put 'flycheck-ert-skipped 'error-message "Test skipped") + (put 'flycheck-ert-skipped 'error-conditions '(error)) + + (defun ert-skip (data) + (signal 'flycheck-ert-skipped data)) + + (defmacro skip-unless (form) + `(unless (ignore-errors ,form) + (signal 'flycheck-ert-skipped ',form))) + + (defun ert-test-skipped-p (result) + (and (ert-test-failed-p result) + (eq (car (ert-test-failed-condition result)) + 'flycheck-ert-skipped))))) + + +;;; Internal variables + +(defvar flycheck-ert--resource-directory nil + "The directory to get resources from in this test suite.") + + +;;; Resource management macros + +(defmacro flycheck-ert-with-temp-buffer (&rest body) + "Eval BODY within a temporary buffer. + +Like `with-temp-buffer', but resets the modification state of the +temporary buffer to make sure that it is properly killed even if +it has a backing file and is modified." + (declare (indent 0)) + `(with-temp-buffer + (unwind-protect + ,(macroexp-progn body) + ;; Reset modification state of the buffer, and unlink it from its backing + ;; file, if any, because Emacs refuses to kill modified buffers with + ;; backing files, even if they are temporary. + (set-buffer-modified-p nil) + (set-visited-file-name nil 'no-query)))) + +(defmacro flycheck-ert-with-file-buffer (file-name &rest body) + "Create a buffer from FILE-NAME and eval BODY. + +BODY is evaluated with `current-buffer' being a buffer with the +contents FILE-NAME." + (declare (indent 1)) + `(let ((file-name ,file-name)) + (unless (file-exists-p file-name) + (error "%s does not exist" file-name)) + (flycheck-ert-with-temp-buffer + (insert-file-contents file-name 'visit) + (set-visited-file-name file-name 'no-query) + (cd (file-name-directory file-name)) + ;; Mark the buffer as not modified, because we just loaded the file up to + ;; now. + (set-buffer-modified-p nil) + ,@body))) + +(defmacro flycheck-ert-with-help-buffer (&rest body) + "Execute BODY and kill the help buffer afterwards. + +Use this macro to test functions that create a Help buffer." + (declare (indent 0)) + `(unwind-protect + ,(macroexp-progn body) + (when (buffer-live-p (get-buffer (help-buffer))) + (kill-buffer (help-buffer))))) + +(defmacro flycheck-ert-with-global-mode (&rest body) + "Execute BODY with Global Flycheck Mode enabled. + +After BODY, restore the old state of Global Flycheck Mode." + (declare (indent 0)) + `(let ((old-state global-flycheck-mode)) + (unwind-protect + (progn + (global-flycheck-mode 1) + ,@body) + (global-flycheck-mode (if old-state 1 -1))))) + +(defmacro flycheck-ert-with-env (env &rest body) + "Add ENV to `process-environment' in BODY. + +Execute BODY with a `process-environment' with contains all +variables from ENV added. + +ENV is an alist, where each cons cell `(VAR . VALUE)' is a +environment variable VAR to be added to `process-environment' +with VALUE." + (declare (indent 1)) + `(let ((process-environment (copy-sequence process-environment))) + (pcase-dolist (`(,var . ,value) ,env) + (setenv var value)) + ,@body)) + + +;;; Test resources +(defun flycheck-ert-resource-filename (resource-file) + "Determine the absolute file name of a RESOURCE-FILE. + +Relative file names are expanded against +`flycheck-ert-resources-directory'." + (expand-file-name resource-file flycheck-ert--resource-directory)) + +(defmacro flycheck-ert-with-resource-buffer (resource-file &rest body) + "Create a temp buffer from a RESOURCE-FILE and execute BODY. + +The absolute file name of RESOURCE-FILE is determined with +`flycheck-ert-resource-filename'." + (declare (indent 1)) + `(flycheck-ert-with-file-buffer + (flycheck-ert-resource-filename ,resource-file) + ,@body)) + +(defun flycheck-ert-locate-config-file (filename _checker) + "Find a configuration FILENAME within unit tests. + +_CHECKER is ignored." + (let* ((directory (flycheck-ert-resource-filename "config-files")) + (filepath (expand-file-name filename directory))) + (when (file-exists-p filepath) + filepath))) + + +;;; Test suite initialization + +(defun flycheck-ert-initialize (resource-dir) + "Initialize a test suite with RESOURCE-DIR. + +RESOURCE-DIR is the directory, `flycheck-ert-resource-filename' +should use to lookup resource files." + (when flycheck-ert--resource-directory + (error "Test suite already initialized")) + (let ((tests (ert-select-tests t t))) + ;; Select all tests + (unless tests + (error "No tests defined. Call `flycheck-ert-initialize' after defining all tests!")) + + (setq flycheck-ert--resource-directory resource-dir) + + ;; Emacs 24.3 don't support skipped tests, so we add poor man's test + ;; skipping: We mark skipped tests as expected failures by adjusting the + ;; expected result of all test cases. Not particularly pretty, but works :) + (unless flycheck-ert-ert-can-skip + (dolist (test tests) + (let ((result (ert-test-expected-result-type test))) + (setf (ert-test-expected-result-type test) + `(or ,result (satisfies ert-test-skipped-p)))))))) + + +;;; Environment and version information + +(defconst flycheck-ert-user-error-type + (if (version< emacs-version "24.2") + 'error + 'user-error) + "The `user-error' type used by Flycheck.") + +(defun flycheck-ert-travis-ci-p () + "Determine whether we are running on Travis CI." + (string= (getenv "TRAVIS") "true")) + +(defun flycheck-ert-check-gpg () + "Check whether GPG is available." + (or (epg-check-configuration (epg-configuration)) t)) + +(defun flycheck-ert-extract-version-command (re executable &rest args) + "Use RE to extract the version from EXECUTABLE with ARGS. + +Run EXECUTABLE with ARGS, catch the output, and apply RE to find +the version number. Return the text captured by the first group +in RE, or nil, if EXECUTABLE is missing, or if RE failed to +match." + (-when-let (executable (executable-find executable)) + (with-temp-buffer + (apply #'call-process executable nil t nil args) + (goto-char (point-min)) + (when (re-search-forward re nil 'no-error) + (match-string 1))))) + + +;;; Test case definitions +(defmacro flycheck-ert-def-checker-test (checker language name + &rest keys-and-body) + "Define a test case for a syntax CHECKER for LANGUAGE. + +CHECKER is a symbol or a list of symbols denoting syntax checkers +being tested by the test. The test case is skipped, if any of +these checkers cannot be used. LANGUAGE is a symbol or a list of +symbols denoting the programming languages supported by the +syntax checkers. This is currently only used for tagging the +test appropriately. + +NAME is a symbol denoting the local name of the test. The test +itself is ultimately named +`flycheck-define-checker/CHECKER/NAME'. If CHECKER is a list, +the first checker in the list is used for naming the test. + +Optionally, the keyword arguments `:tags' and `:expected-result' +may be given. They have the same meaning as in `ert-deftest.', +and are added to the tags and result expectations set up by this +macro. + +The remaining forms denote the body of the test case, including +assertions and setup code." + (declare (indent 3)) + (unless checker + (error "No syntax checkers specified.")) + (unless language + (error "No languages specified")) + (let* ((checkers (if (symbolp checker) (list checker) checker)) + (checker (car checkers)) + (languages (if (symbolp language) (list language) language)) + (language-tags (mapcar (lambda (l) (intern (format "language-%s" l))) + languages)) + (checker-tags (mapcar (lambda (c) (intern (format "checker-%s" c))) + checkers)) + (local-name (or name 'default)) + (full-name (intern (format "flycheck-define-checker/%s/%s" + checker local-name))) + (keys-and-body (ert--parse-keys-and-body keys-and-body)) + (body (cadr keys-and-body)) + (keys (car keys-and-body)) + (default-tags '(syntax-checker external-tool))) + `(ert-deftest ,full-name () + :expected-result + (list 'or + '(satisfies flycheck-ert-syntax-check-timed-out-p) + ,(or (plist-get keys :expected-result) :passed)) + :tags (append ',(append default-tags language-tags checker-tags) + ,(plist-get keys :tags)) + ,@(mapcar (lambda (c) `(skip-unless + ;; Ignore non-command checkers + (or (not (get ',c 'flycheck-command)) + (executable-find (flycheck-checker-executable ',c))))) + checkers) + ,@body))) + + +;;; Test case results + +(defun flycheck-ert-syntax-check-timed-out-p (result) + "Whether RESULT denotes a timed-out test. + +RESULT is an ERT test result object." + (and (ert-test-failed-p result) + (eq (car (ert-test-failed-condition result)) + 'flycheck-ert-syntax-check-timed-out))) + + +;;; Syntax checking in tests + +(defvar-local flycheck-ert-syntax-checker-finished nil + "Non-nil if the current checker has finished.") + +(add-hook 'flycheck-after-syntax-check-hook + (lambda () (setq flycheck-ert-syntax-checker-finished t))) + +(defconst flycheck-ert-checker-wait-time 10 + "Time to wait until a checker is finished in seconds. + +After this time has elapsed, the checker is considered to have +failed, and the test aborted with failure.") + +(put 'flycheck-ert-syntax-check-timed-out 'error-message + "Syntax check timed out.") +(put 'flycheck-ert-syntax-check-timed-out 'error-conditions '(error)) + +(defun flycheck-ert-wait-for-syntax-checker () + "Wait until the syntax check in the current buffer is finished." + (let ((starttime (float-time))) + (while (and (not flycheck-ert-syntax-checker-finished) + (< (- (float-time) starttime) flycheck-ert-checker-wait-time)) + (sleep-for 1)) + (unless (< (- (float-time) starttime) flycheck-ert-checker-wait-time) + (flycheck-stop) + (signal 'flycheck-ert-syntax-check-timed-out nil))) + (setq flycheck-ert-syntax-checker-finished nil)) + +(defun flycheck-ert-buffer-sync () + "Like `flycheck-buffer', but synchronously." + (setq flycheck-ert-syntax-checker-finished nil) + (should (not (flycheck-running-p))) + (flycheck-mode) ; This will only start a deferred check, + (flycheck-buffer) ; so we need an explicit manual check + ;; After starting the check, the checker should either be running now, or + ;; already be finished (if it was fast). + (should (or flycheck-current-syntax-check + flycheck-ert-syntax-checker-finished)) + ;; Also there should be no deferred check pending anymore + (should-not (flycheck-deferred-check-p)) + (flycheck-ert-wait-for-syntax-checker)) + +(defun flycheck-ert-ensure-clear () + "Clear the current buffer. + +Raise an assertion error if the buffer is not clear afterwards." + (flycheck-clear) + (should (not flycheck-current-errors)) + (should (not (-any? (lambda (ov) (overlay-get ov 'flycheck-overlay)) + (overlays-in (point-min) (point-max)))))) + + +;;; Test assertions + +(defun flycheck-ert-should-overlay (error) + "Test that ERROR has a proper overlay in the current buffer. + +ERROR is a Flycheck error object." + (let* ((overlay (-first (lambda (ov) (equal (overlay-get ov 'flycheck-error) + error)) + (flycheck-overlays-in 0 (+ 1 (buffer-size))))) + (region (flycheck-error-region-for-mode error 'symbols)) + (message (flycheck-error-message error)) + (level (flycheck-error-level error)) + (category (flycheck-error-level-overlay-category level)) + (face (get category 'face)) + (fringe-bitmap (flycheck-error-level-fringe-bitmap level)) + (fringe-face (flycheck-error-level-fringe-face level)) + (fringe-icon (list 'left-fringe fringe-bitmap fringe-face))) + (should overlay) + (should (overlay-get overlay 'flycheck-overlay)) + (should (= (overlay-start overlay) (car region))) + (should (= (overlay-end overlay) (cdr region))) + (should (eq (overlay-get overlay 'face) face)) + (should (equal (get-char-property 0 'display + (overlay-get overlay 'before-string)) + fringe-icon)) + (should (eq (overlay-get overlay 'category) category)) + (should (equal (overlay-get overlay 'flycheck-error) error)) + (should (string= (overlay-get overlay 'help-echo) message)))) + +(defun flycheck-ert-should-errors (&rest errors) + "Test that the current buffers has ERRORS. + +ERRORS is a list of errors expected to be present in the current +buffer. Each error is given as a list of arguments to +`flycheck-error-new-at'. + +If ERRORS are omitted, test that there are no errors at all in +the current buffer. + +With ERRORS, test that each error in ERRORS is present in the +current buffer, and that the number of errors in the current +buffer is equal to the number of given ERRORS. In other words, +check that the buffer has all ERRORS, and no other errors." + (let ((expected (mapcar (apply-partially #'apply #'flycheck-error-new-at) + errors))) + (should (equal expected flycheck-current-errors)) + (mapc #'flycheck-ert-should-overlay expected)) + (should (= (length errors) + (length (flycheck-overlays-in (point-min) (point-max)))))) + +(defun flycheck-ert-should-syntax-check (resource-file modes &rest errors) + "Test a syntax check in RESOURCE-FILE with MODES. + +RESOURCE-FILE is the file to check. MODES is a single major mode +symbol or a list thereof, specifying the major modes to syntax +check with. If more than one major mode is specified, the test +is run for each mode separately, so if you give three major +modes, the entire test will run three times. ERRORS is the list +of expected errors, as in `flycheck-ert-should-errors'. If +omitted, the syntax check must not emit any errors. The errors +are cleared after each test. + +The syntax checker is selected via standard syntax checker +selection. To test a specific checker, you need to set +`flycheck-checker' or `flycheck-disabled-checkers' accordingly +before using this predicate, depending on whether you want to use +manual or automatic checker selection. + +During the syntax check, configuration files of syntax checkers +are also searched in the `config-files' sub-directory of the +resource directory." + (when (symbolp modes) + (setq modes (list modes))) + (dolist (mode modes) + (unless (fboundp mode) + (ert-skip (format "%S missing" mode))) + (flycheck-ert-with-resource-buffer resource-file + (funcall mode) + ;; Configure config file locating for unit tests + (dolist (fn '(flycheck-locate-config-file-absolute-path + flycheck-ert-locate-config-file)) + (add-hook 'flycheck-locate-config-file-functions fn 'append 'local)) + (let ((process-hook-called 0)) + (add-hook 'flycheck-process-error-functions + (lambda (_err) + (setq process-hook-called (1+ process-hook-called)) + nil) + nil :local) + (flycheck-ert-buffer-sync) + (apply #'flycheck-ert-should-errors errors) + (should (= process-hook-called (length errors)))) + (flycheck-ert-ensure-clear)))) + +(defun flycheck-ert-at-nth-error (n) + "Determine whether point is at the N'th Flycheck error. + +Return non-nil if the point is at the N'th Flycheck error in the +current buffer. Otherwise return nil." + (let* ((error (nth (1- n) flycheck-current-errors)) + (mode flycheck-highlighting-mode) + (region (flycheck-error-region-for-mode error mode))) + (and (member error (flycheck-overlay-errors-at (point))) + (= (point) (car region))))) + +(defun flycheck-ert-explain--at-nth-error (n) + (let ((errors (flycheck-overlay-errors-at (point)))) + (if (null errors) + (format "Expected to be at error %s, but no error at point %s" + n (point)) + (let ((pos (cl-position (car errors) flycheck-current-errors))) + (format "Expected to be at error %s, but point %s is at error %s" + n (point) (1+ pos)))))) + +(put 'flycheck-ert-at-nth-error 'ert-explainer + 'flycheck-ert-explain--at-nth-error) + +(provide 'flycheck-ert) + +;;; flycheck-ert.el ends here diff --git a/elpa/flycheck-20150703.359/flycheck-pkg.el b/elpa/flycheck-20150703.359/flycheck-pkg.el new file mode 100644 index 00000000..fb2c668e --- /dev/null +++ b/elpa/flycheck-20150703.359/flycheck-pkg.el @@ -0,0 +1,11 @@ +(define-package "flycheck" "20150703.359" "On-the-fly syntax checking" + '((dash "2.4.0") + (pkg-info "0.4") + (let-alist "1.0.1") + (cl-lib "0.3") + (emacs "24.1")) + :url "https://www.flycheck.org" :keywords + '("convenience" "languages" "tools")) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/flycheck-20150703.359/flycheck.el b/elpa/flycheck-20150703.359/flycheck.el new file mode 100644 index 00000000..1809cfba --- /dev/null +++ b/elpa/flycheck-20150703.359/flycheck.el @@ -0,0 +1,7520 @@ +;;; flycheck.el --- On-the-fly syntax checking -*- lexical-binding: t; -*- + +;; Copyright (c) 2012-2015 Sebastian Wiesner and Flycheck contributors +;; Copyright (C) 2013, 2014 Free Software Foundation, Inc. +;; +;; Author: Sebastian Wiesner +;; Maintainer: Sebastian Wiesner +;; URL: https://www.flycheck.org +;; Keywords: convenience, languages, tools +;; Version: 0.24-cvs +;; Package-Requires: ((dash "2.4.0") (pkg-info "0.4") (let-alist "1.0.1") (cl-lib "0.3") (emacs "24.1")) + +;; This file is not part of GNU Emacs. + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; On-the-fly syntax checking for GNU Emacs 24. +;; +;; This package provides on-the-fly syntax checking for GNU Emacs 24. It is a +;; replacement for the older Flymake extension which is part of GNU Emacs, with +;; many improvements and additional features. +;; +;; Flycheck provides fully-automatic, fail-safe, on-the-fly background syntax +;; checking for over 30 programming and markup languages with more than 70 +;; different tools. It highlights errors and warnings inline in the buffer, and +;; provides an optional IDE-like error list. +;; +;; It comes with a rich interface for custom syntax checkers and other +;; extensions, and has already many 3rd party extensions adding new features. +;; +;; # Setup +;; +;; Flycheck works best on Unix systems. It does not officially support Windows, +;; but tries to maintain Windows compatibility and should generally work fine on +;; Windows, too. +;; +;; To enable Flycheck add the following to your init file: +;; +;; (add-hook 'after-init-hook #'global-flycheck-mode) +;; +;; Flycheck will then automatically check buffers in supported languages, as +;; long as all necessary tools are present. +;; +;; # Documentation +;; +;; Flycheck comes with a rich manual, which you can read in Emacs with `M-x +;; flycheck-info' after installing this package. It is also available online at +;; URL `http://www.flycheck.org/manual/latest/index.html'. +;; +;; The manual has a Quickstart section which gives you a short and comprehensive +;; introduction into Flycheck's features and usage, and a complete list of all +;; supported languages and tools. + +;;; Code: + +(eval-when-compile + (require 'let-alist) ; `let-alist' + (require 'cl-lib) ; `cl-defstruct' + (require 'compile) ; Compile Mode integration + (require 'package) ; Tell Emacs about package-user-dir + (require 'sh-script) ; `sh-shell' for sh checker predicates + (require 'jka-compr) ; For JKA workarounds in `flycheck-temp-file-system' + (require 'pcase) ; `pcase-dolist' (`pcase' itself is autoloaded) + ) + +(require 'dash) + +(require 'subr-x nil 'no-error) ; Additional utilities, Emacs 24.4 and upwards +(require 'tabulated-list) ; To list errors +(require 'easymenu) ; Flycheck Mode menu definition +(require 'rx) ; Regexp fanciness in `flycheck-define-checker' +(require 'help-mode) ; `define-button-type' +(require 'find-func) ; `find-function-regexp-alist' + +;; Tell the byte compiler about autoloaded functions from packages +(declare-function pkg-info-version-info "pkg-info" (package)) + + +;;; Compatibility +(eval-and-compile + ;; `defvar-local' Emacs 24.2 and below + (unless (fboundp 'defvar-local) + (defmacro defvar-local (var val &optional docstring) + "Define VAR as a buffer-local variable with default value VAL. +Like `defvar' but additionally marks the variable as being automatically +buffer-local wherever it is set." + (declare (debug defvar) (doc-string 3)) + `(progn + (defvar ,var ,val ,docstring) + (make-variable-buffer-local ',var)))) + + (unless (fboundp 'setq-local) + ;; `setq-local' for Emacs 24.2 and below + (defmacro setq-local (var val) + "Set variable VAR to value VAL in current buffer." + `(set (make-local-variable ',var) ,val))) + + (unless (fboundp 'user-error) + ;; `user-error' for Emacs 24.2 and below + (defalias 'user-error 'error) + + (add-to-list 'debug-ignored-errors + (rx string-start "No more Flycheck errors" string-end)) + (add-to-list 'debug-ignored-errors + (rx string-start "Flycheck mode disabled" string-end)) + (add-to-list 'debug-ignored-errors + (rx string-start "Configured syntax checker " + symbol-start (one-or-more not-newline) symbol-end + " cannot be used" string-end))) + + (unless (fboundp 'string-suffix-p) + ;; `string-suffix-p' for Emacs 24.3 and below + (defun string-suffix-p (suffix string &optional ignore-case) + "Return non-nil if SUFFIX is a suffix of STRING. +If IGNORE-CASE is non-nil, the comparison is done without paying +attention to case differences." + (let ((start-pos (- (length string) (length suffix)))) + (and (>= start-pos 0) + (eq t (compare-strings suffix nil nil + string start-pos nil ignore-case)))))) + + (unless (featurep 'subr-x) + ;; `subr-x' function for Emacs 24.3 and below + (defsubst string-join (strings &optional separator) + "Join all STRINGS using SEPARATOR." + (mapconcat 'identity strings separator)) + + (defsubst string-trim-left (string) + "Remove leading whitespace from STRING." + (if (string-match "\\`[ \t\n\r]+" string) + (replace-match "" t t string) + string)) + + (defsubst string-trim-right (string) + "Remove trailing whitespace from STRING." + (if (string-match "[ \t\n\r]+\\'" string) + (replace-match "" t t string) + string)) + + (defsubst string-trim (string) + "Remove leading and trailing whitespace from STRING." + (string-trim-left (string-trim-right string))) + + (defsubst string-empty-p (string) + "Check whether STRING is empty." + (string= string "")))) + +(when (and (not (get 'exclamation-mark 'fringe)) + (fboundp 'define-fringe-bitmap)) + ;; Provide `exclamation-mark' bitmap for Emacs 24.2 and below. We also check, + ;; whether `define-fringe-bitmap' is defined, because this function is not + ;; available if Emacs is built without GUI support. See + ;; https://github.com/flycheck/flycheck/issues/57 + (define-fringe-bitmap 'exclamation-mark + [24 60 60 24 24 0 0 24 24] nil nil 'center)) + + +;;; Customization +(defgroup flycheck nil + "Modern on-the-fly syntax checking for GNU Emacs." + :prefix "flycheck-" + :group 'tools + :link '(url-link :tag "Website" "http://www.flycheck.org") + :link '(url-link :tag "Github" "https://github.com/flycheck/flycheck") + :link '(custom-manual "(flycheck)Top") + :link '(info-link "(flycheck)Usage")) + +(defgroup flycheck-config-files nil + "Configuration files for on-the-fly syntax checkers." + :prefix "flycheck-" + :group 'flycheck + :link '(custom-manual "(flycheck)Syntax checker configuration files")) + +(defgroup flycheck-options nil + "Options for on-the-fly syntax checkers." + :prefix "flycheck-" + :group 'flycheck + :link '(custom-manual "(flycheck)Syntax checker options")) + +(defgroup flycheck-executables nil + "Executables of syntax checkers." + :prefix "flycheck-" + :group 'flycheck + :link '(custom-manual "(flycheck)Syntax checker executables")) + +(defgroup flycheck-faces nil + "Faces used by on-the-fly syntax checking." + :prefix "flycheck-" + :group 'flycheck + :link '(info-link "(flycheck)Error reporting")) + +(defcustom flycheck-checkers + '(ada-gnat + asciidoc + c/c++-clang + c/c++-gcc + c/c++-cppcheck + cfengine + chef-foodcritic + coffee + coffee-coffeelint + coq + css-csslint + d-dmd + emacs-lisp + emacs-lisp-checkdoc + erlang + eruby-erubis + fortran-gfortran + go-gofmt + go-golint + go-vet + go-build + go-test + go-errcheck + haml + handlebars + haskell-ghc + haskell-hlint + html-tidy + javascript-jshint + javascript-eslint + javascript-gjslint + javascript-jscs + javascript-standard + json-jsonlint + less + luacheck + lua + perl + perl-perlcritic + php + php-phpmd + php-phpcs + puppet-parser + puppet-lint + python-flake8 + python-pylint + python-pycompile + r-lintr + racket + rpm-rpmlint + rst + rst-sphinx + ruby-rubocop + ruby-rubylint + ruby + ruby-jruby + rust + sass + scala + scala-scalastyle + scss-lint + scss + sh-bash + sh-posix-dash + sh-posix-bash + sh-zsh + sh-shellcheck + slim + tex-chktex + tex-lacheck + texinfo + verilog-verilator + xml-xmlstarlet + xml-xmllint + yaml-jsyaml + yaml-ruby) + "Syntax checkers available for automatic selection. + +A list of Flycheck syntax checkers to choose from when syntax +checking a buffer. Flycheck will automatically select a suitable +syntax checker from this list, unless `flycheck-checker' is set, +either directly or with `flycheck-select-checker'. + +You should not need to change this variable normally. In order +to disable syntax checkers, please use +`flycheck-disabled-checkers'. This variable is intended for 3rd +party extensions to tell Flycheck about new syntax checkers. + +Syntax checkers in this list must be defined with +`flycheck-define-checker'." + :group 'flycheck + :type '(repeat (symbol :tag "Checker")) + :risky t) + +(defcustom flycheck-disabled-checkers nil + "Syntax checkers excluded from automatic selection. + +A list of Flycheck syntax checkers to exclude from automatic +selection. Flycheck will never automatically select a syntax +checker in this list, regardless of the value of +`flycheck-checkers'. + +However, syntax checkers in this list are still available for +manual selection with `flycheck-select-checker'. + +Use this variable to disable syntax checkers, instead of removing +the syntax checkers from `flycheck-checkers'. You may also use +this option as a file or directory local variable to disable +specific checkers in individual files and directories +respectively." + :group 'flycheck + :type '(repeat (symbol :tag "Checker")) + :package-version '(flycheck . "0.16") + :safe #'flycheck-symbol-list-p) +(make-variable-buffer-local 'flycheck-disabled-checkers) + +(defvar-local flycheck-checker nil + "Syntax checker to use for the current buffer. + +If unset or nil, automatically select a suitable syntax checker +from `flycheck-checkers' on every syntax check. + +If set to a syntax checker only use this syntax checker and never +select one from `flycheck-checkers' automatically. The syntax +checker is used regardless of whether it is contained in +`flycheck-checkers' or `flycheck-disabled-checkers'. If the +syntax checker is unusable in the current buffer an error is +signaled. + +A syntax checker assigned to this variable must be defined with +`flycheck-define-checker'. + +Use the command `flycheck-select-checker' to select a syntax +checker for the current buffer, or set this variable as file +local variable to always use a specific syntax checker for a +file. See Info Node `(emacs)Specifying File Variables' for more +information about file variables.") +(put 'flycheck-checker 'safe-local-variable 'flycheck-registered-checker-p) + +(defcustom flycheck-locate-config-file-functions nil + "Functions to locate syntax checker configuration files. + +Each function in this hook must accept two arguments: The value +of the configuration file variable, and the syntax checker +symbol. It must return either a string with an absolute path to +the configuration file, or nil, if it cannot locate the +configuration file. + +The functions in this hook are called in order of appearance, until a +function returns non-nil. The configuration file returned by that +function is then given to the syntax checker if it exists. + +This variable is an abnormal hook. See Info +node `(elisp)Hooks'." + :group 'flycheck + :type 'hook + :risky t) + +(defcustom flycheck-checker-error-threshold 400 + "Maximum errors allowed per syntax checker. + +The value of this variable is either an integer denoting the +maximum number of errors per syntax checker and buffer, or nil to +not limit the errors reported from a syntax checker. + +If this variable is a number and a syntax checker reports more +errors than the value of this variable, its errors are not +discarded, and not highlighted in the buffer or available in the +error list. The affected syntax checker is also disabled for +future syntax checks of the buffer." + :group 'flycheck + :type '(choice (const :tag "Do not limit reported errors" nil) + (integer :tag "Maximum number of errors")) + :risky t + :package-version '(flycheck . "0.22")) + +(defcustom flycheck-process-error-functions nil + "Functions to process errors. + +Each function in this hook must accept a single argument: A +Flycheck error to process. + +All functions in this hook are called in order of appearance, +until a function returns non-nil. Thus, a function in this hook +may return nil, to allow for further processing of the error, or +any non-nil value, to indicate that the error was fully processed +and inhibit any further processing. + +The functions are called for each newly parsed error immediately +after the corresponding syntax checker finished. At this stage, +the overlays from the previous syntax checks are still present, +and there may be further syntax checkers in the chain. + +This variable is an abnormal hook. See Info +node `(elisp)Hooks'." + :group 'flycheck + :type 'hook + :package-version '(flycheck . "0.13") + :risky t) + +(defcustom flycheck-display-errors-delay 0.9 + "Delay in seconds before displaying errors at point. + +Use floating point numbers to express fractions of seconds." + :group 'flycheck + :type 'number + :package-version '(flycheck . "0.15") + :safe #'numberp) + +(defcustom flycheck-display-errors-function #'flycheck-display-error-messages + "Function to display error messages. + +If set to a function, call the function with the list of errors +to display as single argument. Each error is an instance of the +`flycheck-error' struct. + +If set to nil, do not display errors at all." + :group 'flycheck + :type '(choice (const :tag "Display error messages" + flycheck-display-error-messages) + (const :tag "Display error messages only if no error list" + flycheck-display-error-messages-unless-error-list) + (function :tag "Error display function")) + :package-version '(flycheck . "0.13") + :risky t) + +(defcustom flycheck-indication-mode 'left-fringe + "The indication mode for Flycheck errors and warnings. + +This variable controls how Flycheck indicates errors in buffers. +May either be `left-fringe', `right-fringe', or nil. + +If set to `left-fringe' or `right-fringe', indicate errors and +warnings via icons in the left and right fringe respectively. + +If set to nil, do not indicate errors and warnings, but just +highlight them according to `flycheck-highlighting-mode'." + :group 'flycheck + :type '(choice (const :tag "Indicate in the left fringe" left-fringe) + (const :tag "Indicate in the right fringe" right-fringe) + (const :tag "Do not indicate" nil)) + :safe #'symbolp) + +(defcustom flycheck-highlighting-mode 'symbols + "The highlighting mode for Flycheck errors and warnings. + +The highlighting mode controls how Flycheck highlights errors in +buffers. The following modes are known: + +`columns' + Highlight the error column. If the error does not have a column, + highlight the whole line. + +`symbols' + Highlight the symbol at the error column, if there is any, + otherwise behave like `columns'. This is the default. + +`sexps' + Highlight the expression at the error column, if there is + any, otherwise behave like `columns'. Note that this mode + can be *very* slow in some major modes. + +`lines' + Highlight the whole line. + +nil + Do not highlight errors at all. However, errors will still + be reported in the mode line and in error message popups, + and indicated according to `flycheck-indication-mode'." + :group 'flycheck + :type '(choice (const :tag "Highlight columns only" columns) + (const :tag "Highlight symbols" symbols) + (const :tag "Highlight expressions" sexps) + (const :tag "Highlight whole lines" lines) + (const :tag "Do not highlight errors" nil)) + :package-version '(flycheck . "0.14") + :safe #'symbolp) + +(defcustom flycheck-check-syntax-automatically '(save + idle-change + new-line + mode-enabled) + "When Flycheck should check syntax automatically. + +This variable is a list of events that may trigger syntax checks. +The following events are known: + +`save' + Check syntax immediately after the buffer was saved. + +`idle-change' + Check syntax a short time (see `flycheck-idle-change-delay') + after the last change to the buffer. + +`new-line' + Check syntax immediately after a new line was inserted into + the buffer. + +`mode-enabled' + Check syntax immediately when `flycheck-mode' is enabled. + +Flycheck performs a syntax checks only on events, which are +contained in this list. For instance, if the value of this +variable is `(mode-enabled save)', Flycheck will only check if +the mode is enabled or the buffer was saved, but never after +changes to the buffer contents. + +If nil, never check syntax automatically. In this case, use +`flycheck-buffer' to start a syntax check manually." + :group 'flycheck + :type '(set (const :tag "After the buffer was saved" save) + (const :tag "After the buffer was changed and idle" idle-change) + (const :tag "After a new line was inserted" new-line) + (const :tag "After `flycheck-mode' was enabled" mode-enabled)) + :package-version '(flycheck . "0.12") + :safe #'symbolp) + +(defcustom flycheck-idle-change-delay 0.5 + "How many seconds to wait before checking syntax automatically. + +After the buffer was changed, Flycheck will wait as many seconds +as the value of this variable before starting a syntax check. If +the buffer is modified during this time, Flycheck will wait +again. + +This variable has no effect, if `idle-change' is not contained in +`flycheck-check-syntax-automatically'." + :group 'flycheck + :type 'number + :package-version '(flycheck . "0.13") + :safe #'numberp) + +(defcustom flycheck-standard-error-navigation t + "Whether to support error navigation with `next-error'. + +If non-nil, enable navigation of Flycheck errors with +`next-error', `previous-error' and `first-error'. Otherwise, +these functions just navigate errors from compilation modes. + +Flycheck error navigation with `flycheck-next-error', +`flycheck-previous-error' and `flycheck-first-error' is always +enabled, regardless of the value of this variable. + +Note that this setting only takes effect when `flycheck-mode' is +enabled. Changing it will not affect buffers which already have +`flycheck-mode' enabled." + :group 'flycheck + :type 'boolean + :package-version '(flycheck . "0.15") + :safe #'booleanp) + +(defcustom flycheck-navigation-minimum-level nil + "The minimum level of errors to navigate. + +If set to an error level, only navigate errors whose error level +is at least as severe as this one. If nil, navigate all errors." + :group 'flycheck + :type '(radio (const :tag "All locations" nil) + (const :tag "Informational messages" info) + (const :tag "Warnings" warning) + (const :tag "Errors" error) + (symbol :tag "Custom error level")) + :safe #'flycheck-error-level-p + :package-version '(flycheck . "0.21")) + +(defcustom flycheck-completion-system nil + "The completion system to use. + +`ido' + Use IDO. + + IDO is a built-in alternative completion system, without + good flex matching and a powerful UI. You may want to + install flx-ido (see URL `https://github.com/lewang/flx') to + improve the flex matching in IDO. + +`grizzl' + Use Grizzl. + + Grizzl is an alternative completion system with powerful + flex matching, but a very limited UI. See URL + `https://github.com/d11wtq/grizzl'. + +nil + Use the standard unfancy `completing-read'. + + `completing-read' has a very simple and primitive UI, and + does not offer flex matching. This is the default setting, + though, to match Emacs' defaults. With this system, you may + want enable option `icomplete-mode' to improve the display + of completion candidates at least." + :group 'flycheck + :type '(choice (const :tag "IDO" ido) + (const :tag "Grizzl" grizzl) + (const :tag "Completing read" nil)) + :package-version '(flycheck . "0.17")) + +(defcustom flycheck-temp-prefix "flycheck" + "Prefix for temporary files created by Flycheck." + :group 'flycheck + :type 'string + :package-version '(flycheck . "0.19") + :risky t) + +(defcustom flycheck-mode-hook nil + "Hooks to run after `flycheck-mode'." + :group 'flycheck + :type 'hook + :risky t) + +(defcustom flycheck-after-syntax-check-hook nil + "Functions to run after each syntax check. + +This hook is run after a syntax check was finished. + +At this point, *all* chained checkers were run, and all errors +were parsed, highlighted and reported. The variable +`flycheck-current-errors' contains all errors from all syntax +checkers run during the syntax check, so you can apply any error +analysis functions. + +Note that this hook does *not* run after each individual syntax +checker in the syntax checker chain, but only after the *last +checker*. + +This variable is a normal hook. See Info node `(elisp)Hooks'." + :group 'flycheck + :type 'hook + :risky t) + +(defcustom flycheck-before-syntax-check-hook nil + "Functions to run before each syntax check. + +This hook is run right before a syntax check starts. + +Error information from the previous syntax check is *not* +cleared before this hook runs. + +Note that this hook does *not* run before each individual syntax +checker in the syntax checker chain, but only before the *first +checker*. + +This variable is a normal hook. See Info node `(elisp)Hooks'." + :group 'flycheck + :type 'hook + :risky t) + +(defcustom flycheck-syntax-check-failed-hook nil + "Functions to run if a syntax check failed. + +This hook is run whenever an error occurs during Flycheck's +internal processing. No information about the error is given to +this hook. + +You should use this hook to conduct additional cleanup actions +when Flycheck failed. + +This variable is a normal hook. See Info node `(elisp)Hooks'." + :group 'flycheck + :type 'hook + :risky t) + +(defcustom flycheck-status-changed-functions nil + "Functions to run if the Flycheck status changed. + +This hook is run whenever the status of Flycheck changes. Each +hook function takes the status symbol as sinlge argument, as +given to `flycheck-report-status', which see. + +This variable is a abnormal hook. See Info +node `(elisp)Hooks'." + :group 'flycheck + :type 'hook + :risky t + :package-version '(flycheck . "0.20")) + +(defcustom flycheck-error-list-after-refresh-hook nil + "Functions to run after the error list was refreshed. + +This hook is run whenever the error list is refreshed. + +This variable is a normal hook. See Info node `(elisp)Hooks'." + :group 'flycheck + :type 'hook + :risky t + :package-version '(flycheck . "0.21")) + +(defface flycheck-error + '((((supports :underline (:style wave))) + :underline (:style wave :color "Red1")) + (t + :underline t :inherit error)) + "Flycheck face for errors." + :package-version '(flycheck . "0.13") + :group 'flycheck-faces) + +(defface flycheck-warning + '((((supports :underline (:style wave))) + :underline (:style wave :color "DarkOrange")) + (t + :underline t :inherit warning)) + "Flycheck face for warnings." + :package-version '(flycheck . "0.13") + :group 'flycheck-faces) + +(defface flycheck-info + '((((supports :underline (:style wave))) + :underline (:style wave :color "ForestGreen")) + (t + :underline t :inherit success)) + "Flycheck face for informational messages." + :package-version '(flycheck . "0.15") + :group 'flycheck-faces) + +(defface flycheck-fringe-error + '((t :inherit error)) + "Flycheck face for fringe error indicators." + :package-version '(flycheck . "0.13") + :group 'flycheck-faces) + +(defface flycheck-fringe-warning + '((t :inherit warning)) + "Flycheck face for fringe warning indicators." + :package-version '(flycheck . "0.13") + :group 'flycheck-faces) + +(defface flycheck-fringe-info + ;; Semantically `success' is probably not the right face, but it looks nice as + ;; a base face + '((t :inherit success)) + "Flycheck face for fringe info indicators." + :package-version '(flycheck . "0.15") + :group 'flycheck-faces) + +(defface flycheck-error-list-error + '((t :inherit error)) + "Flycheck face for error messages in the error list." + :package-version '(flycheck . "0.16") + :group 'flycheck-faces) + +(defface flycheck-error-list-warning + '((t :inherit warning)) + "Flycheck face for warning messages in the error list." + :package-version '(flycheck . "0.16") + :group 'flycheck-faces) + +(defface flycheck-error-list-info + '((t :inherit success)) + "Flycheck face for info messages in the error list." + :package-version '(flycheck . "0.16") + :group 'flycheck-faces) + +;; The base faces for the following two faces are inspired by Compilation Mode +(defface flycheck-error-list-line-number + '((t :inherit font-lock-constant-face)) + "Face for line numbers in the error list." + :group 'flycheck-faces + :package-version '(flycheck . "0.16")) + +(defface flycheck-error-list-column-number + '((t :inherit font-lock-constant-face)) + "Face for line numbers in the error list." + :group 'flycheck-faces + :package-version '(flycheck . "0.16")) + +(defface flycheck-error-list-id + '((t :inherit font-lock-type-face)) + "Face for the error ID in the error list." + :group 'flycheck-faces + :package-version '(flycheck . "0.22")) + +(defface flycheck-error-list-checker-name + '((t :inherit font-lock-function-name-face)) + "Face for the syntax checker name in the error list." + :group 'flycheck-faces + :package-version '(flycheck . "0.21")) + +(defface flycheck-error-list-highlight + '((t :inherit highlight)) + "Flycheck face to highlight errors in the error list." + :package-version '(flycheck . "0.15") + :group 'flycheck-faces) + +(defvar flycheck-command-map + (let ((map (make-sparse-keymap))) + (define-key map "c" #'flycheck-buffer) + (define-key map "C" #'flycheck-clear) + (define-key map (kbd "C-c") #'flycheck-compile) + (define-key map "n" #'flycheck-next-error) + (define-key map "p" #'flycheck-previous-error) + (define-key map "l" #'flycheck-list-errors) + (define-key map (kbd "C-w") #'flycheck-copy-errors-as-kill) + (define-key map "s" #'flycheck-select-checker) + (define-key map "e" #'flycheck-set-checker-executable) + (define-key map "?" #'flycheck-describe-checker) + (define-key map "i" #'flycheck-info) + (define-key map "V" #'flycheck-version) + (define-key map "v" #'flycheck-verify-setup) + (define-key map "x" #'flycheck-disable-checker) + map) + "Keymap of Flycheck interactive commands.") + +(defcustom flycheck-keymap-prefix (kbd "C-c !") + "Prefix for key bindings of Flycheck. + +Changing this variable outside Customize does not have any +effect. To change the keymap prefix from Lisp, you need to +explicitly re-define the prefix key: + + (define-key flycheck-mode-map flycheck-keymap-prefix nil) + (setq flycheck-keymap-prefix (kbd \"C-c f\")) + (define-key flycheck-mode-map flycheck-keymap-prefix + flycheck-command-map) + +Please note that Flycheck's manual documents the default +keybindings. Changing this variable is at your own risk." + :group 'flycheck + :package-version '(flycheck . "0.19") + :type 'string + :risky t + :set + (lambda (variable key) + (when (and (boundp variable) (boundp 'flycheck-mode-map)) + (define-key flycheck-mode-map (symbol-value variable) nil) + (define-key flycheck-mode-map key flycheck-command-map)) + (set-default variable key))) + +(defcustom flycheck-mode-line '(:eval (flycheck-mode-line-status-text)) + "Mode line lighter for Flycheck. + +The value of this variable is a mode line template as in +`mode-line-format'. See Info Node `(elisp)Mode Line Format' for +more information. Note that it should contain a _single_ mode +line construct only. + +Customize this variable to change how Flycheck reports its status +in the mode line. You may use `flycheck-mode-line-status-text' +to obtain a human-readable status text, including an +error/warning count. + +You may also assemble your own status text. The current status +of Flycheck is available in `flycheck-last-status-change'. The +errors in the current buffer are stored in +`flycheck-current-errors', and the function +`flycheck-count-errors' may be used to obtain the number of +errors grouped by error level. + +Set this variable to nil to disable the mode line completely." + :group 'flycheck + :type 'sexp + :risky t + :package-version '(flycheck . "0.20")) + +(defcustom flycheck-error-list-mode-line + `(,(propertized-buffer-identification "%12b") + " for buffer " + (:eval (flycheck-error-list-propertized-source-name))) + "Mode line construct for Flycheck error list. + +The value of this variable is a mode line template as in +`mode-line-format', to be used as +`mode-line-buffer-identification' in `flycheck-error-list-mode'. +See Info Node `(elisp)Mode Line Format' for more information. + +Customize this variable to change how the error list appears in +the mode line. The default shows the name of the buffer and the +name of the source buffer, i.e. the buffer whose errors are +currently listed." + :group 'flycheck + :type 'sexp + :risky t + :package-version '(flycheck . "0.20")) + +(defcustom flycheck-global-modes t + "Modes for which `flycheck-mode' is turned on by `global-flycheck-mode'. + +If t, Flycheck Mode is turned on for all major modes. If a list, +Flycheck Mode is turned on for all `major-mode' symbols in that +list. If the `car' of the list is `not', Flycheck Mode is turned +on for all `major-mode' symbols _not_ in that list. If nil, +Flycheck Mode is never turned on by `global-flycheck-mode'. + +Note that Flycheck is never turned on for modes whose +`mode-class' property is `special' (see Info node `(elisp)Major +Mode Conventions'), regardless of the value of this option." + :group 'flycheck + :type '(choice (const :tag "none" nil) + (const :tag "all" t) + (set :menu-tag "mode specific" :tag "modes" + :value (not) + (const :tag "Except" not) + (repeat :inline t (symbol :tag "mode")))) + :risky t + :package-version '(flycheck . "0.23")) + +;; Add built-in functions to our hooks, via `add-hook', to make sure that our +;; functions are really present, even if the variable was implicitly defined by +;; another call to `add-hook' that occurred before Flycheck was loaded. See +;; http://lists.gnu.org/archive/html/emacs-devel/2015-02/msg01271.html for why +;; we don't initialize the hook variables right away. We append our own +;; functions, because a user likely expects that their functions come first, +;; even if the added them before Flycheck was loaded. +(dolist (hook (list #'flycheck-locate-config-file-absolute-path + #'flycheck-locate-config-file-ancestor-directories + #'flycheck-locate-config-file-home)) + (add-hook 'flycheck-locate-config-file-functions hook 'append)) + +(add-hook 'flycheck-process-error-functions #'flycheck-add-overlay 'append) + + +;;; Global Flycheck menu +(defvar flycheck-mode-menu-map + (easy-menu-create-menu + "Syntax Checking" + '(["Enable on-the-fly syntax checking" flycheck-mode + :style toggle :selected flycheck-mode + ;; Don't let users toggle the mode if there is no syntax checker for this + ;; buffer + :enable (or flycheck-mode (flycheck-get-checker-for-buffer))] + ["Check current buffer" flycheck-buffer flycheck-mode] + ["Clear errors in buffer" flycheck-clear t] + "---" + ["Go to next error" flycheck-next-error flycheck-mode] + ["Go to previous error" flycheck-previous-error flycheck-mode] + ["Show all errors" flycheck-list-errors flycheck-mode] + "---" + ["Copy messages at point" flycheck-copy-errors-as-kill + (flycheck-overlays-at (point))] + "---" + ["Select syntax checker" flycheck-select-checker flycheck-mode] + ["Disable syntax checker" flycheck-disable-checker flycheck-mode] + ["Set executable of syntax checker" flycheck-set-checker-executable + flycheck-mode] + "---" + ["Describe syntax checker" flycheck-describe-checker t] + ["Show Flycheck version" flycheck-version t] + ["Read the Flycheck manual" flycheck-info t])) + "Menu of `flycheck-mode'.") + +(easy-menu-add-item nil '("Tools") flycheck-mode-menu-map "Spell Checking") + + +;;; Version information, manual and loading of Flycheck +(defun flycheck-version (&optional show-version) + "Get the Flycheck version as string. + +If called interactively or if SHOW-VERSION is non-nil, show the +version in the echo area and the messages buffer. + +The returned string includes both, the version from package.el +and the library version, if both a present and different. + +If the version number could not be determined, signal an error, +if called interactively, or if SHOW-VERSION is non-nil, otherwise +just return nil." + (interactive (list t)) + (let ((version (pkg-info-version-info 'flycheck))) + (when show-version + (message "Flycheck version: %s" version)) + version)) + +(defun flycheck-unload-function () + "Unload function for Flycheck." + (global-flycheck-mode -1) + (easy-menu-remove-item nil '("Tools") (cadr flycheck-mode-menu-map)) + (remove-hook 'kill-emacs-hook #'flycheck-global-teardown) + (setq find-function-regexp-alist + (assq-delete-all 'flycheck-checker find-function-regexp-alist))) + +;;;###autoload +(defun flycheck-info () + "Open the Flycheck manual." + (interactive) + (info "flycheck")) + + +;;; Utility functions +(defun flycheck-sexp-to-string (sexp) + "Convert SEXP to a string. + +Like `prin1-to-string' but ensure that the returned string +is loadable." + (let ((print-quoted t) + (print-length nil) + (print-level nil)) + (prin1-to-string sexp))) + +(defun flycheck-string-to-number-safe (string) + "Safely convert STRING to a number. + +If STRING is of string type and a numeric string, convert STRING +to a number and return it. Otherwise return nil." + (let ((number-re (rx string-start (one-or-more (any digit)) string-end))) + (when (and (stringp string) (string-match-p number-re string)) + (string-to-number string)))) + +(defun flycheck-string-list-p (obj) + "Determine if OBJ is a list of strings." + (and (listp obj) (-all? #'stringp obj))) + +(defun flycheck-symbol-list-p (obj) + "Determine if OBJ is a list of symbols." + (and (listp obj) (-all? #'symbolp obj))) + +(defun flycheck-same-files-p (file-a file-b) + "Determine whether FILE-A and FILE-B refer to the same file." + (let ((file-a (expand-file-name file-a)) + (file-b (expand-file-name file-b))) + ;; We must resolve symbolic links here, since some syntax checker always + ;; output canonical file names with all symbolic links resolved. However, + ;; we still do a simple path compassion first, to avoid the comparatively + ;; expensive file system call if possible. See + ;; https://github.com/flycheck/flycheck/issues/561 + (or (string= (directory-file-name file-a) (directory-file-name file-b)) + (string= (directory-file-name (file-truename file-a)) + (directory-file-name (file-truename file-b)))))) + +(defvar-local flycheck-temporaries nil + "Temporary files and directories created by Flycheck.") + +(defun flycheck-temp-dir-system () + "Create a unique temporary directory. + +Use `flycheck-temp-prefix' as prefix, and add the directory to +`flycheck-temporaries'. + +Return the path of the directory" + (let* ((tempdir (make-temp-file flycheck-temp-prefix 'directory))) + (push tempdir flycheck-temporaries) + tempdir)) + +(defun flycheck-temp-file-system (filename) + "Create a temporary file named after FILENAME. + +If FILENAME is non-nil, this function creates a temporary +directory with `flycheck-temp-dir-system', and creates a file +with the same name as FILENAME in this directory. + +Otherwise this function creates a temporary file with +`flycheck-temp-prefix' and a random suffix. The path of the file +is added to `flycheck-temporaries'. + +Add the path of the file to `flycheck-temporaries'. + +Return the path of the file." + (let (tempfile) + (if filename + (let ((directory (flycheck-temp-dir-system))) + (setq tempfile (expand-file-name (file-name-nondirectory filename) + directory))) + (setq tempfile (make-temp-file flycheck-temp-prefix))) + (push tempfile flycheck-temporaries) + tempfile)) + +(defun flycheck-temp-file-inplace (filename) + "Create an in-place copy of FILENAME. + +Prefix the file with `flycheck-temp-prefix' and add the path of +the file to `flycheck-temporaries'. + +If FILENAME is nil, fall back to `flycheck-temp-file-system'. + +Return the path of the file." + (if filename + (let* ((tempname (format "%s_%s" + flycheck-temp-prefix + (file-name-nondirectory filename))) + (tempfile (expand-file-name tempname + (file-name-directory filename)))) + (push tempfile flycheck-temporaries) + tempfile) + (flycheck-temp-file-system filename))) + +(defun flycheck-save-buffer-to-file (file-name) + "Save the contents of the current buffer to FILE-NAME." + (make-directory (file-name-directory file-name) t) + (let ((jka-compr-inhibit t)) + (write-region nil nil file-name nil 0))) + +(defun flycheck-save-buffer-to-temp (temp-file-fn) + "Save buffer to temp file returned by TEMP-FILE-FN. + +Return the name of the temporary file." + (let ((filename (funcall temp-file-fn (buffer-file-name)))) + ;; Do not flush short-lived temporary files onto disk + (let ((write-region-inhibit-fsync t)) + (flycheck-save-buffer-to-file filename)) + filename)) + +(defun flycheck-prepend-with-option (option items &optional prepend-fn) + "Prepend OPTION to each item in ITEMS, using PREPEND-FN. + +Prepend OPTION to each item in ITEMS. + +ITEMS is a list of strings to pass to the syntax checker. OPTION +is the option, as string. PREPEND-FN is a function called to +prepend OPTION to each item in ITEMS. It receives the option and +a single item from ITEMS as argument, and must return a string or +a list of strings with OPTION prepended to the item. If +PREPEND-FN is nil or omitted, use `list'. + +Return a list of strings where OPTION is prepended to each item +in ITEMS using PREPEND-FN. If PREPEND-FN returns a list, it is +spliced into the resulting list." + (unless (stringp option) + (error "Option %S is not a string" option)) + (unless prepend-fn + (setq prepend-fn #'list)) + (let ((prepend + (lambda (item) + (let ((result (funcall prepend-fn option item))) + (cond + ((and (listp result) (-all? #'stringp result)) result) + ((stringp result) (list result)) + (t (error "Invalid result type for option: %S" result))))))) + (apply #'append (mapcar prepend items)))) + +(defun flycheck-find-in-buffer (pattern) + "Find PATTERN in the current buffer. + +Return the result of the first matching group of PATTERN, or nil, +if PATTERN did not match." + (save-restriction + (widen) + (save-excursion + (goto-char (point-min)) + (when (re-search-forward pattern nil 'no-error) + (match-string-no-properties 1))))) + +(defun flycheck-ephemeral-buffer-p () + "Determine whether the current buffer is an ephemeral buffer. + +See Info node `(elisp)Buffer Names' for information about +ephemeral buffers." + (string-prefix-p " " (buffer-name))) + +(defun flycheck-encrypted-buffer-p () + "Determine whether the current buffer is an encrypted file. + +See Info node `(epa)Top' for Emacs' interface to encrypted +files." + ;; The EPA file handler sets this variable locally to remember the recipients + ;; of the encrypted file for re-encryption. Hence, a local binding of this + ;; variable is a good indication that the buffer is encrypted. I haven't + ;; found any better indicator anyway. + (local-variable-p 'epa-file-encrypt-to)) + +(defun flycheck-autoloads-file-p () + "Determine whether the current buffer is a autoloads file. + +Autoloads are generated by package.el during installation." + (string-suffix-p "-autoloads.el" (buffer-name))) + +(defun flycheck-in-user-emacs-directory-p (filename) + "Whether FILENAME is in `user-emacs-directory'." + (string-prefix-p (file-name-as-directory (file-truename user-emacs-directory)) + (file-truename filename))) + +(defun flycheck-safe-delete (file-or-dir) + "Safely delete FILE-OR-DIR." + (ignore-errors + (if (file-directory-p file-or-dir) + (delete-directory file-or-dir 'recursive) + (delete-file file-or-dir)))) + +(defun flycheck-safe-delete-temporaries () + "Safely delete all temp files and directories of Flycheck. + +Safely delete all files and directories listed in +`flycheck-temporaries' and set the variable's value to nil." + (mapc #'flycheck-safe-delete flycheck-temporaries) + (setq flycheck-temporaries nil)) + +(eval-and-compile + (defun flycheck-rx-file-name (form) + "Translate the `(file-name)' FORM into a regular expression." + (let ((body (or (cdr form) '((minimal-match + (one-or-more not-newline)))))) + (rx-submatch-n `(group-n 1 ,@body)))) + + (defun flycheck-rx-message (form) + "Translate the `(message)' FORM into a regular expression." + (let ((body (or (cdr form) '((one-or-more not-newline))))) + (rx-submatch-n `(group-n 4 ,@body)))) + + (defun flycheck-rx-id (form) + "Translate the `(id)' FORM into a regular expression." + (rx-submatch-n `(group-n 5 ,@(cdr form)))) + + (defun flycheck-rx-to-string (form &optional no-group) + "Like `rx-to-string' for FORM, but with special keywords: + +`line' + matches the line number. + +`column' + matches the column number. + +`(file-name SEXP ...)' + matches the file name. SEXP describes the file name. If no + SEXP is given, use a default body of `(minimal-match + (one-or-more not-newline))'. + +`(message SEXP ...)' + matches the message. SEXP constitutes the body of the message. If no SEXP + is given, use a default body of `(one-or-more not-newline)'. + +`(id SEXP ...)' + matches an error ID. SEXP describes the ID. + +NO-GROUP is passed to `rx-to-string'." + (let ((rx-constituents + (append + `((line . ,(rx (group-n 2 (one-or-more digit)))) + (column . ,(rx (group-n 3 (one-or-more digit)))) + (file-name flycheck-rx-file-name 0 nil) + (message flycheck-rx-message 0 nil) + (id flycheck-rx-id 0 nil)) + rx-constituents nil))) + (rx-to-string form no-group)))) + +(defun flycheck-current-load-file () + "Get the source file currently being loaded. + +Always return the name of the corresponding source file, never +any byte-compiled file. + +Return nil, if the currently loaded file cannot be determined." + (-when-let* ((this-file (cond + (load-in-progress load-file-name) + ((bound-and-true-p byte-compile-current-file)) + (t (buffer-file-name)))) + ;; A best guess for the source file of a compiled library. Works + ;; well in most cases, and especially for ELPA packages + (source-file (concat (file-name-sans-extension this-file) + ".el"))) + (when (file-exists-p source-file) + source-file))) + +(defun flycheck-module-root-directory (module &optional file-name) + "Get the root directory for a MODULE in FILE-NAME. + +MODULE is a qualified module name, either a string with +components separated by a dot, or as list of components. +FILE-NAME is the name of the file or directory containing the +module as string. When nil or omitted, defaults to the return +value of function `buffer-file-name'. + +Return the root directory of the module, that is, the directory, +from which FILE-NAME can be reached by descending directories +along each part of MODULE. + +If the MODULE name does not match the directory hierarchy upwards +from FILE-NAME, return the directory containing FILE-NAME. When +FILE-NAME is nil, return `default-directory'." + (let ((file-name (or file-name (buffer-file-name))) + (module-components (if (stringp module) + (split-string module (rx ".")) + (copy-sequence module)))) + (if (and module-components file-name) + (let ((parts (nreverse module-components)) + (base-directory (directory-file-name + (file-name-sans-extension file-name)))) + (while (and parts + (string= (file-name-nondirectory base-directory) + (car parts))) + (pop parts) + (setq base-directory (directory-file-name + (file-name-directory base-directory)))) + (file-name-as-directory base-directory)) + (if file-name + (file-name-directory file-name) + (expand-file-name default-directory))))) + + +;;; Minibuffer tools +(defvar read-flycheck-checker-history nil + "`completing-read' history of `read-flycheck-checker'.") + +(defun read-flycheck-checker (prompt &optional default property candidates) + "Read a flycheck checker from minibuffer with PROMPT and DEFAULT. + +PROMPT is a string to show in the minibuffer as prompt. It +should end with a single space. DEFAULT is a symbol denoting the +default checker to use, if the user did not select any checker. +PROPERTY is a symbol denoting a syntax checker property. If +non-nil, only complete syntax checkers which have a non-nil value +for PROPERTY. CANDIDATES is an optional list of all syntax +checkers available for completion, defaulting to all defined +checkers. If given, PROPERTY is ignored. + +Return the checker as symbol, or DEFAULT if no checker was +chosen. If DEFAULT is nil and no checker was chosen, signal a +`user-error' if the underlying completion system does not provide +a default on its own." + (when (and default (not (flycheck-valid-checker-p default))) + (error "%S is no valid Flycheck checker" default)) + (let* ((candidates (mapcar #'symbol-name + (or candidates + (flycheck-defined-checkers property)))) + (default (and default (symbol-name default))) + (input (pcase flycheck-completion-system + (`ido (ido-completing-read prompt candidates nil + 'require-match nil + 'read-flycheck-checker-history + default)) + (`grizzl (if (and (fboundp 'grizzl-make-index) + (fboundp 'grizzl-completing-read)) + (grizzl-completing-read + prompt (grizzl-make-index candidates)) + (user-error "Please install Grizzl from \ +https://github.com/d11wtq/grizzl"))) + (_ (completing-read prompt candidates nil 'require-match + nil 'read-flycheck-checker-history + default))))) + (when (string-empty-p input) + (unless default + (user-error "No syntax checker selected")) + (setq input default)) + (let ((checker (intern input))) + (unless (flycheck-valid-checker-p checker) + (error "%S is no Flycheck syntax checker" checker)) + checker))) + + +;;; Checker API +(defun flycheck-defined-checkers (&optional property) + "Find all defined syntax checkers, optionally with PROPERTY. + +PROPERTY is a symbol. If given, only return syntax checkers with +a non-nil value for PROPERTY. + +The returned list is sorted alphapetically by the symbol name of +the syntax checkers." + (let (defined-checkers) + (mapatoms (lambda (symbol) + (when (and (flycheck-valid-checker-p symbol) + (or (null property) (get symbol property))) + (push symbol defined-checkers)))) + (sort defined-checkers #'string<))) + +(defun flycheck-registered-checker-p (checker) + "Determine whether CHECKER is registered. + +A checker is registered if it is contained in +`flycheck-checkers'." + (and (flycheck-valid-checker-p checker) + (memq checker flycheck-checkers))) + +(defun flycheck-disabled-checker-p (checker) + "Determine whether CHECKER is disabled. + +A checker is disabled if it is contained in +`flycheck-disabled-checkers'." + (memq checker flycheck-disabled-checkers)) + +(defun flycheck-possibly-suitable-checkers () + "Find possibly suitable checkers for the current buffer. + +Return a list of all syntax checkers which could possibly be +suitable for the current buffer, if any problems in their setup +were fixed. + +Currently this function collects all registered syntax checkers +whose `:modes' contain the current major mode or which do not +have any `:modes', but a `:predicate' that returns non-nil for +the current buffer." + (let (checkers) + (dolist (checker flycheck-checkers) + (let ((modes (flycheck-checker-modes checker)) + (predicate (flycheck-checker-predicate checker))) + (when (or (memq major-mode modes) + (and (not modes) + (functionp predicate) + (funcall predicate))) + (push checker checkers)))) + (nreverse checkers))) + + +;;; Generic syntax checkers +(defconst flycheck-generic-checker-version 2 + "The internal version of generic syntax checker declarations. + +Flycheck will not use syntax checkers whose generic version is +less than this constant.") + +(defun flycheck-validate-next-checker (next &optional strict) + "Validate NEXT checker. + +With STRICT non-nil, also check whether the syntax checker and +the error level in NEXT are valid. Otherwise just check whether +these are symbols. + +Signal an error if NEXT is not a valid entry for +`:next-checkers'." + (when (symbolp next) + (setq next (cons t next))) + (pcase next + (`(,level . ,checker) + (if strict + (progn + (unless (or (eq level t) (flycheck-error-level-p level)) + (error "%S is not a valid Flycheck error level" level)) + (unless (flycheck-valid-checker-p checker) + (error "%s is not a valid Flycheck syntax checker" checker))) + (unless (symbolp level) + (error "Error level %S must be a symbol" level)) + (unless (symbolp checker) + (error "Checker %S must be a symbol" checker)))) + (_ (error "%S must be a symbol or cons cell" next))) + t) + +(defun flycheck-define-generic-checker (symbol docstring &rest properties) + "Define SYMBOL as generic syntax checker. + +Any syntax checker defined with this macro is eligible for manual +syntax checker selection with `flycheck-select-checker'. To make +the new syntax checker available for automatic selection, it must +be registered in `flycheck-checkers'. + +DOCSTRING is the documentation of the syntax checker, for +`flycheck-describe-checker'. The following PROPERTIES constitute +a generic syntax checker. Unless otherwise noted, all properties +are mandatory. + +`:start FUNCTION' + A function to start the syntax checker. + + FUNCTION shall take two arguments and return a context + object if the checker is started successfully. Otherwise it + shall signal an error. + + The first argument is the syntax checker being started. The + second is a callback function to report state changes to + Flycheck. The callback takes two arguments STATUS DATA, + where STATUS is a symbol denoting the syntax checker status + and DATA an optional argument with additional data for the + status report. See `flycheck-report-buffer-checker-status' + for more information about STATUS and DATA. + + FUNCTION may be synchronous or asynchronous, i.e. it may + call the given callback either immediately, or at some later + point (e.g. from a process sentinel). + + A syntax checker _must_ call CALLBACK at least once with a + STATUS that finishes the current syntax checker. Otherwise + Flycheck gets stuck at the current syntax check with this + syntax checker. + + The context object returned by FUNCTION is passed to + `:interrupt'. + +`:interrupt FUNCTION' + A function to interrupt the syntax check. + + FUNCTION is called with the syntax checker and the context + object returned by the `:start' function and shall try to + interrupt the syntax check. The context may be nil, if the + syntax check is interrupted before actually started. + FUNCTION should handle this situation. + + If it cannot interrupt the syntax check, it may either + signal an error or silently ignore the attempt to interrupt + the syntax checker, depending on the severity of the + situation. + + If interrupting the syntax check failed, Flycheck will let + the syntax check continue, but ignore any status reports. + Notably, it won't highlight any errors reported by the + syntax check in the buffer. + + This property is optional. If omitted, Flycheck won't + attempt to interrupt syntax checks wit this syntax checker, + and simply ignore their results. + +`:print-doc FUNCTION' + A function to print additional documentation into the Help + buffer of this checker. + + FUNCTION is called when creating the Help buffer for the + syntax checker, with the syntax checker as single argument, + after printing the name of the syntax checker and its modes + and predicate, but before printing DOCSTRING. It may insert + additional documentation into the current buffer. + + The call occurs within `with-help-window'. Hence + `standard-output' points to the current buffer, so you may + use `princ' and friends to add content. Also, the current + buffer is put into Help mode afterwards, which automatically + turns symbols into references, if possible. + + This property is optional. If omitted, no additional + documentation is printed for this syntax checker. + +:verify FUNCTION + A function to verify the checker for the current buffer. + + FUNCTION is called with the syntax checker as single + argument, and shall return a list of + `flycheck-verification-result' objects indicating whether + the syntax checker could be used in the current buffer, and + highlighting potential setup problems. + + This property is optional. If omitted, no additional + verification occurs for this syntax checker. It is however + absolutely recommended that you add a `:verify' function to + your syntax checker, because it will help users to spot + potential setup problems. + +`:modes MODES' + A major mode symbol or a list thereof, denoting major modes + to use this syntax checker in. + + If given this syntax checker is only used in buffers whose + `major-mode' is `eq' to any mode in MODES. + + If `:predicate' is also given, the syntax checker will only + be used in buffers for which the `:predicate' returns + non-nil. + + This property is optional, however at least one of `:modes' + or `:predicate' must be given. + +`:predicate FUNCTION' + A function to determine whether to use the syntax checker in + the current buffer. + + FUNCTION is called without arguments and shall return + non-nil if this syntax checker shall be used to check the + current buffer. Otherwise it shall return nil. + + If `:modes' is also given, FUNCTION is only called in + matching major modes. + + This property is optional, however at least one of `:modes' + or `:predicate' must be given. + +`:error-filter FUNCTION' + A function to filter the errors returned by this checker. + + FUNCTION is called with the list of `flycheck-error' objects + returned by the syntax checker and shall return another list + of `flycheck-error' objects, which is considered the final + result of this syntax checker. + + FUNCTION is free to add, remove or modify errors, whether in + place or by copying. + + This property is optional. The default filter is + `identity'. + +`:next-checkers NEXT-CHECKERS' + A list denoting syntax checkers to apply after this syntax + checker, in what we call \"chaining\" of syntax checkers. + + Each ITEM is a cons cell `(LEVEL . CHECKER)'. CHECKER is a + syntax checker to run after this syntax checker. LEVEL is + an error level. CHECKER will only be used if there are no + current errors of at least LEVEL. LEVEL may also be t, in + which case CHECKER is used regardless of the current errors. + + ITEM may also be a syntax checker symbol, which is + equivalent to `(t . ITEM)'. + + Flycheck tries all items in order of declaration, and uses + the first whose LEVEL matches and whose CHECKER is + registered and can be used for the current buffer. + + This feature is typically used to apply more than one syntax + checker to a buffer. For instance, you might first use a + compiler to check a buffer for syntax and type errors, and + then run a linting tool that checks for insecure code, or + questionable style. + + This property is optional. If omitted, it defaults to the + nil, i.e. no other syntax checkers are applied after this + syntax checker. + +Signal an error, if any property has an invalid value." + (declare (indent 1) + (doc-string 2)) + (let ((start (plist-get properties :start)) + (interrupt (plist-get properties :interrupt)) + (print-doc (plist-get properties :print-doc)) + (modes (plist-get properties :modes)) + (predicate (plist-get properties :predicate)) + (verify (plist-get properties :verify)) + (filter (or (plist-get properties :error-filter) #'identity)) + (next-checkers (plist-get properties :next-checkers)) + (file (flycheck-current-load-file))) + + (unless (listp modes) + (setq modes (list modes))) + + (unless (functionp start) + (error ":start %S of syntax checker %s is not a function" symbol start)) + (unless (or (null interrupt) (functionp interrupt)) + (error ":interrupt %S of syntax checker %s is not a function" + symbol interrupt)) + (unless (or (null print-doc) (functionp print-doc)) + (error ":print-doc %S of syntax checker %s is not a function" + symbol print-doc)) + (unless (or (null verify) (functionp verify)) + (error ":verify %S of syntax checker %S is not a function" + symbol verify)) + (unless (or modes predicate) + (error "Missing :modes or :predicate in syntax checker %s" symbol)) + (dolist (mode modes) + (unless (symbolp mode) + (error "Invalid :modes %s in syntax checker %s, %s must be a symbol" + modes symbol mode))) + (unless (or (null predicate) (functionp predicate)) + (error ":predicate %S of syntax checker %s is not a function" + symbol predicate)) + (unless (functionp filter) + (error ":error-filter %S of syntax checker %s is not a function" + symbol filter)) + (dolist (checker next-checkers) + (flycheck-validate-next-checker checker)) + + (let ((real-predicate (lambda () + (if (flycheck-valid-checker-p symbol) + (or (null predicate) (funcall predicate)) + (lwarn 'flycheck :warning "%S is no valid Flycheck syntax checker. +Try to reinstall the package defining this syntax checker." symbol) + nil)))) + (pcase-dolist (`(,prop . ,value) + `((flycheck-start . ,start) + (flycheck-interrupt . ,interrupt) + (flycheck-print-doc . ,print-doc) + (flycheck-modes . ,modes) + (flycheck-predicate . ,real-predicate) + (flycheck-verify . ,verify) + (flycheck-error-filter . ,filter) + (flycheck-next-checkers . ,next-checkers) + (flycheck-documentation . ,docstring) + (flycheck-file . ,file))) + (put symbol prop value))) + + ;; Track the version, to avoid breakage if the internal format changes + (put symbol 'flycheck-generic-checker-version + flycheck-generic-checker-version))) + +(defun flycheck-valid-checker-p (checker) + "Check whether a CHECKER is valid. + +A valid checker is a symbol defined as syntax checker with +`flycheck-define-checker'." + (and (symbolp checker) + (= (or (get checker 'flycheck-generic-checker-version) 0) + flycheck-generic-checker-version))) + +(defun flycheck-checker-modes (checker) + "Get the modes of CHECKER." + (get checker 'flycheck-modes)) + +(defun flycheck-checker-predicate (checker) + "Get the predicate function of CHECKER." + (get checker 'flycheck-predicate)) + +(defun flycheck-checker-next-checkers (checker) + "Get the next checkers for CHECKER." + (get checker 'flycheck-next-checkers)) + +(defun flycheck-checker-error-filter (checker) + "Get the error filter of CHECKER." + (get checker 'flycheck-error-filter)) + +(defun flycheck-checker-documentation (checker) + "Get the documentation of CHECKER." + (documentation-property checker 'flycheck-documentation)) + +(defun flycheck-checker-file (checker) + "Get the file CHECKER was defined in. + +Return nil if the file cannot be determined." + (get checker 'flycheck-file)) + +(defun flycheck-may-use-checker (checker) + "Whether a generic CHECKER may be used. + +Return non-nil if CHECKER may be used for the current buffer, and +nil otherwise." + (let ((modes (flycheck-checker-modes checker)) + (predicate (flycheck-checker-predicate checker))) + (and (flycheck-valid-checker-p checker) + (not (flycheck-disabled-checker-p checker)) + (or (not modes) (memq major-mode modes)) + (funcall predicate)))) + +(defun flycheck-may-use-next-checker (next-checker) + "Determine whether NEXT-CHECKER may be used." + (when (symbolp next-checker) + (push t next-checker)) + (let ((level (car next-checker)) + (next-checker (cdr next-checker))) + (and (or (eq level t) + (flycheck-has-max-current-errors-p level)) + (flycheck-registered-checker-p next-checker) + (flycheck-may-use-checker next-checker)))) + + +;;; Help for generic syntax checkers +(define-button-type 'help-flycheck-checker-def + :supertype 'help-xref + 'help-function #'flycheck-goto-checker-definition + 'help-echo "mouse-2, RET: find Flycheck checker definition") + +(defconst flycheck-find-checker-regexp + (rx line-start (zero-or-more (syntax whitespace)) + "(" symbol-start "flycheck-define-checker" symbol-end + (eval (list 'regexp find-function-space-re)) + symbol-start + "%s" + symbol-end + (or (syntax whitespace) line-end)) + "Regular expression to find a checker definition.") + +(add-to-list 'find-function-regexp-alist + '(flycheck-checker . flycheck-find-checker-regexp)) + +(defun flycheck-goto-checker-definition (checker file) + "Go to to the definition of CHECKER in FILE." + (let ((location (find-function-search-for-symbol + checker 'flycheck-checker file))) + (pop-to-buffer (car location)) + (if (cdr location) + (goto-char (cdr location)) + (message "Unable to find checker location in file")))) + +(defun flycheck-checker-at-point () + "Return the Flycheck checker found at or before point. + +Return 0 if there is no checker." + (let ((symbol (variable-at-point 'any-symbol))) + (if (and (symbolp symbol) (flycheck-valid-checker-p symbol)) + symbol + 0))) + +(defun flycheck-describe-checker (checker) + "Display the documentation of CHECKER. + +CHECKER is a checker symbol. + +Pop up a help buffer with the documentation of CHECKER." + (interactive + (let* ((checker (flycheck-checker-at-point)) + (enable-recursive-minibuffers t) + (prompt (if (symbolp checker) + (format "Describe syntax checker (default %s): " checker) + "Describe syntax checker: ")) + (reply (read-flycheck-checker prompt))) + (list (or reply checker)))) + (if (or (null checker) (not (flycheck-valid-checker-p checker))) + (message "You didn't specify a Flycheck syntax checker.") + (help-setup-xref (list #'flycheck-describe-checker checker) + (called-interactively-p 'interactive)) + (save-excursion + (with-help-window (help-buffer) + (let ((filename (flycheck-checker-file checker)) + (modes (flycheck-checker-modes checker)) + (predicate (flycheck-checker-predicate checker)) + (print-doc (get checker 'flycheck-print-doc))) + (princ (format "%s is a Flycheck syntax checker" checker)) + (when filename + (princ (format " in `%s'" (file-name-nondirectory filename))) + (with-current-buffer standard-output + (save-excursion + (re-search-backward "`\\([^`']+\\)'" nil t) + (help-xref-button 1 'help-flycheck-checker-def checker filename)))) + (princ ".\n\n") + + (let ((modes-start (with-current-buffer standard-output (point-max)))) + ;; Track the start of the modes documentation, to properly re-fill + ;; it later + (if (not modes) + ;; Syntax checkers without modes must have a predicate + (princ " This syntax checker checks syntax if a custom predicate holds") + (princ " This syntax checker checks syntax in the major mode(s) ") + (princ (string-join + (mapcar (apply-partially #'format "`%s'") modes) + ", ")) + (when predicate + (princ ", and uses a custom predicate"))) + (princ ".") + (with-current-buffer standard-output + (save-excursion + (fill-region-as-paragraph modes-start (point-max))))) + (princ "\n") + ;; Call the custom print-doc function of the checker, if present + (when print-doc + (funcall print-doc checker)) + ;; Ultimately, print the docstring + (princ "\nDocumentation:\n") + (princ (flycheck-checker-documentation checker))))))) + + +;;; Syntax checker verification +(cl-defstruct (flycheck-verification-result + (:constructor flycheck-verification-result-new)) + "Structure for storing a single verification result. + +Slots: + +`label' + A label for this result, as string + +`message' + A message for this result, as string + +`face' + The face to use for the `message'. + + You can either use a face symbol, or a list of face symbols." + label message face) + +(defun flycheck-verify-generic-checker (checker) + "Verify a generic CHECKER in the current buffer. + +Return a list of `flycheck-verification-result' objects." + (let (results + (predicate (flycheck-checker-predicate checker)) + (verify (get checker 'flycheck-verify))) + (when predicate + (let ((result (funcall predicate))) + (push (flycheck-verification-result-new + :label "predicate" + :message (prin1-to-string (not (null result))) + :face (if result 'success '(bold warning))) + results))) + (append (nreverse results) + (and verify (funcall verify checker))))) + +(define-button-type 'help-flycheck-checker-doc + :supertype 'help-xref + 'help-function #'flycheck-describe-checker + 'help-echo "mouse-2, RET: describe Flycheck checker") + +(defun flycheck-verify-setup () + "Check whether Flycheck can be used in this buffer. + +Display a new buffer listing all syntax checkers that could be +applicable in the current buffer. For each syntax checkers, +possible problems are shown." + (interactive) + (when (and (buffer-file-name) (buffer-modified-p)) + ;; Save the buffer + (save-buffer)) + + (let ((buffer (current-buffer)) + (checkers (flycheck-possibly-suitable-checkers))) + + ;; Now print all applicable checkers + (with-help-window (get-buffer-create " *Flycheck checkers*") + (with-current-buffer standard-output + (princ "Syntax checkers for buffer ") + (insert (propertize (buffer-name buffer) 'face 'bold)) + (princ " in ") + (let ((mode (buffer-local-value 'major-mode buffer))) + (insert-button (symbol-name mode) + 'type 'help-function + 'help-args (list mode))) + (princ ":\n\n") + (unless checkers + (insert (propertize "There are no syntax checkers for this buffer!\n\n" + 'face '(bold error)))) + (dolist (checker checkers) + (princ " ") + (insert-button (symbol-name checker) + 'type 'help-flycheck-checker-doc + 'help-args (list checker)) + (princ "\n") + (let* ((results (with-current-buffer buffer + (flycheck-verify-generic-checker checker))) + (label-length + (-max (mapcar + (lambda (res) + (length (flycheck-verification-result-label res))) + results))) + (message-column (+ 8 label-length))) + (dolist (result results) + (princ " - ") + (princ (flycheck-verification-result-label result)) + (princ ": ") + (princ (make-string (- message-column (current-column)) ?\ )) + (let ((message (flycheck-verification-result-message result)) + (face (flycheck-verification-result-face result))) + (insert (propertize message 'face face))) + (princ "\n"))) + (princ "\n")) + (princ "Flycheck Mode is ") + (let ((enabled (buffer-local-value 'flycheck-mode buffer))) + (insert (propertize (if enabled "enabled" "disabled") + 'face (if enabled 'success '(warning bold))))) + (princ ".\n") + + (let ((unregistered-checkers (-difference (flycheck-defined-checkers) + flycheck-checkers))) + (when unregistered-checkers + (insert (propertize "\nThe following syntax checkers are not registered:\n\n" + 'face '(bold warning))) + (dolist (checker unregistered-checkers) + (princ " - ") + (princ checker) + (princ "\n")) + (princ "\nTry adding these syntax checkers to `flycheck-checkers'."))))))) + + +;;; Predicates for generic syntax checkers +(defun flycheck-buffer-saved-p (&optional buffer) + "Determine whether BUFFER is saved to a file. + +BUFFER is the buffer to check. If omitted or nil, use the +current buffer as BUFFER. + +Return non-nil if the BUFFER is backed by a file, and not +modified, or nil otherwise." + (and (buffer-file-name buffer) (not (buffer-modified-p buffer)))) + + +;;; Extending generic checkers +(defun flycheck-add-next-checker (checker next &optional append) + "Add a NEXT checker after CHECKER. + +CHECKER is a syntax checker symbol, to which to add NEXT checker. + +NEXT is a cons cell `(LEVEL . NEXT-CHECKER)'. NEXT-CHECKER is a +symbol denoting the syntax checker to run after CHECKER. LEVEL +is an error level. NEXT-CHECKER will only be used if there is no +current error whose level is more severe than LEVEL. LEVEL may +also be t, in which case NEXT-CHECKER is used regardless of the +current errors. + +NEXT can also be a syntax checker symbol only, which is +equivalent to `(t . NEXT)'. + +NEXT-CHECKER is prepended before other next checkers, unless +APPEND is non-nil." + (unless (flycheck-valid-checker-p checker) + (error "%s is not a valid syntax checker" checker)) + (flycheck-validate-next-checker next 'strict) + (if append + (put checker 'flycheck-next-checkers + (append (get checker 'flycheck-next-checkers) (list next))) + (push next (get checker 'flycheck-next-checkers)))) + +(defun flycheck-add-mode (checker mode) + "Add a new major MODE to CHECKER. + +CHECKER and MODE are symbols denoting a syntax checker and a +major mode respectively. + +Add MODE to the `:modes' property of CHECKER, so that CHECKER +will be used in buffers with MODE." + (unless (flycheck-valid-checker-p checker) + (error "%s is not a valid syntax checker" checker)) + (unless (symbolp mode) + (error "%s is not a symbol" mode)) + (push mode (get checker 'flycheck-modes))) + + +;;; Generic syntax checks +(cl-defstruct (flycheck-syntax-check + (:constructor flycheck-syntax-check-new)) + "Structure for storing syntax check state. + +Slots: + +`buffer' + The buffer being checked + +`checker' + The syntax checker being used + +`context' + The context object." + buffer checker context) + +(defun flycheck-syntax-check-start (syntax-check callback) + "Start a SYNTAX-CHECK with CALLBACK." + (let ((checker (flycheck-syntax-check-checker syntax-check))) + (setf (flycheck-syntax-check-context syntax-check) + (funcall (get checker 'flycheck-start) checker callback)))) + +(defun flycheck-syntax-check-interrupt (syntax-check) + "Interrupt a SYNTAX-CHECK." + (let* ((checker (flycheck-syntax-check-checker syntax-check)) + (interrupt-fn (get checker 'flycheck-interrupt)) + (context (flycheck-syntax-check-context syntax-check))) + (when interrupt-fn + (funcall interrupt-fn checker context)))) + + +;;; Syntax checking mode + +(defvar flycheck-mode-map + (let ((map (make-sparse-keymap))) + (define-key map flycheck-keymap-prefix flycheck-command-map) + ;; We place the menu under a custom menu key. Since this menu key is not + ;; present in the menu of the global map, no top-level menu entry is added + ;; to the global menu bar. However, it still appears on the mode line + ;; lighter. + (define-key map [menu-bar flycheck] flycheck-mode-menu-map) + map) + "Keymap of `flycheck-mode'.") + +(defvar-local flycheck-old-next-error-function nil + "Remember the old `next-error-function'.") + +(defconst flycheck-hooks-alist + '( + ;; Handle events that may start automatic syntax checks + (after-save-hook . flycheck-handle-save) + (after-change-functions . flycheck-handle-change) + ;; Handle events that may triggered pending deferred checks + (window-configuration-change-hook . flycheck-perform-deferred-syntax-check) + (post-command-hook . flycheck-perform-deferred-syntax-check) + ;; Teardown Flycheck whenever the buffer state is about to get lost, to + ;; clean up temporary files and directories. + (kill-buffer-hook . flycheck-teardown) + (change-major-mode-hook . flycheck-teardown) + (before-revert-hook . flycheck-teardown) + ;; Update the error list if necessary + (post-command-hook . flycheck-error-list-update-source) + (post-command-hook . flycheck-error-list-highlight-errors) + ;; Show or hide error popups after commands + (post-command-hook . flycheck-display-error-at-point-soon) + (post-command-hook . flycheck-hide-error-buffer) + ;; Immediately show error popups when navigating to an error + (next-error-hook . flycheck-display-error-at-point)) + "Hooks which Flycheck needs to hook in. + +The `car' of each pair is a hook variable, the `cdr' a function +to be added or removed from the hook variable if Flycheck mode is +enabled and disabled respectively.") + +;;;###autoload +(define-minor-mode flycheck-mode + "Minor mode for on-the-fly syntax checking. + +When called interactively, toggle `flycheck-mode'. With prefix +ARG, enable `flycheck-mode' if ARG is positive, otherwise disable +it. + +When called from Lisp, enable `flycheck-mode' if ARG is omitted, +nil or positive. If ARG is `toggle', toggle `flycheck-mode'. +Otherwise behave as if called interactively. + +In `flycheck-mode' the buffer is automatically syntax-checked +using the first suitable syntax checker from `flycheck-checkers'. +Use `flycheck-select-checker' to select a checker for the current +buffer manually. + +\\{flycheck-mode-map}" + :init-value nil + :keymap flycheck-mode-map + :lighter flycheck-mode-line + :after-hook (flycheck-buffer-automatically 'mode-enabled 'force-deferred) + (cond + (flycheck-mode + (flycheck-clear) + + (pcase-dolist (`(,hook . ,fn) flycheck-hooks-alist) + (add-hook hook fn nil 'local)) + + (setq flycheck-old-next-error-function (if flycheck-standard-error-navigation + next-error-function + :unset)) + (when flycheck-standard-error-navigation + (setq next-error-function #'flycheck-next-error-function))) + (t + (unless (eq flycheck-old-next-error-function :unset) + (setq next-error-function flycheck-old-next-error-function)) + + (pcase-dolist (`(,hook . ,fn) flycheck-hooks-alist) + (remove-hook hook fn 'local)) + + (flycheck-teardown)))) + + +;;; Syntax checker selection for the current buffer +(defvar-local flycheck-last-checker nil + "The last checker used for the current buffer.") + +(defun flycheck-get-checker-for-buffer () + "Find the checker for the current buffer. + +Use the selected checker for the current buffer, if any, +otherwise search for the best checker from `flycheck-checkers'. + +Return checker if there is a checker for the current buffer, or +nil otherwise." + (if flycheck-checker + (if (flycheck-may-use-checker flycheck-checker) + flycheck-checker + (user-error "Selected syntax checker %s cannot be used" + flycheck-checker)) + (let ((checkers flycheck-checkers)) + (while (and checkers (not (flycheck-may-use-checker (car checkers)))) + (setq checkers (cdr checkers))) + (car checkers)))) + +(defun flycheck-get-next-checker-for-buffer (checker) + "Get the checker to run after CHECKER for the current buffer." + (let ((next-checkers (flycheck-checker-next-checkers checker))) + (while (and next-checkers + (not (flycheck-may-use-next-checker (car next-checkers)))) + (setq next-checkers (cdr next-checkers))) + (when next-checkers + (if (symbolp (car next-checkers)) + (car next-checkers) + (cdar next-checkers))))) + +(defun flycheck-select-checker (checker) + "Select CHECKER for the current buffer. + +CHECKER is a syntax checker symbol (see `flycheck-checkers') or +nil. In the former case, use CHECKER for the current buffer, +otherwise deselect the current syntax checker (if any) and use +automatic checker selection via `flycheck-checkers'. + +If called interactively prompt for CHECKER. With prefix arg +deselect the current syntax checker and enable automatic +selection again. + +Set `flycheck-checker' to CHECKER and automatically start a new +syntax check if the syntax checker changed. + +CHECKER will be used, even if it is not contained in +`flycheck-checkers', or if it is disabled via +`flycheck-disabled-checkers'." + (interactive + (if current-prefix-arg + (list nil) + (list (read-flycheck-checker "Select checker: " + (flycheck-get-checker-for-buffer))))) + (when (not (eq checker flycheck-checker)) + (unless (or (not checker) (flycheck-may-use-checker checker)) + (user-error "Can't use syntax checker %S in this buffer" checker)) + (setq flycheck-checker checker) + (when flycheck-mode + (flycheck-buffer)))) + +(defun flycheck-disable-checker (checker &optional enable) + "Interactively disable CHECKER for the current buffer. + +Interactively, prompt for a syntax checker to disable, and add +the syntax checker to the buffer-local value of +`flycheck-disabled-checkers'. With prefix arg, prompt for a +disabled syntax checker and re-enable it by removing it from the +buffer-local value of `flycheck-disabled-checkers'." + (declare (interactive-only "Directly set `flycheck-disabled-checkers' instead")) + (interactive + (let* ((enable current-prefix-arg) + (candidates (if enable flycheck-disabled-checkers flycheck-checkers)) + (prompt (if enable "Enable syntax checker: " + "Disable syntax checker: "))) + (when (and enable (not candidates)) + (user-error "No syntax checkers disabled in this buffer")) + (list (read-flycheck-checker prompt nil nil candidates) enable))) + (unless checker + (user-error "No syntax checker given")) + (if enable + ;; We must use `remq' instead of `delq', because we must _not_ modify the + ;; list. Otherwise we could potentially modify the global default value, + ;; in case the list is the global default. + (when (memq checker flycheck-disabled-checkers) + (setq flycheck-disabled-checkers + (remq checker flycheck-disabled-checkers)) + (flycheck-buffer)) + (unless (memq checker flycheck-disabled-checkers) + (push checker flycheck-disabled-checkers) + (flycheck-buffer)))) + + +;;; Syntax checks for the current buffer +(defvar-local flycheck-current-syntax-check nil + "The current syntax check in the this buffer.") +(put 'flycheck-current-syntax-check 'permanent-local t) + +(defun flycheck-start-current-syntax-check (checker) + "Start a syntax check in the current buffer with CHECKER. + +Set `flycheck-current-syntax-check' accordingly." + ;; Allocate the current syntax check *before* starting it. This allows for + ;; synchronous checks, which call the status callback immediately in there + ;; start function. + (let* ((check (flycheck-syntax-check-new :buffer (current-buffer) + :checker checker + :context nil)) + (callback (flycheck-buffer-status-callback check))) + (setq flycheck-current-syntax-check check) + (flycheck-report-status 'running) + (flycheck-syntax-check-start check callback))) + +(defun flycheck-running-p () + "Determine whether a syntax check is running in the current buffer." + (not (null flycheck-current-syntax-check))) + +(defun flycheck-stop () + "Stop any ongoing syntax check in the current buffer." + (when (flycheck-running-p) + (flycheck-syntax-check-interrupt flycheck-current-syntax-check) + ;; Remove the current syntax check, to reset Flycheck into a non-running + ;; state, and to make `flycheck-report-buffer-checker-status' ignore any + ;; status reports from the current syntax check. + (setq flycheck-current-syntax-check nil) + (flycheck-report-status 'interrupted))) + +(defun flycheck-buffer-status-callback (syntax-check) + "Create a status callback for SYNTAX-CHECK in the current buffer." + (lambda (&rest args) + (apply #'flycheck-report-buffer-checker-status + syntax-check args))) + +(defun flycheck-buffer () + "Start checking syntax in the current buffer. + +Get a syntax checker for the current buffer with +`flycheck-get-checker-for-buffer', and start it." + (interactive) + (flycheck-clean-deferred-check) + (if flycheck-mode + (unless (flycheck-running-p) + ;; Clear error list and mark all overlays for deletion. We do not + ;; delete all overlays immediately to avoid excessive re-displays and + ;; flickering, if the same errors gets highlighted again after the check + ;; completed. + (run-hooks 'flycheck-before-syntax-check-hook) + (flycheck-clear-errors) + (flycheck-mark-all-overlays-for-deletion) + (condition-case err + (let* ((checker (flycheck-get-checker-for-buffer))) + (if checker + (flycheck-start-current-syntax-check checker) + (flycheck-clear) + (flycheck-report-status 'no-checker))) + (error + (flycheck-report-failed-syntax-check) + (signal (car err) (cdr err))))) + (user-error "Flycheck mode disabled"))) + +(defun flycheck-report-buffer-checker-status + (syntax-check status &optional data) + "In BUFFER, report a SYNTAX-CHECK STATUS with DATA. + +SYNTAX-CHECK is the `flycheck-syntax-check' which reported +STATUS. STATUS denotes the status of CHECKER, with an optional +DATA. STATUS may be one of the following symbols: + +`errored' + The syntax checker has errored. DATA is an optional error + message. + + This report finishes the current syntax check. + +`interrupted' + The syntax checker was interrupted. DATA is ignored. + + This report finishes the current syntax check. + +`finished' + The syntax checker has finished with a proper error report + for the current buffer. DATA is the (potentially empty) + list of `flycheck-error' objects reported by the syntax + check. + + This report finishes the current syntax check. + +`suspicious' + The syntax checker encountered a suspicious state, which the + user needs to be informed about. DATA is an optional + message. + +A syntax checker _must_ report a status at least once with any +symbol that finishes the current syntax checker. Otherwise +Flycheck gets stuck with the current syntax check. + +If CHECKER is not the currently used syntax checker in +`flycheck-current-syntax-check', the status report is largely +ignored. Notably, any errors reported by the checker are +discarded." + (let ((buffer (flycheck-syntax-check-buffer syntax-check))) + ;; Ignore the status report if the buffer is gone, or if this syntax check + ;; isn't the current one in buffer (which can happen if this is an old + ;; report of an interrupted syntax check, and a new syntax check was started + ;; since this check was interrupted) + (when (and (buffer-live-p buffer) + (eq syntax-check + (buffer-local-value 'flycheck-current-syntax-check buffer))) + (with-current-buffer buffer + (let ((checker (flycheck-syntax-check-checker syntax-check))) + (pcase status + ((or `errored `interrupted) + (flycheck-report-failed-syntax-check status) + (when (eq status 'errored) + ;; In case of error, show the error message + (message "Error from syntax checker %s: %s" + checker (or data "UNKNOWN!")))) + (`suspicious + (when flycheck-mode + (message "Suspicious state from syntax checker %s: %s" + checker (or data "UNKNOWN!"))) + (flycheck-report-status 'suspicious)) + (`finished + (when flycheck-mode + ;; Only report errors from the checker if Flycheck Mode is + ;; still enabled. + (flycheck-finish-current-syntax-check data))) + (_ + (error "Unknown status %s from syntax checker %s" + status checker)))))))) + +(defun flycheck-finish-current-syntax-check (errors) + "Finish the current syntax-check in the current buffer with ERRORS. + +ERRORS is a list of `flycheck-error' objects reported by the +current syntax check in `flycheck-current-syntax-check'. + +Report all ERRORS and potentially start any next syntax checkers. + +If the current syntax checker reported excessive errors, it is disabled +via `flycheck-disable-excessive-checker' for subsequent syntax +checks." + (let* ((syntax-check flycheck-current-syntax-check) + (checker (flycheck-syntax-check-checker syntax-check)) + (errors (flycheck-relevant-errors + (flycheck-filter-errors + (flycheck-assert-error-list-p errors) checker)))) + (unless (flycheck-disable-excessive-checker checker errors) + (flycheck-report-current-errors errors)) + (let ((next-checker (flycheck-get-next-checker-for-buffer checker))) + (if next-checker + (flycheck-start-current-syntax-check next-checker) + (setq flycheck-current-syntax-check nil) + (flycheck-report-status 'finished) + ;; Delete overlays only after the very last checker has run, to avoid + ;; flickering on intermediate re-displays + (flycheck-delete-marked-overlays) + (flycheck-error-list-refresh) + (run-hooks 'flycheck-after-syntax-check-hook) + (when (eq (current-buffer) (window-buffer)) + (flycheck-display-error-at-point)) + ;; Immediately try to run any pending deferred syntax check, which + ;; were triggered by intermediate automatic check event, to make sure + ;; that we quickly refine outdated error information + (flycheck-perform-deferred-syntax-check))))) + +(defun flycheck-disable-excessive-checker (checker errors) + "Disable CHECKER if it reported excessive ERRORS. + +If ERRORS has more items than `flycheck-checker-error-threshold', +add CHECKER to `flycheck-disabled-checkers', and show a warning. + +Return t when CHECKER was disabled, or nil otherwise." + (when (and flycheck-checker-error-threshold + (> (length errors) flycheck-checker-error-threshold)) + ;; Disable CHECKER for this buffer (`flycheck-disabled-checkers' is a local + ;; variable). + (lwarn '(flycheck syntax-checker) :warning + "Syntax checker %s reported too many errors (%s) and is disabled." + checker (length errors)) + (push checker flycheck-disabled-checkers) + t)) + +(defun flycheck-clear (&optional shall-interrupt) + "Clear all errors in the current buffer. + +With prefix arg or SHALL-INTERRUPT non-nil, also interrupt the +current syntax check." + (interactive "P") + (when shall-interrupt + (flycheck-stop)) + (flycheck-delete-all-overlays) + (flycheck-clear-errors) + (flycheck-error-list-refresh) + (flycheck-hide-error-buffer)) + +(defun flycheck-teardown () + "Teardown Flycheck in the current buffer.. + +Completely clear the whole Flycheck state. Remove overlays, kill +running checks, and empty all variables used by Flycheck." + (flycheck-safe-delete-temporaries) + (flycheck-stop) + (flycheck-clean-deferred-check) + (flycheck-clear) + (flycheck-cancel-error-display-error-at-point-timer)) + + +;;; Automatic syntax checking in a buffer +(defun flycheck-may-check-automatically (&optional condition) + "Determine whether the buffer may be checked under CONDITION. + +Read-only buffers may never be checked automatically. + +If CONDITION is non-nil, determine whether syntax may checked +automatically according to +`flycheck-check-syntax-automatically'." + (and (not (or buffer-read-only (flycheck-ephemeral-buffer-p))) + (file-exists-p default-directory) + (or (not condition) + (memq condition flycheck-check-syntax-automatically)))) + +(defun flycheck-buffer-automatically (&optional condition force-deferred) + "Automatically check syntax at CONDITION. + +Syntax is not checked if `flycheck-may-check-automatically' +returns nil for CONDITION. + +The syntax check is deferred if FORCE-DEFERRED is non-nil, or if +`flycheck-must-defer-check' returns t." + (when (and flycheck-mode (flycheck-may-check-automatically condition)) + (if (or force-deferred (flycheck-must-defer-check)) + (flycheck-buffer-deferred) + (with-demoted-errors "Error while checking syntax automatically: %S" + (flycheck-buffer))))) + +(defvar-local flycheck-idle-change-timer nil + "Timer to mark the idle time since the last change.") + +(defun flycheck-clear-idle-change-timer () + "Clear the idle change timer." + (when flycheck-idle-change-timer + (cancel-timer flycheck-idle-change-timer) + (setq flycheck-idle-change-timer nil))) + +(defun flycheck-handle-change (beg end _len) + "Handle a buffer change between BEG and END. + +BEG and END mark the beginning and end of the change text. _LEN +is ignored. + +Start a syntax check if a new line has been inserted into the +buffer." + ;; Save and restore the match data, as recommended in (elisp)Change Hooks + (save-match-data + (when flycheck-mode + ;; The buffer was changed, thus clear the idle timer + (flycheck-clear-idle-change-timer) + (if (string-match-p (rx "\n") (buffer-substring beg end)) + (flycheck-buffer-automatically 'new-line 'force-deferred) + (setq flycheck-idle-change-timer + (run-at-time flycheck-idle-change-delay nil + #'flycheck-handle-idle-change)))))) + +(defun flycheck-handle-idle-change () + "Handle an expired idle time since the last change." + (flycheck-clear-idle-change-timer) + (flycheck-buffer-automatically 'idle-change)) + +(defun flycheck-handle-save () + "Handle a save of the buffer." + (flycheck-buffer-automatically 'save)) + + +;;; Deferred syntax checking +(defvar-local flycheck-deferred-syntax-check nil + "If non-nil, a deferred syntax check is pending.") + +(defun flycheck-must-defer-check () + "Determine whether the syntax check has to be deferred. + +A check has to be deferred if the buffer is not visible, or if the buffer is +currently being reverted. + +Return t if the check is to be deferred, or nil otherwise." + (or (not (get-buffer-window)) + ;; We defer the syntax check if Flycheck is already running, to + ;; immediately start a new syntax check after the current one finished, + ;; because the result of the current check will most likely be outdated by + ;; the time it is finished. + (flycheck-running-p) + ;; We must defer checks while a buffer is being reverted, to avoid race + ;; conditions while the buffer contents are being restored. + revert-buffer-in-progress-p)) + +(defun flycheck-deferred-check-p () + "Determine whether the current buffer has a deferred check. + +Return t if so, or nil otherwise." + flycheck-deferred-syntax-check) + +(defun flycheck-buffer-deferred () + "Defer syntax check for the current buffer." + (setq flycheck-deferred-syntax-check t)) + +(defun flycheck-clean-deferred-check () + "Clean an deferred syntax checking state." + (setq flycheck-deferred-syntax-check nil)) + +(defun flycheck-perform-deferred-syntax-check () + "Perform any deferred syntax checks." + (when (flycheck-deferred-check-p) + (flycheck-clean-deferred-check) + (flycheck-buffer-automatically))) + + +;;; Syntax checking in all buffers +(defun flycheck-may-enable-mode () + "Determine whether Flycheck mode may be enabled. + +Flycheck mode is not enabled for + +- the minibuffer, +- major modes whose `mode-class' property is `special', +- ephemeral buffers (see `flycheck-ephemeral-buffer-p'), +- encrypted buffers (see `flycheck-encrypted-buffer-p'), +- remote files (see `file-remote-p'), +- and major modes excluded by `flycheck-global-modes'. + +Return non-nil if Flycheck mode may be enabled, and nil +otherwise." + (and (pcase flycheck-global-modes + ;; Whether `major-mode' is disallowed by `flycheck-global-modes' + (`t t) + (`(not . ,modes) (not (memq major-mode modes))) + (modes (memq major-mode modes))) + (not (or (minibufferp) + (eq (get major-mode 'mode-class) 'special) + (flycheck-ephemeral-buffer-p) + (flycheck-encrypted-buffer-p) + (and (buffer-file-name) + (file-remote-p (buffer-file-name) 'method)))))) + +(defun flycheck-mode-on-safe () + "Enable `flycheck-mode' if it is safe to do so. + +`flycheck-mode' is only enabled if `flycheck-may-enable-mode' +returns t." + (when (flycheck-may-enable-mode) + (flycheck-mode))) + +;;;###autoload +(define-globalized-minor-mode global-flycheck-mode flycheck-mode + flycheck-mode-on-safe + :init-value nil + ;; Do not expose Global Flycheck Mode on customize interface, because the + ;; interaction between package.el and customize is currently broken. See + ;; https://github.com/flycheck/flycheck/issues/595 + + ;; :require 'flycheck :group + ;; 'flycheck + ) + +(defun flycheck-global-teardown () + "Teardown Flycheck in all buffers. + +Completely clear the whole Flycheck state in all buffers, stop +all running checks, remove all temporary files, and empty all +variables of Flycheck." + (dolist (buffer (buffer-list)) + (with-current-buffer buffer + (when flycheck-mode + (flycheck-teardown))))) + +;; Clean up the entire state of Flycheck when Emacs is killed, to get rid of any +;; pending temporary files. +(add-hook 'kill-emacs-hook #'flycheck-global-teardown) + + +;;; Errors from syntax checks +(cl-defstruct (flycheck-error + (:constructor flycheck-error-new) + (:constructor flycheck-error-new-at (line column + &optional level message + &key checker id + (filename (buffer-file-name)) + (buffer (current-buffer))))) + "Structure representing an error reported by a syntax checker. +Slots: + +`buffer' + The buffer the reported was reported for, as buffer object. + +`checker' + The syntax checker which reported this error, as symbol. + +`filename' + The file name the error refers to, as string. + +`line' + The line number the error refers to, as number. + +`column' (optional) + The column number the error refers to, as number. + + For compatibility with external tools and unlike Emacs + itself (e.g. in Compile Mode) Flycheck uses _1-based_ + columns: The first character on a line is column 1. + + Occasionally some tools try to proactively adapt to Emacs + and emit 0-based columns automatically. In these cases, the + columns must be adjusted for Flycheck, see + `flycheck-increment-error-columns'. + +`level' + The error level, as either `warning' or `error'. + +`id' (optional) + An ID identifying the kind of error." + buffer checker filename line column message level id) + +(defmacro flycheck-error-with-buffer (err &rest forms) + "Switch to the buffer of ERR and evaluate FORMS. + +If the buffer of ERR is not live, FORMS are not evaluated." + (declare (indent 1) (debug t)) + `(when (buffer-live-p (flycheck-error-buffer ,err)) + (with-current-buffer (flycheck-error-buffer ,err) + ,@forms))) + +(defun flycheck-error-line-region (err) + "Get the line region of ERR. + +ERR is a Flycheck error whose region to get. + +Return a cons cell `(BEG . END)' where BEG is the first +non-whitespace character on the line ERR refers to, and END the +end of the line." + (flycheck-error-with-buffer err + (save-restriction + (save-excursion + (widen) + (goto-char (point-min)) + (forward-line (- (flycheck-error-line err) 1)) + ;; We are at the beginning of the line now, so move to the beginning of + ;; its indentation, similar to `back-to-indentation' + (let ((end (line-end-position))) + (skip-syntax-forward " " end) + (backward-prefix-chars) + ;; If the current line is empty, include the previous line break + ;; character(s) to have any region at all. When called with 0, + ;; `line-end-position' gives us the end of the previous line + (cons (if (eolp) (line-end-position 0) (point)) end)))))) + +(defun flycheck-error-column-region (err) + "Get the error column region of ERR. + +ERR is a Flycheck error whose region to get. + +Return a cons cell `(BEG . END)' where BEG is the character +before the error column, and END the actual error column, or nil +if ERR has no column." + (flycheck-error-with-buffer err + (save-restriction + (save-excursion + (-when-let (column (flycheck-error-column err)) + (widen) + (goto-char (point-min)) + (forward-line (- (flycheck-error-line err) 1)) + (cond + ((eobp) ; Line beyond EOF + ;; If we are at the end of the file (i.e. the line was beyond the + ;; end of the file), use the very last column in the file. + (cons (- (point-max) 1) (point-max))) + ((eolp) ; Empty line + ;; If the target line is empty, there's no column to highlight on + ;; this line, so return the last column of the previous line. + (cons (line-end-position 0) (point))) + (t + ;; The end is either the column offset of the line, or the end of + ;; the line, if the column offset points beyond the end of the + ;; line. + (let ((end (min (+ (point) column) + (+ (line-end-position) 1)))) + (cons (- end 1) end))))))))) + +(defun flycheck-error-thing-region (thing err) + "Get the region of THING at the column of ERR. + +ERR is a Flycheck error whose region to get. THING is a +understood by `thing-at-point'. + +Return a cons cell `(BEG . END)' where BEG is the beginning of +the THING at the error column, and END the end of the symbol. If +ERR has no error column, or if there is no THING at this column, +return nil." + (-when-let (column (car (flycheck-error-column-region err))) + (flycheck-error-with-buffer err + (save-excursion + (save-restriction + (widen) + (goto-char column) + (bounds-of-thing-at-point thing)))))) + +(defun flycheck-error-region-for-mode (err mode) + "Get the region of ERR for the highlighting MODE. + +ERR is a Flycheck error. MODE may be one of the following symbols: + +`columns' + Get the column region of ERR, or the line region if ERR + has no column. + +`symbols' + Get the symbol region of ERR, or the result of `columns', if + there is no sexp at the error column. + +`sexps' + Get the sexp region of ERR, or the result of `columns', if + there is no sexp at the error column. + +`lines' + Return the line region. + +Otherwise signal an error." + (pcase mode + (`columns (or (flycheck-error-column-region err) + (flycheck-error-line-region err))) + (`symbols (or (flycheck-error-thing-region 'symbol err) + (flycheck-error-region-for-mode err 'columns))) + (`sexps (or (flycheck-error-thing-region 'sexp err) + (flycheck-error-region-for-mode err 'columns))) + (`lines (flycheck-error-line-region err)) + (_ (error "Invalid mode %S" mode)))) + +(defun flycheck-error-pos (err) + "Get the buffer position of ERR. + +ERR is a Flycheck error whose position to get. + +The error position is the error column, or the first +non-whitespace character of the error line, if ERR has no error column." + (car (or (flycheck-error-column-region err) + (flycheck-error-line-region err)))) + +(defun flycheck-error-format-message-and-id (err) + "Format the message and id of ERR as human-readable string." + (let ((id (flycheck-error-id err)) + (message (flycheck-error-message err))) + (if id (format "%s [%s]" message id) message))) + +(defun flycheck-error-format (err) + "Format ERR as human-readable string. + +Return a string that represents the given ERR. This string does +_not_ include the file name." + (let* ((line (flycheck-error-line err)) + (column (flycheck-error-column err)) + (level (symbol-name (flycheck-error-level err))) + (checker (symbol-name (flycheck-error-checker err))) + (format `(,(number-to-string line) ":" + ,@(when column (list (number-to-string column) ":")) + ,level ": " + ,(flycheck-error-format-message-and-id err) + " (" ,checker ")"))) + (apply #'concat format))) + +(defun flycheck-error-< (err1 err2) + "Determine whether ERR1 goes before ERR2 by location. + +Compare by line numbers and then by column numbers." + (let ((line1 (flycheck-error-line err1)) + (line2 (flycheck-error-line err2))) + (if (= line1 line2) + (let ((col1 (flycheck-error-column err1)) + (col2 (flycheck-error-column err2))) + (and col2 + ;; Sort errors for the whole line first + (or (not col1) (< col1 col2)))) + (< line1 line2)))) + +(defun flycheck-error-level-< (err1 err2) + "Determine whether ERR1 goes before ERR2 by error level. + +Like `flycheck-error-<', but compares by error level severity +first. Levels of the same severity are compared by name." + (let* ((level1 (flycheck-error-level err1)) + (level2 (flycheck-error-level err2)) + (severity1 (flycheck-error-level-severity level1)) + (severity2 (flycheck-error-level-severity level2))) + (cond + ((= severity1 severity2) + (if (string= level1 level2) + (flycheck-error-< err1 err2) + (string< level1 level2))) + (t (< severity1 severity2))))) + +(defun flycheck-assert-error-list-p (errors) + "Assert that all items in ERRORS are of `flycheck-error' type. + +Signal an error if any item in ERRORS is not a `flycheck-error' +object, as by `flycheck-error-p'. Otherwise return ERRORS +again." + (unless (listp errors) + (signal 'wrong-type-argument (list 'listp errors))) + (dolist (err errors) + (unless (flycheck-error-p err) + (signal 'wrong-type-argument (list 'flycheck-error-p err)))) + errors) + + +;;; Errors in the current buffer +(defvar-local flycheck-current-errors nil + "A list of all errors and warnings in the current buffer.") + +(defun flycheck-report-current-errors (errors) + "Report ERRORS in the current buffer. + +Add ERRORS to `flycheck-current-errors' and process each error +with `flycheck-process-error-functions'." + (setq flycheck-current-errors (sort (append errors flycheck-current-errors) + #'flycheck-error-<)) + (mapc (lambda (err) + (run-hook-with-args-until-success 'flycheck-process-error-functions + err)) + errors)) + +(defun flycheck-clear-errors () + "Remove all error information from the current buffer." + (setq flycheck-current-errors nil) + (flycheck-report-status 'not-checked)) + +(defun flycheck-relevant-error-p (err) + "Determine whether ERR is relevant for the current buffer. + +Return t if ERR may be shown for the current buffer, or nil +otherwise." + (flycheck-error-with-buffer err + (let ((file-name (flycheck-error-filename err)) + (message (flycheck-error-message err))) + (and + (or (not file-name) (flycheck-same-files-p file-name (buffer-file-name))) + message + (not (string-empty-p message)) + (flycheck-error-line err))))) + +(defun flycheck-relevant-errors (errors) + "Filter the relevant errors from ERRORS. + +Return a list of all errors that are relevant for their +corresponding buffer." + (-filter #'flycheck-relevant-error-p errors)) + + +;;; Status reporting for the current buffer +(defvar-local flycheck-last-status-change 'not-checked + "The last status change in the current buffer.") + +(defun flycheck-report-failed-syntax-check (&optional status) + "Report a failed Flycheck syntax check with STATUS. + +STATUS is a status symbol for `flycheck-report-status', +defaulting to `errored'. + +Clear Flycheck state, run `flycheck-syntax-check-failed-hook' and +report an error STATUS." + (flycheck-clear) + (setq flycheck-current-syntax-check nil) + (run-hooks 'flycheck-syntax-check-failed-hook) + (flycheck-report-status (or status 'errored))) + +(defun flycheck-report-status (status) + "Report Flycheck STATUS. + +STATUS is one of the following symbols: + +`not-checked' + The current buffer was not checked. + +`no-checker' + Automatic syntax checker selection did not find a suitable + syntax checker. + +`running' + A syntax check is now running in the current buffer. + +`errored' + The current syntax check has errored. + +`finished' + The current syntax check was finished normally. + +`interrupted' + The current syntax check was interrupted. + +`suspicious' + The last syntax check had a suspicious result. + +Set `flycheck-last-status-change' and call +`flycheck-status-changed-functions' with STATUS. Afterwards +refresh the mode line." + (setq flycheck-last-status-change status) + (run-hook-with-args 'flycheck-status-changed-functions status) + (force-mode-line-update)) + +(defun flycheck-mode-line-status-text (&optional status) + "Get a text describing STATUS for use in the mode line. + +STATUS defaults to `flycheck-last-status-change' if omitted or +nil." + (let ((text (pcase (or status flycheck-last-status-change) + (`not-checked "") + (`no-checker "-") + (`running "*") + (`errored "!") + (`finished + (if flycheck-current-errors + (let-alist (flycheck-count-errors flycheck-current-errors) + (format ":%s/%s" (or .error 0) (or .warning 0))) + "")) + (`interrupted "-") + (`suspicious "?")))) + (concat " FlyC" text))) + + +;;; Error levels +;;;###autoload +(defun flycheck-define-error-level (level &rest properties) + "Define a new error LEVEL with PROPERTIES. + +The following PROPERTIES constitute an error level: + +`:severity SEVERITY' + A number denoting the severity of this level. The higher + the number, the more severe is this level compared to other + levels. Defaults to 0. + + The severity is used by `flycheck-error-level-<' to + determine the ordering of errors according to their levels. + +`:overlay-category CATEGORY' + A symbol denoting the overlay category to use for error + highlight overlays for this level. See Info + node `(elisp)Overlay Properties' for more information about + overlay categories. + + A category for an error level overlay should at least define + the `face' property, for error highlighting. Other useful + properties for error level categories are `priority' to + influence the stacking of multiple error level overlays, and + `help-echo' to define a default error messages for errors + without messages. + +`:fringe-bitmap BITMAP' + A fringe bitmap symbol denoting the bitmap to use for fringe + indicators for this level. See Info node `(elisp)Fringe + Bitmaps' for more information about fringe bitmaps, + including a list of built-in fringe bitmaps. + +`:fringe-face FACE' + A face symbol denoting the face to use for fringe indicators + for this level. + +`:error-list-face FACE' + A face symbol denoting the face to use for messages of this + level in the error list. See `flycheck-list-errors'." + (declare (indent 1)) + (put level 'flycheck-error-level t) + (put level 'flycheck-error-severity + (or (plist-get properties :severity) 0)) + (put level 'flycheck-overlay-category + (plist-get properties :overlay-category)) + (put level 'flycheck-fringe-bitmap + (plist-get properties :fringe-bitmap)) + (put level 'flycheck-fringe-face + (plist-get properties :fringe-face)) + (put level 'flycheck-error-list-face + (plist-get properties :error-list-face))) + +(defun flycheck-error-level-p (level) + "Determine whether LEVEL is a Flycheck error level." + (get level 'flycheck-error-level)) + +(defun flycheck-error-level-severity (level) + "Get the numeric severity of LEVEL." + (or (get level 'flycheck-error-severity) 0)) + +(defun flycheck-error-level-overlay-category (level) + "Get the overlay category for LEVEL." + (get level 'flycheck-overlay-category)) + +(defun flycheck-error-level-fringe-bitmap (level) + "Get the fringe bitmap for LEVEL." + (get level 'flycheck-fringe-bitmap)) + +(defun flycheck-error-level-fringe-face (level) + "Get the fringe face for LEVEL." + (get level 'flycheck-fringe-face)) + +(defun flycheck-error-level-error-list-face (level) + "Get the error list face for LEVEL." + (get level 'flycheck-error-list-face)) + +(defun flycheck-error-level-make-fringe-icon (level side) + "Create the fringe icon for LEVEL at SIDE. + +Return a propertized string that shows a fringe bitmap according +to LEVEL and the given fringe SIDE. + +LEVEL is a Flycheck error level defined with +`flycheck-define-error-level', and SIDE is either `left-fringe' +or `right-fringe'. + +Return a propertized string representing the fringe icon, +intended for use as `before-string' of an overlay to actually +show the icon." + (unless (memq side '(left-fringe right-fringe)) + (error "Invalid fringe side: %S" side)) + (propertize "!" 'display + (list side + (flycheck-error-level-fringe-bitmap level) + (flycheck-error-level-fringe-face level)))) + + +;;; Built-in error levels +(put 'flycheck-error-overlay 'face 'flycheck-error) +(put 'flycheck-error-overlay 'priority 110) +(put 'flycheck-error-overlay 'help-echo "Unknown error.") + +(flycheck-define-error-level 'error + :severity 100 + :overlay-category 'flycheck-error-overlay + :fringe-bitmap 'exclamation-mark + :fringe-face 'flycheck-fringe-error + :error-list-face 'flycheck-error-list-error) + +(put 'flycheck-warning-overlay 'face 'flycheck-warning) +(put 'flycheck-warning-overlay 'priority 100) +(put 'flycheck-warning-overlay 'help-echo "Unknown warning.") + +(flycheck-define-error-level 'warning + :severity 10 + :overlay-category 'flycheck-warning-overlay + :fringe-bitmap 'question-mark + :fringe-face 'flycheck-fringe-warning + :error-list-face 'flycheck-error-list-warning) + +(put 'flycheck-info-overlay 'face 'flycheck-info) +(put 'flycheck-info-overlay 'priority 90) +(put 'flycheck-info-overlay 'help-echo "Unknown info.") + +(flycheck-define-error-level 'info + :severity -1 + :overlay-category 'flycheck-info-overlay + ;; Not exactly the right indicator, but looks pretty, and I prefer to use + ;; built-in bitmaps over diving into the hassle of messing around with custom + ;; fringe bitmaps + :fringe-bitmap 'empty-line + :fringe-face 'flycheck-fringe-info + :error-list-face 'flycheck-error-list-info) + + +;;; Error filtering +(defun flycheck-filter-errors (errors checker) + "Filter ERRORS from CHECKER. + +Apply the error filter of CHECKER to ERRORs and return the +result. If CHECKER has no error filter, fall back to +`flycheck-sanitize-errors'." + (let ((filter (or (flycheck-checker-error-filter checker) + #'flycheck-sanitize-errors))) + (funcall filter errors))) + +(defun flycheck-sanitize-errors (errors) + "Sanitize ERRORS. + +Sanitize ERRORS by trimming leading and trailing whitespace in +all error messages, and by replacing 0 columns and empty error +messages with nil. + +Returns sanitized ERRORS." + (dolist (err errors) + (flycheck-error-with-buffer err + (let ((message (flycheck-error-message err)) + (column (flycheck-error-column err)) + (id (flycheck-error-id err))) + (when message + (setq message (string-trim message)) + (setf (flycheck-error-message err) + (if (string-empty-p message) nil message))) + (when (and id (string-empty-p id)) + (setf (flycheck-error-id err) nil)) + (when (eq column 0) + (setf (flycheck-error-column err) nil))))) + errors) + +(defun flycheck-increment-error-columns (errors &optional offset) + "Increment all columns of ERRORS by OFFSET. + +Use this as `:error-filter' if a syntax checker outputs 0-based +columns." + (mapc (lambda (err) + (let ((column (flycheck-error-column err))) + (when column + (setf (flycheck-error-column err) + (+ column (or offset 1)))))) + errors) + errors) + +(defun flycheck-collapse-error-message-whitespace (errors) + "Collapse whitespace in all messages of ERRORS. + +Return ERRORS." + (dolist (err errors) + (-when-let (message (flycheck-error-message err)) + (setf (flycheck-error-message err) + (replace-regexp-in-string (rx (one-or-more (any space "\n" "\r"))) + " " message 'fixed-case 'literal)))) + errors) + +(defun flycheck-dedent-error-messages (errors) + "Dedent all messages of ERRORS. + +For each error in ERRORS, determine the indentation offset from +the leading whitespace of the first line, and dedent all further +lines accordingly. + +Return ERRORS, with in-place modifications." + (dolist (err errors) + (-when-let (message (flycheck-error-message err)) + (with-temp-buffer + (insert message) + ;; Determine the indentation offset + (goto-char (point-min)) + (back-to-indentation) + (let* ((indent-offset (- (point) (point-min)))) + ;; Now iterate over all lines and dedent each according to + ;; `indent-offset' + (while (not (eobp)) + (back-to-indentation) + ;; If the current line starts with sufficient whitespace, delete the + ;; indendation offset. Otherwise keep the line intact, as we might + ;; loose valuable information + (when (>= (- (point) (line-beginning-position)) indent-offset) + (delete-char (- indent-offset))) + (forward-line 1))) + (delete-trailing-whitespace (point-min) (point-max)) + (setf (flycheck-error-message err) + (buffer-substring-no-properties (point-min) (point-max)))))) + errors) + +(defun flycheck-fold-include-levels (errors sentinel-message) + "Fold levels of ERRORS from included files. + +ERRORS is a list of `flycheck-error' objects. SENTINEL-MESSAGE +is a regular expression matched against the error message to +determine whether the errror denotes errors from an included +file. Alternatively, it is a function that is given an error and +shall return non-nil, if the error denotes errors from an +included file." + (unless (or (stringp sentinel-message) (functionp sentinel-message)) + (error "Sentinel must be string or function: %S" sentinel-message)) + (let ((sentinel (if (functionp sentinel-message) + sentinel-message + (lambda (err) + (string-match-p sentinel-message + (flycheck-error-message err))))) + (remaining-errors errors)) + (while remaining-errors + (let* ((current-error (pop remaining-errors))) + (when (funcall sentinel current-error) + ;; We found an error denoting errors in the included file, so process + ;; all subsequent errors until an error has the current file name + ;; again, and find the most severe error level + (let ((current-filename (flycheck-error-filename current-error)) + (current-level nil) + (faulty-include-filename (flycheck-error-filename + (car remaining-errors)))) + (while (and remaining-errors + (not (string= (flycheck-error-filename + (car remaining-errors)) + current-filename))) + (let* ((error-in-include (pop remaining-errors)) + (in-include-level (flycheck-error-level error-in-include))) + (unless (funcall sentinel error-in-include) + ;; Ignore nested "included file" errors, we are only + ;; interested in real errors because these define our level + (when (or (not current-level) + (> (flycheck-error-level-severity in-include-level) + (flycheck-error-level-severity current-level))) + (setq current-level in-include-level))))) + (setf (flycheck-error-level current-error) current-level + (flycheck-error-message current-error) + (format "In include %s" faulty-include-filename)))))) + errors)) + +(defun flycheck-dequalify-error-ids (errors) + "De-qualify error ids in ERRORS. + +Remove all qualifications from error ids in ERRORS, by stripping +all leading dotted components from error IDs. For instance, if +the error ID is com.foo.E100, replace it with E100. + +This error filter is mainly useful to simplify error IDs obtained +from parsing Checkstyle XML, which frequently has very verbose +IDs, that include the name of the tool." + (mapc (lambda (err) + (let ((id (flycheck-error-id err))) + (when id + (setf (flycheck-error-id err) + (replace-regexp-in-string + (rx string-start + (group + (optional (zero-or-more not-newline) ".")) + (one-or-more (not (any "."))) + string-end) + "" id 'fixedcase 'literal 1))))) + errors) + errors) + +(defun flycheck-remove-error-ids (errors) + "Remove all error ids from ERRORS." + (mapc (lambda (err) (setf (flycheck-error-id err) nil)) errors) + errors) + + +;;; Error analysis +(defun flycheck-count-errors (errors) + "Count the number of ERRORS, grouped by level.. + +Return an alist, where each ITEM is a cons cell whose `car' is an +error level, and whose `cdr' is the number of errors of that +level." + (let (counts-by-level) + (dolist (err errors) + (let* ((level (flycheck-error-level err)) + (item (assq level counts-by-level))) + (if item + (setcdr item (1+ (cdr item))) + (push (cons level 1) counts-by-level)))) + counts-by-level)) + +(defun flycheck-has-max-errors-p (errors level) + "Check if there is no error in ERRORS more severe than LEVEL." + (let ((severity (flycheck-error-level-severity level)) + found) + (while (and errors (not found)) + (setq found (< severity (flycheck-error-level-severity + (flycheck-error-level (pop errors)))))) + (not found))) + +(defun flycheck-has-max-current-errors-p (level) + "Check if there is no current error more severe than LEVEL." + (flycheck-has-max-errors-p flycheck-current-errors level)) + +(defun flycheck-has-errors-p (errors level) + "Determine if there are any ERRORS with LEVEL." + (let (found) + (while (and errors (not found)) + (setq found (eq (flycheck-error-level (pop errors)) level))) + found)) + +(defun flycheck-has-current-errors-p (&optional level) + "Determine if the current buffer has errors with LEVEL. + +If LEVEL is omitted if the current buffer has any errors at all." + (if level + (flycheck-has-errors-p flycheck-current-errors level) + (and flycheck-current-errors t))) + + +;;; Error overlays in the current buffer +(defun flycheck-add-overlay (err) + "Add overlay for ERR. + +Return the created overlay." + ;; We must have a proper error region for the sake of fringe indication, + ;; error display and error navigation, even if the highlighting is disabled. + ;; We erase the highlighting later on in this case + (pcase-let* ((`(,beg . ,end) (flycheck-error-region-for-mode + err (or flycheck-highlighting-mode 'lines))) + (overlay (make-overlay beg end)) + (level (flycheck-error-level err)) + (category (flycheck-error-level-overlay-category level))) + (unless (flycheck-error-level-p level) + (error "Undefined error level: %S" level)) + (overlay-put overlay 'flycheck-overlay t) + (overlay-put overlay 'flycheck-error err) + ;; TODO: Consider hooks to re-check if overlay contents change + (overlay-put overlay 'category category) + (unless flycheck-highlighting-mode + ;; Erase the highlighting from the overlay if requested by the user + (overlay-put overlay 'face nil)) + (when flycheck-indication-mode + (overlay-put overlay 'before-string + (flycheck-error-level-make-fringe-icon + level flycheck-indication-mode))) + (overlay-put overlay 'help-echo (flycheck-error-message err)) + overlay)) + +(defun flycheck-filter-overlays (overlays) + "Get all Flycheck overlays from OVERLAYS." + (-filter (lambda (o) (overlay-get o 'flycheck-overlay)) overlays)) + +(defun flycheck-overlays-at (pos) + "Get all Flycheck overlays at POS." + (flycheck-filter-overlays (overlays-at pos))) + +(defun flycheck-overlays-in (beg end) + "Get all Flycheck overlays between BEG and END." + (flycheck-filter-overlays (overlays-in beg end))) + +(defun flycheck-overlay-errors-at (pos) + "Return a list of all flycheck errors overlayed at POS." + (mapcar (lambda (o) (overlay-get o 'flycheck-error)) + (flycheck-overlays-at pos))) + +(defun flycheck-overlay-errors-in (beg end) + "Return a list of all flycheck errors overlayed between BEG and END." + (mapcar (lambda (o) (overlay-get o 'flycheck-error)) + (flycheck-overlays-in beg end))) + +(defvar-local flycheck-overlays-to-delete nil + "Overlays mark for deletion after all syntax checks completed.") +(put 'flycheck-overlays-to-delete 'permanent-local t) + +(defun flycheck-delete-all-overlays () + "Remove all flycheck overlays in the current buffer." + (flycheck-delete-marked-overlays) + (save-restriction + (widen) + (mapc #'delete-overlay (flycheck-overlays-in (point-min) (point-max))))) + +(defun flycheck-mark-all-overlays-for-deletion () + "Mark all current overlays for deletion." + (setq flycheck-overlays-to-delete + (append (flycheck-overlays-in (point-min) (point-max)) + flycheck-overlays-to-delete))) + +(defun flycheck-delete-marked-overlays () + "Delete all overlays marked for deletion." + (mapc #'delete-overlay flycheck-overlays-to-delete) + (setq flycheck-overlays-to-delete nil)) + + +;;; Error navigation in the current buffer +(defun flycheck-error-level-interesting-at-pos-p (pos) + "Check if error severity at POS passes `flycheck-error-level-interesting-p'." + (flycheck-error-level-interesting-p (get-char-property pos 'flycheck-error))) + +(defun flycheck-error-level-interesting-p (err) + "Check if ERR severity is >= `flycheck-navigation-minimum-level'." + (when (flycheck-error-p err) + (-if-let (min-level flycheck-navigation-minimum-level) + (<= (flycheck-error-level-severity min-level) + (flycheck-error-level-severity (flycheck-error-level err))) + t))) + +(defun flycheck-next-error-pos (n &optional reset) + "Get the position of the N-th next error. + +With negative n, get the position of the (-N)-th previous error +instead. With non-nil RESET, search from `point-min', otherwise +search from the current point. + +Return the position of the next or previous error, or nil if +there is none." + (let ((n (or n 1)) + (pos (if reset (point-min) (point)))) + (if (>= n 0) + ;; Search forwards + (while (and pos (> n 0)) + (setq n (1- n)) + (when (get-char-property pos 'flycheck-error) + ;; Move beyond from the current error if any + (setq pos (next-single-char-property-change pos 'flycheck-error))) + (while (not (or (= pos (point-max)) + (flycheck-error-level-interesting-at-pos-p pos))) + ;; Scan for the next error + (setq pos (next-single-char-property-change pos 'flycheck-error))) + (when (and (= pos (point-max)) + (not (flycheck-error-level-interesting-at-pos-p pos))) + ;; If we reached the end of the buffer, but no error, we didn't find + ;; any + (setq pos nil))) + ;; Search backwards + (while (and pos (< n 0)) + (setq n (1+ n)) + ;; Loop until we find an error. We need to check the position *before* + ;; the current one, because `previous-single-char-property-change' + ;; always moves to the position *of* the change. + (while (not (or (= pos (point-min)) + (flycheck-error-level-interesting-at-pos-p (1- pos)))) + (setq pos (previous-single-char-property-change pos 'flycheck-error))) + (when (and (= pos (point-min)) + (not (flycheck-error-level-interesting-at-pos-p pos))) + ;; We didn't find any error. + (setq pos nil)) + (when pos + ;; We found an error, so move to its beginning + (setq pos (previous-single-char-property-change pos + 'flycheck-error))))) + pos)) + +(defun flycheck-next-error-function (n reset) + "Visit the N-th error from the current point. + +Intended for use with `next-error-function'." + (let ((pos (flycheck-next-error-pos n reset))) + (if pos + (goto-char pos) + (user-error "No more Flycheck errors")))) + +(defun flycheck-next-error (&optional n reset) + "Visit the N-th error from the current point. + +If RESET is given and non-nil, re-start from the beginning of the buffer. + +N specifies how many errors to move forwards. If negative, move backwards." + (interactive "P") + (when (consp n) + ;; Universal prefix argument means reset + (setq reset t n nil)) + (flycheck-next-error-function n reset)) + +(defun flycheck-previous-error (&optional n) + "Visit the N-th previous error. + +If given, N specifies the number of errors to move backwards. If +N is negative, move forwards instead." + (interactive "P") + (flycheck-next-error (- (or n 1)))) + +(defun flycheck-first-error (&optional n) + "Visit the N-th error from beginning of the buffer. + +If given, N specifies the number of errors to move forward from +the beginning of the buffer." + (interactive "P") + (flycheck-next-error n 'reset)) + + +;;; Listing errors in buffers +(defconst flycheck-error-list-buffer "*Flycheck errors*" + "The name of the buffer to show error lists.") + +(defvar flycheck-error-list-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "n") #'flycheck-error-list-next-error) + (define-key map (kbd "p") #'flycheck-error-list-previous-error) + (define-key map (kbd "g") #'flycheck-error-list-check-source) + (define-key map (kbd "RET") #'flycheck-error-list-goto-error) + map) + "The keymap of `flycheck-error-list-mode'.") + +(defconst flycheck-error-list-format + [("Line" 4 flycheck-error-list-entry-< :right-align t) + ("Col" 3 nil :right-align t) + ("Level" 8 flycheck-error-list-entry-level-<) + ("ID" 6 t) + ("Message" 0 t) + (" (Checker)" 8 t)] + "Table format for the error list.") + +(define-derived-mode flycheck-error-list-mode tabulated-list-mode "Flycheck errors" + "Major mode for listing Flycheck errors. + +\\{flycheck-error-list-mode-map}" + (setq tabulated-list-format flycheck-error-list-format + ;; Sort by location initially + tabulated-list-sort-key (cons "Line" nil) + tabulated-list-padding 1 + tabulated-list-entries #'flycheck-error-list-entries + ;; `revert-buffer' updates the mode line for us, so all we need to do is + ;; set the corresponding mode line construct. + mode-line-buffer-identification flycheck-error-list-mode-line) + (tabulated-list-init-header)) + +(defvar-local flycheck-error-list-source-buffer nil + "The current source buffer of the error list.") +;; Needs to permanently local to preserve the source buffer across buffer +;; reversions +(put 'flycheck-error-list-source-buffer 'permanent-local t) + +(defun flycheck-error-list-set-source (buffer) + "Set BUFFER as the source buffer of the error list." + (when (get-buffer flycheck-error-list-buffer) + (with-current-buffer flycheck-error-list-buffer + ;; Only update the source when required + (unless (eq buffer flycheck-error-list-source-buffer) + (setq flycheck-error-list-source-buffer buffer) + (flycheck-error-list-refresh))))) + +(defun flycheck-error-list-update-source () + "Update the source buffer of the error list." + (when (not (eq (current-buffer) (get-buffer flycheck-error-list-buffer))) + ;; We must not update the source buffer, if the current buffer is the error + ;; list itself. + (flycheck-error-list-set-source (current-buffer)))) + +(defun flycheck-error-list-check-source () + "Trigger a syntax check in the source buffer of the error list." + (interactive) + (let ((buffer (get-buffer flycheck-error-list-source-buffer))) + (when (buffer-live-p buffer) + (with-current-buffer buffer + (flycheck-buffer))))) + +(define-button-type 'flycheck-error-list + 'action #'flycheck-error-list-button-goto-error + 'help-echo "mouse-2, RET: goto error") + +(defun flycheck-error-list-button-goto-error (button) + "Go to the error at BUTTON." + (flycheck-error-list-goto-error (button-start button))) + +(defsubst flycheck-error-list-make-cell (text &optional face) + "Make an error list cell with TEXT and FACE." + (let ((face (or face 'default))) + (list text 'type 'flycheck-error-list 'face face))) + +(defsubst flycheck-error-list-make-number-cell (number face) + "Make a table cell for a NUMBER with FACE. + +Convert NUMBER to string, fontify it with FACE and return the +string with attached text properties." + (flycheck-error-list-make-cell + (if (numberp number) (number-to-string number) "") + face)) + +(defun flycheck-error-list-make-entry (error) + "Make a table cell for the given ERROR. + +Return a list with the contents of the table cell." + (let* ((level (flycheck-error-level error)) + (level-face (flycheck-error-level-error-list-face level)) + (line (flycheck-error-line error)) + (column (flycheck-error-column error)) + (message (or (flycheck-error-message error) + (format "Unknown %s" (symbol-name level)))) + (id (flycheck-error-id error)) + (checker (flycheck-error-checker error))) + (list error + (vector (flycheck-error-list-make-number-cell + line 'flycheck-error-list-line-number) + (flycheck-error-list-make-number-cell + column 'flycheck-error-list-column-number) + (flycheck-error-list-make-cell + (symbol-name (flycheck-error-level error)) level-face) + (flycheck-error-list-make-cell + (if id (format "%s" id) "") + 'flycheck-error-list-id) + (flycheck-error-list-make-cell message) + (flycheck-error-list-make-cell + (format "(%s)" checker) + 'flycheck-error-list-checker-name))))) + +(defun flycheck-error-list-entries () + "Create the entries for the error list." + (when (buffer-live-p flycheck-error-list-source-buffer) + (let ((errors (buffer-local-value 'flycheck-current-errors + flycheck-error-list-source-buffer))) + (mapcar #'flycheck-error-list-make-entry errors)))) + +(defun flycheck-error-list-entry-< (entry1 entry2) + "Determine whether ENTRY1 is before ENTRY2 by location. + +See `flycheck-error-<'." + (flycheck-error-< (car entry1) (car entry2))) + +(defun flycheck-error-list-entry-level-< (entry1 entry2) + "Determine whether ENTRY1 is before ENTRY2 by level. + +See `flycheck-error-level-<'." + (not (flycheck-error-level-< (car entry1) (car entry2)))) + +(defvar flycheck-error-list-mode-line-map + (let ((map (make-sparse-keymap))) + (define-key map [mode-line mouse-1] + #'flycheck-error-list-mouse-switch-to-source) + map) + "Keymap for error list mode line.") + +(defun flycheck-error-list-propertized-source-name () + "Get the name of the current source buffer for the mode line. + +Propertize the name of the current source buffer for use in the +mode line indication of `flycheck-error-list-mode'." + (let ((name (replace-regexp-in-string + (rx "%") "%%" + (buffer-name flycheck-error-list-source-buffer) + 'fixed-case 'literal))) + (propertize name 'face 'mode-line-buffer-id + 'mouse-face 'mode-line-highlight + 'help-echo "mouse-1: switch to source" + 'local-map flycheck-error-list-mode-line-map))) + +(defun flycheck-error-list-mouse-switch-to-source (event) + "Switch to the error list source buffer of the EVENT window." + (interactive "e") + (save-selected-window + (when (eventp event) + (select-window (posn-window (event-start event)))) + (when (buffer-live-p flycheck-error-list-source-buffer) + (switch-to-buffer flycheck-error-list-source-buffer)))) + +(defun flycheck-get-error-list-window-list (&optional all-frames) + "Get all windows displaying the error list. + +ALL-FRAMES specifies the frames to consider, as in +`get-buffer-window-list'." + (-when-let (buf (get-buffer flycheck-error-list-buffer)) + (get-buffer-window-list buf nil all-frames))) + +(defun flycheck-get-error-list-window (&optional all-frames) + "Get a window displaying the error list, or nil if none. + +ALL-FRAMES specifies the frames to consider, as in +`get-buffer-window'." + (-when-let (buf (get-buffer flycheck-error-list-buffer)) + (get-buffer-window buf all-frames))) + +(defun flycheck-error-list-recenter-at (pos) + "Recenter the error list at POS." + (dolist (window (flycheck-get-error-list-window-list t)) + (with-selected-window window + (goto-char pos) + (recenter)))) + +(defun flycheck-error-list-refresh () + "Refresh the current error list. + +Add all errors currently reported for the current +`flycheck-error-list-source-buffer', and recenter the error +list." + ;; We only refresh the error list, when it is visible in a window, and we + ;; select this window while reverting, because Tabulated List mode attempts to + ;; recenter the error at the old location, so it must have the proper window + ;; selected. + (-when-let (window (flycheck-get-error-list-window t)) + (with-selected-window window + (revert-buffer)) + (run-hooks 'flycheck-error-list-after-refresh-hook) + (let ((preserve-pos (eq (current-buffer) + (get-buffer flycheck-error-list-buffer)))) + ;; If the error list is the current buffer, don't recenter when + ;; highlighting + (flycheck-error-list-highlight-errors preserve-pos)))) + +(defun flycheck-error-list-goto-error (&optional pos) + "Go to the location of the error at POS in the error list. + +POS defaults to `point'." + (interactive) + (-when-let* ((error (tabulated-list-get-id pos)) + (buffer (flycheck-error-buffer error))) + (when (buffer-live-p buffer) + (if (eq (window-buffer) (get-buffer flycheck-error-list-buffer)) + ;; When called from within the error list, keep the error list, + ;; otherwise replace the current buffer. + (pop-to-buffer buffer 'other-window) + (switch-to-buffer buffer)) + (let ((pos (flycheck-error-pos error))) + (unless (eq (goto-char pos) (point)) + ;; If widening gets in the way of moving to the right place, remove it + ;; and try again + (widen) + (goto-char pos))) + ;; Re-highlight the errors + (flycheck-error-list-highlight-errors 'preserve-pos)))) + +(defun flycheck-error-list-next-error-pos (pos &optional n) + "Get the N'th next error in the error list from POS. + +N defaults to 1. If N is negative, search for the previous error +instead. + +Get the beginning position of the N'th next error from POS, or +nil, if there is no next error." + (let ((n (or n 1))) + (if (>= n 0) + ;; Search forward + (while (and pos (/= n 0)) + (setq n (1- n)) + (setq pos (next-single-property-change pos 'tabulated-list-id))) + ;; Search backwards + (while (/= n 0) + (setq n (1+ n)) + ;; We explicitly give the limit here to explicitly have the minimum + ;; point returned, to be able to move to the first error (which starts + ;; at `point-min') + (setq pos (previous-single-property-change pos 'tabulated-list-id + nil (point-min))))) + pos)) + +(defun flycheck-error-list-previous-error (n) + "Go to the N'th previous error in the error list." + (interactive "P") + (flycheck-error-list-next-error (- (or n 1)))) + +(defun flycheck-error-list-next-error (n) + "Go to the N'th next error in the error list." + (interactive "P") + (let ((pos (flycheck-error-list-next-error-pos (point) n))) + (when (and pos (/= pos (point))) + (goto-char pos) + (save-selected-window + ;; Keep the error list selected, so that the user can navigate errors by + ;; repeatedly pressing n/p, without having to re-select the error list + ;; window. + (flycheck-error-list-goto-error))))) + +(defvar-local flycheck-error-list-highlight-overlays nil + "Error highlight overlays in the error list buffer.") +(put 'flycheck-error-list-highlight-overlays 'permanent-local t) + +(defun flycheck-error-list-highlight-errors (&optional preserve-pos) + "Highlight errors in the error list. + +Highlight all errors in the error lists that are at point in the +source buffer, and on the same line as point. Then recenter the +error list to the highlighted error, unless PRESERVE-POS is +non-nil." + (when (get-buffer flycheck-error-list-buffer) + (let ((current-errors (flycheck-overlay-errors-in (line-beginning-position) + (line-end-position)))) + (with-current-buffer flycheck-error-list-buffer + (let ((old-overlays flycheck-error-list-highlight-overlays) + (min-point (point-max)) + (max-point (point-min))) + ;; Display the new overlays first, to avoid re-display flickering + (setq flycheck-error-list-highlight-overlays nil) + (when current-errors + (let ((next-error-pos (point-min))) + (while next-error-pos + (let* ((beg next-error-pos) + (end (flycheck-error-list-next-error-pos beg)) + (err (tabulated-list-get-id beg))) + (when (member err current-errors) + (setq min-point (min min-point beg) + max-point (max max-point beg)) + (let ((ov (make-overlay beg + ;; Extend overlay to the beginning of + ;; the next line, to highlight the + ;; whole line + (or end (point-max))))) + (push ov flycheck-error-list-highlight-overlays) + (overlay-put ov 'flycheck-error-highlight-overlay t) + (overlay-put ov 'face 'flycheck-error-list-highlight))) + (setq next-error-pos end))))) + ;; Delete the old overlays + (mapc #'delete-overlay old-overlays) + (when (and (not preserve-pos) current-errors) + ;; Move point to the middle error + (goto-char (+ min-point (/ (- max-point min-point) 2))) + (beginning-of-line) + ;; And recenter the error list at this position + (flycheck-error-list-recenter-at (point)))))))) + +(defun flycheck-list-errors () + "Show the error list for the current buffer." + (interactive) + (unless flycheck-mode + (user-error "Flycheck mode not enabled")) + ;; Create and initialize the error list + (unless (get-buffer flycheck-error-list-buffer) + (with-current-buffer (get-buffer-create flycheck-error-list-buffer) + (flycheck-error-list-mode))) + (flycheck-error-list-set-source (current-buffer)) + ;; Show the error list in a window, and re-select the old window + (display-buffer flycheck-error-list-buffer) + ;; Finally, refresh the error list to show the most recent errors + (flycheck-error-list-refresh)) + +(defalias 'list-flycheck-errors 'flycheck-list-errors) + + +;;; Displaying errors in the current buffer +(defun flycheck-display-errors (errors) + "Display ERRORS using `flycheck-display-errors-function'." + (when flycheck-display-errors-function + (funcall flycheck-display-errors-function errors))) + +(defvar-local flycheck-display-error-at-point-timer nil + "Timer to automatically show the error at point in minibuffer.") + +(defun flycheck-cancel-error-display-error-at-point-timer () + "Cancel the error display timer for the current buffer." + (when flycheck-display-error-at-point-timer + (cancel-timer flycheck-display-error-at-point-timer) + (setq flycheck-display-error-at-point-timer nil))) + +(defun flycheck-display-error-at-point () + "Display the all error messages at point in minibuffer." + ;; This function runs from a timer, so we must take care to not ignore any + ;; errors + (with-demoted-errors "Flycheck error display error: %s" + (flycheck-cancel-error-display-error-at-point-timer) + (when flycheck-mode + (-when-let (errors (flycheck-overlay-errors-at (point))) + (flycheck-display-errors errors))))) + +(defun flycheck-display-error-at-point-soon () + "Display the first error message at point in minibuffer delayed." + (flycheck-cancel-error-display-error-at-point-timer) + (when (flycheck-overlays-at (point)) + (setq flycheck-display-error-at-point-timer + (run-at-time flycheck-display-errors-delay nil 'flycheck-display-error-at-point)))) + + +;;; Functions to display errors +(defconst flycheck-error-message-buffer "*Flycheck error messages*" + "The name of the buffer to show long error messages in.") + +(defun flycheck-error-message-buffer () + "Get the buffer object to show long error messages in. + +Get the buffer named by variable `flycheck-error-message-buffer', +or nil if the buffer does not exist." + (get-buffer flycheck-error-message-buffer)) + +(defun flycheck-may-use-echo-area-p () + "Determine whether the echo area may be used. + +The echo area may be used if the cursor is not in the echo area, +and if the echo area is not occupied by minibuffer input." + (not (or cursor-in-echo-area (active-minibuffer-window)))) + +(defun flycheck-display-error-messages (errors) + "Display the messages of ERRORS. + +Concatenate all non-nil messages of ERRORS separated by empty +lines, and display them with `display-message-or-buffer', which +shows the messages either in the echo area or in a separate +buffer, depending on the number of lines. See Info +node `(elisp)Displaying Messages' for more information. + +In the latter case, show messages in +`flycheck-error-message-buffer'." + (when (and errors (flycheck-may-use-echo-area-p)) + (let ((messages (mapcar #'flycheck-error-format-message-and-id errors))) + (display-message-or-buffer (string-join messages "\n\n") + flycheck-error-message-buffer)))) + +(defun flycheck-display-error-messages-unless-error-list (errors) + "Show messages of ERRORS unless the error list is visible. + +Like `flycheck-display-error-messages', but only if the error +list (see `flycheck-list-errors') is not visible in any window in +the current frame." + (unless (flycheck-get-error-list-window 'current-frame) + (flycheck-display-error-messages errors))) + +(defun flycheck-hide-error-buffer () + "Hide the Flycheck error buffer if necessary. + +Hide the error buffer if there is no error under point." + (-when-let* ((buffer (flycheck-error-message-buffer)) + (window (get-buffer-window buffer))) + (unless (flycheck-overlays-at (point)) + (quit-window nil window)))) + + +;;; Working with errors +(defun flycheck-copy-errors-as-kill (pos &optional formatter) + "Copy each error at POS into kill ring, using FORMATTER. + +FORMATTER is a function to turn an error into a string, +defaulting to `flycheck-error-message'. + +Interactively, use `flycheck-error-format-message-and-id' as +FORMATTER with universal prefix arg, and `flycheck-error-id' with +normal prefix arg, i.e. copy the message and the ID with +universal prefix arg, and only the id with normal prefix arg." + (interactive (list (point) + (pcase current-prefix-arg + ((pred not) #'flycheck-error-message) + ((pred consp) #'flycheck-error-format-message-and-id) + (_ #'flycheck-error-id)))) + (let ((messages (delq nil (mapcar (or formatter #'flycheck-error-message) + (flycheck-overlay-errors-at pos))))) + (when messages + (mapc #'kill-new (reverse messages)) + (message (string-join messages "\n"))))) + +(define-obsolete-function-alias 'flycheck-copy-messages-as-kill + 'flycheck-copy-errors-as-kill "0.22") + + +;;; Syntax checkers using external commands +(defun flycheck-command-argument-p (arg) + "Check whether ARG is a valid command argument." + (pcase arg + ((pred stringp) t) + ((or `source `source-inplace `source-original) t) + ((or `temporary-directory `temporary-file-name) t) + (`null-device t) + (`(config-file ,option-name ,config-file-var) + (and (stringp option-name) + (symbolp config-file-var))) + (`(config-file ,option-name ,config-file-var ,prepender) + (and (stringp option-name) + (symbolp config-file-var) + (symbolp prepender))) + (`(,(or `option `option-list) ,option-name ,option-var) + (and (stringp option-name) + (symbolp option-var))) + (`(,(or `option `option-list) ,option-name ,option-var ,prepender) + (and (stringp option-name) + (symbolp option-var) + (symbolp prepender))) + (`(,(or `option `option-list) ,option-name ,option-var ,prepender ,filter) + (and (stringp option-name) + (symbolp option-var) + (symbolp prepender) + (symbolp filter))) + (`(option-flag ,option-name ,option-var) + (and (stringp option-name) + (symbolp option-var))) + (`(eval ,_) t) + (_ nil))) + +;;;###autoload +(defun flycheck-define-command-checker (symbol docstring &rest properties) + "Define SYMBOL as syntax checker which runs a command. + +Define SYMBOL as generic syntax checker via +`flycheck-define-generic-checker', which uses an external command +to check the buffer. SYMBOL and DOCSTRING are the same as for +`flycheck-define-generic-checker'. + +In addition to the properties understood by +`flycheck-define-generic-checker', the following PROPERTIES +constitute a command syntax checker. Unless otherwise noted, all +properties are mandatory. Note that the default `:error-filter' +of command checkers is `flycheck-sanitize-errors'. + +`:command COMMAND' + The command to run for syntax checking. + + COMMAND is a list of the form `(EXECUTABLE [ARG ...])'. + + EXECUTABLE is a string with the executable of this syntax + checker. It can be overridden with the variable + `flycheck-SYMBOL-executable'. Note that this variable is + NOT implicitly defined by this function. Use + `flycheck-def-executable-var' to define this variable. + + Each ARG is an argument to the executable, either as string, + or as special symbol or form for + `flycheck-substitute-argument', which see. + +`:error-patterns PATTERNS' + A list of patterns to parse the output of the `:command'. + + Each ITEM in PATTERNS is a list `(LEVEL SEXP ...)', where + LEVEL is a Flycheck error level (see + `flycheck-define-error-level'), followed by one or more RX + `SEXP's which parse an error of that level and extract line, + column, file name and the message. + + See `rx' for general information about RX, and + `flycheck-rx-to-string' for some special RX forms provided + by Flycheck. + + All patterns are applied in the order of declaration to the + whole output of the syntax checker. Output already matched + by a pattern will not be matched by subsequent patterns. In + other words, the first pattern wins. + + This property is optional. If omitted, however, an + `:error-parser' is mandatory. + +`:error-parser FUNCTION' + A function to parse errors with. + + The function shall accept three arguments OUTPUT CHECKER + BUFFER. OUTPUT is the syntax checker output as string, + CHECKER the syntax checker that was used, and BUFFER a + buffer object representing the checked buffer. The function + must return a list of `flycheck-error' objects parsed from + OUTPUT. + + This property is optional. If omitted, it defaults to + `flycheck-parse-with-patterns'. In this case, + `:error-patterns' is mandatory. + +Note that you may not give `:start', `:interrupt', and +`:print-doc' for a command checker. You can give a custom +`:verify' function, but you should take care to call +`flycheck-verify-command-checker' in a custom `:verify' +function." + (declare (indent 1) + (doc-string 2)) + (dolist (prop '(:start :interrupt :print-doc)) + (when (plist-get properties prop) + (error "%s not allowed in definition of command syntax checker %s" + prop symbol))) + + (unless (plist-get properties :error-filter) + ;; Default to `flycheck-sanitize-errors' as error filter + (setq properties (plist-put properties :error-filter + #'flycheck-sanitize-errors))) + + (let ((command (plist-get properties :command)) + (patterns (plist-get properties :error-patterns)) + (parser (or (plist-get properties :error-parser) + #'flycheck-parse-with-patterns)) + (predicate (plist-get properties :predicate))) + + (unless command + (error "Missing :command in syntax checker %s" symbol)) + (unless (stringp (car command)) + (error "Command executable for syntax checker %s must be a string: %S" + symbol (car command))) + (dolist (arg (cdr command)) + (unless (flycheck-command-argument-p arg) + (error "Invalid command argument %S in syntax checker %s" arg symbol))) + (when (and (eq parser 'flycheck-parse-with-patterns) + (not patterns)) + (error "Missing :error-patterns in syntax checker %s" symbol)) + + (setq properties + ;; Construct a predicate that checks whether the executable exists, to + ;; guard against syntax checker tools which are not installed + (plist-put properties :predicate + (lambda () + (and (executable-find (flycheck-checker-executable symbol)) + (or (not predicate) (funcall predicate)))))) + + (apply #'flycheck-define-generic-checker symbol docstring + :start #'flycheck-start-command-checker + :interrupt #'flycheck-interrupt-command-checker + :print-doc #'flycheck-command-checker-print-doc + :verify #'flycheck-verify-command-checker + properties) + + ;; Pre-compile all errors patterns into strings, so that we don't need to do + ;; that on each error parse + (let ((patterns (mapcar (lambda (p) + (cons (flycheck-rx-to-string `(and ,@(cdr p)) + 'no-group) + (car p))) + patterns))) + (pcase-dolist (`(,prop . ,value) + `((flycheck-command . ,command) + (flycheck-error-parser . ,parser) + (flycheck-error-patterns . ,patterns))) + (put symbol prop value))))) + +(eval-and-compile + ;; Make this function available during byte-compilation, since we need it + ;; at macro expansion of `flycheck-def-executable-var'. + (defun flycheck-checker-executable-variable (checker) + "Get the executable variable of CHECKER. + +The executable variable is named `flycheck-CHECKER-executable'." + (intern (format "flycheck-%s-executable" checker)))) + +(defun flycheck-checker-default-executable (checker) + "Get the default executable of CHECKER." + (car (get checker 'flycheck-command))) + +(defun flycheck-checker-executable (checker) + "Get the command executable of CHECKER. + +The executable is either the value of the variable +`flycheck-CHECKER-executable', or the default executable given in +the syntax checker definition, if the variable is nil." + (let ((var (flycheck-checker-executable-variable checker))) + (or (and (boundp var) (symbol-value var)) + (flycheck-checker-default-executable checker)))) + +(defun flycheck-checker-arguments (checker) + "Get the command arguments of CHECKER." + (cdr (get checker 'flycheck-command))) + +(defun flycheck-checker-error-patterns (checker) + "Get the error patterns of CHECKER. + +Each pattern has the form `(REGEXP . LEVEL)' where REGEXP is the +regular expression, and LEVEL the corresponding level symbol." + (get checker 'flycheck-error-patterns)) + +(defun flycheck-checker-error-parser (checker) + "Get the error parser of CHECKER." + (get checker 'flycheck-error-parser)) + +(defun flycheck-substitute-argument (arg checker) + "Substitute ARG for CHECKER. + +Return a list of real arguments for the executable of CHECKER, +substituted for the symbolic argument ARG. Single arguments, +e.g. if ARG is a literal strings, are wrapped in a list. + +ARG may be one of the following forms: + +STRING + Return ARG unchanged. + +`source', `source-inplace' + Create a temporary file to check and return its path. With + `source-inplace' create the temporary file in the same + directory as the original file. The value of + `flycheck-temp-prefix' is used as prefix of the file name. + + With `source', try to retain the non-directory component of + the buffer's file name in the temporary file. + + `source' is the preferred way to pass the input file to a + syntax checker. `source-inplace' should only be used if the + syntax checker needs other files from the source directory, + such as include files in C. + +`source-original' + Return the path of the actual file to check, or an empty + string if the buffer has no file name. + + Note that the contents of the file may not be up to date + with the contents of the buffer to check. Do not use this + as primary input to a checker, unless absolutely necessary. + + When using this symbol as primary input to the syntax + checker, add `flycheck-buffer-saved-p' to the `:predicate'. + +`temporary-directory' + Create a unique temporary directory and return its path. + +`temporary-file-name' + Return a unique temporary filename. The file is *not* + created. + + To ignore the output of syntax checkers, try `null-device' + first. + +`null-device' + Return the value of `null-device', i.e the system null + device. + + Use this option to ignore the output of a syntax checker. + If the syntax checker cannot handle the null device, or + won't write to an existing file, try `temporary-file-name' + instead. + +`(config-file OPTION VARIABLE [PREPEND-FN])' + Search the configuration file bound to VARIABLE with + `flycheck-locate-config-file' and return a list of arguments + that pass this configuration file to the syntax checker, or + nil if the configuration file was not found. + + PREPEND-FN is called with the OPTION and the located + configuration file, and should return OPTION prepended + before the file, either a string or as list. If omitted, + PREPEND-FN defaults to `list'. + +`(option OPTION VARIABLE [PREPEND-FN [FILTER]])' + Retrieve the value of VARIABLE and return a list of + arguments that pass this value as value for OPTION to the + syntax checker. + + PREPEND-FN is called with the OPTION and the value of + VARIABLE, and should return OPTION prepended before the + file, either a string or as list. If omitted, PREPEND-FN + defaults to `list'. + + FILTER is an optional function to be applied to the value of + VARIABLE before prepending. This function must return nil + or a string. In the former case, return nil. In the latter + case, return a list of arguments as described above. + +`(option-list OPTION VARIABLE [PREPEND-FN [FILTER]])' + Retrieve the value of VARIABLE, which must be a list, + and prepend OPTION before each item in this list, using + PREPEND-FN. + + PREPEND-FN is called with the OPTION and each item of the + list as second argument, and should return OPTION prepended + before the item, either as string or as list. If omitted, + PREPEND-FN defaults to `list'. + + FILTER is an optional function to be applied to each item in + the list before prepending OPTION. It shall return the + option value for each item as string, or nil, if the item is + to be ignored. + +`(option-flag OPTION VARIABLE)' + Retrieve the value of VARIABLE and return OPTION, if the + value is non-nil. Otherwise return nil. + +`(eval FORM)' + Return the result of evaluating FORM in the buffer to be + checked. FORM must either return a string or a list of + strings, or nil to indicate that nothing should be + substituted for CELL. For all other return types, signal an + error + + _No_ further substitutions are performed, neither in FORM + before it is evaluated, nor in the result of evaluating + FORM. + +In all other cases, signal an error. + +Note that substitution is *not* recursive. No symbols or cells +are substituted within the body of cells!" + (pcase arg + ((pred stringp) (list arg)) + (`source + (list (flycheck-save-buffer-to-temp #'flycheck-temp-file-system))) + (`source-inplace + (list (flycheck-save-buffer-to-temp #'flycheck-temp-file-inplace))) + (`source-original (list (or (buffer-file-name) ""))) + (`temporary-directory (list (flycheck-temp-dir-system))) + (`temporary-file-name + (let ((directory (flycheck-temp-dir-system))) + (list (make-temp-name (expand-file-name "flycheck" directory))))) + (`null-device (list null-device)) + (`(config-file ,option-name ,file-name-var) + (-when-let* ((value (symbol-value file-name-var)) + (file-name (flycheck-locate-config-file value checker))) + (flycheck-prepend-with-option option-name (list file-name)))) + (`(config-file ,option-name ,file-name-var ,prepend-fn) + (-when-let* ((value (symbol-value file-name-var)) + (file-name (flycheck-locate-config-file value checker))) + (flycheck-prepend-with-option option-name (list file-name) prepend-fn))) + (`(option ,option-name ,variable) + (-when-let (value (symbol-value variable)) + (unless (stringp value) + (error "Value %S of %S for option %s is not a string" + value variable option-name)) + (flycheck-prepend-with-option option-name (list value)))) + (`(option ,option-name ,variable ,prepend-fn) + (-when-let (value (symbol-value variable)) + (unless (stringp value) + (error "Value %S of %S for option %s is not a string" + value variable option-name)) + (flycheck-prepend-with-option option-name (list value) prepend-fn))) + (`(option ,option-name ,variable ,prepend-fn ,filter) + (-when-let (value (funcall filter (symbol-value variable))) + (unless (stringp value) + (error "Value %S of %S (filter: %S) for option %s is not a string" + value variable filter option-name)) + (flycheck-prepend-with-option option-name (list value) prepend-fn))) + (`(option-list ,option-name ,variable) + (let ((value (symbol-value variable))) + (unless (and (listp value) (-all? #'stringp value)) + (error "Value %S of %S for option %S is not a list of strings" + value variable option-name)) + (flycheck-prepend-with-option option-name value))) + (`(option-list ,option-name ,variable ,prepend-fn) + (let ((value (symbol-value variable))) + (unless (and (listp value) (-all? #'stringp value)) + (error "Value %S of %S for option %S is not a list of strings" + value variable option-name)) + (flycheck-prepend-with-option option-name value prepend-fn))) + (`(option-list ,option-name ,variable ,prepend-fn ,filter) + (let ((value (delq nil (mapcar filter (symbol-value variable))))) + (unless (and (listp value) (-all? #'stringp value)) + (error "Value %S of %S for option %S is not a list of strings" + value variable option-name)) + (flycheck-prepend-with-option option-name value prepend-fn))) + (`(option-flag ,option-name ,variable) + (when (symbol-value variable) + (list option-name))) + (`(eval ,form) + (let ((result (eval form))) + (cond + ((and (listp result) (-all? #'stringp result)) result) + ((stringp result) (list result)) + (t (error "Invalid result from evaluation of %S: %S" form result))))) + (_ (error "Unsupported argument %S" arg)))) + +(defun flycheck-checker-substituted-arguments (checker) + "Get the substituted arguments of a CHECKER. + +Substitute each argument of CHECKER using +`flycheck-substitute-argument'. This replaces any special +symbols in the command." + (apply #'append + (mapcar (lambda (arg) (flycheck-substitute-argument arg checker)) + (flycheck-checker-arguments checker)))) + +(defun flycheck-start-command-checker (checker callback) + "Start a command CHECKER with CALLBACK." + (let (process) + (condition-case err + (let* ((program (flycheck-checker-executable checker)) + (args (flycheck-checker-substituted-arguments checker)) + ;; Use pipes to receive output from the syntax checker. They are + ;; more efficient and more robust than PTYs, which Emacs uses by + ;; default, and since we don't need any job control features, we + ;; can easily use pipes. + (process-connection-type nil)) + ;; We pass do not associate the process with any buffer, by + ;; passing nil for the BUFFER argument of `start-process'. + ;; Instead, we just remember the buffer being checked in a + ;; process property (see below). This neatly avoids all + ;; side-effects implied by attached a process to a buffer, which + ;; may cause conflicts with other packages. + ;; + ;; See https://github.com/flycheck/flycheck/issues/298 for an + ;; example for such a conflict. + (setq process (apply 'start-process (format "flycheck-%s" checker) + nil program args)) + (set-process-sentinel process 'flycheck-handle-signal) + (set-process-filter process 'flycheck-receive-checker-output) + (set-process-query-on-exit-flag process nil) + ;; Remember the syntax checker, the buffer and the callback + (process-put process 'flycheck-checker checker) + (process-put process 'flycheck-callback callback) + (process-put process 'flycheck-buffer (current-buffer)) + ;; Track the temporaries created by argument substitution in the + ;; process itself, to get rid of the global state ASAP. + (process-put process 'flycheck-temporaries flycheck-temporaries) + (setq flycheck-temporaries nil) + ;; Return the process + process) + (error + ;; In case of error, clean up our resources, and report the error back to + ;; Flycheck + (flycheck-safe-delete-temporaries) + (when process + ;; No need to explicitly delete the temporary files of the process, + ;; because deleting runs the sentinel, which will delete them anyway. + (delete-process process)) + (signal (car err) (cdr err)))))) + +(defun flycheck-interrupt-command-checker (_checker process) + "Interrupt a PROCESS." + ;; Deleting the process always triggers the sentinel, which does the cleanup + (when process + (delete-process process))) + +(defun flycheck-command-checker-print-doc (checker) + "Print additional documentation for a command CHECKER." + (let ((executable (flycheck-checker-default-executable checker)) + (config-file-var (flycheck-checker-config-file-var checker)) + (option-vars (-sort #'string< + (flycheck-checker-option-vars checker)))) + (princ "\n") + + (let ((doc-start (with-current-buffer standard-output (point-max)))) + ;; Track the start of our documentation so that we can re-indent it + ;; properly + (princ " This syntax checker executes \"") + (princ executable) + (princ "\"") + (when config-file-var + (princ ", using a configuration file from `") + (princ (symbol-name config-file-var)) + (princ "'")) + (princ ". The executable can be overridden with `") + (princ (symbol-name (flycheck-checker-executable-variable checker))) + (princ "'.") + + (with-current-buffer standard-output + (save-excursion + (fill-region-as-paragraph doc-start (point-max))))) + (princ "\n") + (when option-vars + (princ "\n This syntax checker can be configured with these options:\n\n") + (dolist (var option-vars) + (princ (format " * `%s'\n" var)))))) + +(defun flycheck-verify-command-checker (checker) + "Verify a command CHECKER in the current buffer. + +Return a list of `flycheck-verification-result' objects for +CHECKER." + (let ((executable (executable-find (flycheck-checker-executable checker)))) + (list + (flycheck-verification-result-new + :label "executable" + :message (if executable (format "Found at %s" executable) "Not found") + :face (if executable 'success '(bold error)))))) + + +;;; Process management for command syntax checkers +(defun flycheck-receive-checker-output (process output) + "Receive a syntax checking PROCESS OUTPUT." + (push output (process-get process 'flycheck-pending-output))) + +(defun flycheck-get-output (process) + "Get the complete output of PROCESS." + (with-demoted-errors "Error while retrieving process output: %S" + (let ((pending-output (process-get process 'flycheck-pending-output))) + (apply #'concat (nreverse pending-output))))) + +(defun flycheck-handle-signal (process _event) + "Handle a signal from the syntax checking PROCESS. + +_EVENT is ignored." + (when (memq (process-status process) '(signal exit)) + (let ((files (process-get process 'flycheck-temporaries)) + (buffer (process-get process 'flycheck-buffer)) + (callback (process-get process 'flycheck-callback))) + ;; Delete the temporary files + (mapc #'flycheck-safe-delete files) + (when (buffer-live-p buffer) + (with-current-buffer buffer + (condition-case err + (pcase (process-status process) + (`signal + (funcall callback 'interrupted)) + (`exit + (flycheck-finish-checker-process + (process-get process 'flycheck-checker) + (process-exit-status process) + files + (flycheck-get-output process) callback))) + (error + (funcall callback 'errored (error-message-string err))))))))) + +(defun flycheck-finish-checker-process + (checker exit-status files output callback) + "Finish a checker process from CHECKER with EXIT-STATUS. + +FILES is a list of files given as input to the checker. OUTPUT +is the output of the syntax checker. CALLBACK is the status +callback to use for reporting. + +Parse the OUTPUT and report an appropriate error status." + (let ((errors (flycheck-parse-output output checker (current-buffer)))) + (when (and (/= exit-status 0) (not errors)) + ;; Warn about a suspicious result from the syntax checker. We do right + ;; after parsing the errors, before filtering, because a syntax checker + ;; might report errors from other files (e.g. includes) even if there + ;; are no errors in the file being checked. + (funcall callback 'suspicious + (format "Checker %S returned non-zero exit code %s, but no errors from \ +output: %s\nChecker definition probably flawed." checker exit-status output))) + (funcall callback 'finished + ;; Fix error file names, by substituting them backwards from the + ;; temporaries + (mapcar (lambda (e) (flycheck-fix-error-filename e files)) + errors)))) + + +;;; Executables of command checkers. +(defmacro flycheck-def-executable-var (checker default-executable) + "Define the executable variable for CHECKER. + +DEFAULT-EXECUTABLE is the default executable. It is only used in +the docstring of the variable. + +The variable is defined with `defcustom' in the +`flycheck-executables' group. It's also defined to be risky as +file-local variable, to avoid arbitrary executables being used +for syntax checking." + (let ((executable-var (flycheck-checker-executable-variable checker))) + `(progn + (defcustom ,executable-var nil + ,(format "The executable of the %s syntax checker. + +Either a string containing the name or the path of the +executable, or nil to use the default executable from the syntax +checker declaration. + +The default executable is %S." checker default-executable) + :type '(choice (const :tag "Default executable" nil) + (string :tag "Name or path")) + :group 'flycheck-executables + :risky t)))) + +(defun flycheck-set-checker-executable (checker &optional executable) + "Set the EXECUTABLE of CHECKER in the current buffer. + +CHECKER is a syntax checker symbol. EXECUTABLE is a string with +the name of a executable or the path to an executable file, which +is to be used as executable for CHECKER. If omitted or nil, +reset the executable of CHECKER. + +Interactively, prompt for a syntax checker and an executable +file, and set the executable of the selected syntax checker. +With prefix arg, prompt for a syntax checker only, and reset the +executable of the select checker to the default. + +Set the executable variable of CHECKER, that is, +`flycheck-CHECKER-executable' to EXECUTABLE. Signal +`user-error', if EXECUTABLE does not denote a command or an +executable file. + +This command is intended for interactive use only. In Lisp, just +`let'-bind the corresponding variable, or set it directly. Use +`flycheck-checker-executable-variable' to obtain the executable +variable symbol for a syntax checker." + (declare (interactive-only "Set the executable variable directly instead")) + (interactive + (let* ((checker (read-flycheck-checker "Syntax checker: ")) + (default-executable (flycheck-checker-default-executable checker)) + (executable (if current-prefix-arg + nil + (read-file-name "Executable: " nil default-executable + nil nil #'executable-find)))) + (list checker executable))) + (when (and executable (not (executable-find executable))) + (user-error "%s is no executable" executable)) + (let ((variable (flycheck-checker-executable-variable checker))) + (set (make-local-variable variable) executable))) + + +;;; Configuration files and options for command checkers +;;;###autoload +(defmacro flycheck-def-config-file-var (symbol checker &optional file-name + &rest custom-args) + "Define SYMBOL as config file variable for CHECKER, with default FILE-NAME. + +SYMBOL is declared as customizable variable using `defcustom', to +provide a configuration file for the given syntax CHECKER. +CUSTOM-ARGS are forwarded to `defcustom'. + +FILE-NAME is the initial value of the new variable. If omitted, +the default value is nil. + +Use this together with the `config-file' form in the `:command' +argument to `flycheck-define-checker'." + (declare (indent 3)) + `(progn + (put ',checker 'flycheck-config-file-var ',symbol) + (defcustom ,symbol ,file-name + ,(format "Configuration file for `%s'. + +If set to a string, locate the configuration file using the +functions from `flycheck-locate-config-file-functions'. If the +file is found pass it to the syntax checker as configuration +file. + +If no configuration file is found, or if this variable is set to +nil, invoke the syntax checker without a configuration file. + +Use this variable as file-local variable if you need a specific +configuration file a buffer." checker) + :type '(choice (const :tag "No configuration file" nil) + (string :tag "File name or path")) + :group 'flycheck-config-files + ,@custom-args))) + +(defun flycheck-checker-config-file-var (checker) + "Get the associated configuration file variable of CHECKER. + +Return nil if CHECKER has no associated configuration file +variable." + (get checker 'flycheck-config-file-var)) + +(defun flycheck-checker-option-vars (checker) + "Get the associated option variables of CHECKER. + +Return a (possibly empty) list of variable symbols." + (get checker 'flycheck-option-vars)) + +(defun flycheck-locate-config-file (filename checker) + "Locate the configuration file FILENAME for CHECKER. + +Locate the configuration file using +`flycheck-locate-config-file-functions'. + +Return the absolute path of the configuration file, or nil if no +configuration file was found." + (-when-let (filepath (run-hook-with-args-until-success + 'flycheck-locate-config-file-functions + filename checker)) + (when (file-exists-p filepath) + filepath))) + +(defun flycheck-locate-config-file-absolute-path (filepath _checker) + "Locate a configuration file by a FILEPATH. + +If FILEPATH is a contains a path separator, expand it against the +default directory and return it. Otherwise return nil. + +_CHECKER is ignored." + ;; If the path is just a plain file name, skip it. + (unless (string= (file-name-nondirectory filepath) filepath) + (expand-file-name filepath))) + +(defun flycheck-locate-config-file-ancestor-directories (filename _checker) + "Locate a configuration FILENAME in ancestor directories. + +If the current buffer has a file name, search FILENAME in the +directory of the current buffer and all ancestors thereof (see +`locate-dominating-file'). If the file is found, return its +absolute path. Otherwise return nil. + +_CHECKER is ignored." + (-when-let* ((basefile (buffer-file-name)) + (directory (locate-dominating-file basefile filename))) + (expand-file-name filename directory))) + +(defun flycheck-locate-config-file-home (filename _checker) + "Locate a configuration FILENAME in the home directory. + +Return the absolute path, if FILENAME exists in the user's home +directory, or nil otherwise." + (let ((path (expand-file-name filename "~"))) + (when (file-exists-p path) + path))) + +(mapc (apply-partially #'custom-add-frequent-value + 'flycheck-locate-config-file-functions) + '(flycheck-locate-config-file-absolute-path + flycheck-locate-config-file-ancestor-directories + flycheck-locate-config-file-home)) + +;;;###autoload +(defmacro flycheck-def-option-var (symbol init-value checker docstring + &rest custom-args) + "Define SYMBOL as option variable with INIT-VALUE for CHECKER. + +SYMBOL is declared as customizable variable using `defcustom', to +provide an option for the given syntax CHECKER. INIT-VALUE is +the initial value of the variable, and DOCSTRING is its +docstring. CUSTOM-ARGS are forwarded to `defcustom'. + +Use this together with the `option', `option-list' and +`option-flag' forms in the `:command' argument to +`flycheck-define-checker'." + (declare (indent 3) + (doc-string 4)) + `(progn + (let ((options (flycheck-checker-option-vars ',checker))) + (unless (memq ',symbol options) + (put ',checker 'flycheck-option-vars (cons ',symbol options)))) + (defcustom ,symbol ,init-value + ,(format "%s + +This variable is an option for the syntax checker `%s'." docstring checker) + :group 'flycheck-options + ,@custom-args))) + +(defun flycheck-option-int (value) + "Convert an integral option VALUE to a string. + +If VALUE is nil, return nil. Otherwise return VALUE converted to +a string." + (when value + (number-to-string value))) + +(defun flycheck-option-comma-separated-list (value &optional separator filter) + "Convert VALUE into a list separated by SEPARATOR. + +SEPARATOR is a string to separate items in VALUE, defaulting to +\",\". FILTER is an optional function, which takes a single +argument and returns either a string or nil. + +If VALUE is a list, apply FILTER to each item in VALUE, remove +all nil items, and return a single string of all remaining items +separated by SEPARATOR. + +Otherwise, apply FILTER to VALUE and return the result. +SEPARATOR is ignored in this case." + (let ((filter (or filter #'identity)) + (separator (or separator ","))) + (if (listp value) + (-when-let (value (delq nil (mapcar filter value))) + (string-join value separator)) + (funcall filter value)))) + +(defmacro flycheck-def-args-var (symbol checker &rest custom-args) + "Define SYMBOL as argument variable for CHECKER. + +SYMBOL is declared as customizable, risky and buffer-local +variable using `defcustom' to provide an option for arbitrary +arguments for the given syntax CHECKER. CUSTOM-ARGS is forwarded +to `defcustom'. + +Use the `eval' form to splice this variable into the +`:command'." + (declare (indent 2)) + `(flycheck-def-option-var ,symbol nil ,checker + ,(format "A list of additional arguments for `%s'. + +The value of this variable is a list of strings with additional +command line arguments." checker) + :risky t + :type '(repeat (string :tag "Argument")) + ,@custom-args)) + + +;;; Command syntax checkers as compile commands +(defun flycheck-checker-pattern-to-error-regexp (pattern) + "Convert PATTERN into an error regexp for compile.el. + +Return a list representing PATTERN, suitable as element in +`compilation-error-regexp-alist'." + (let* ((regexp (car pattern)) + (level (cdr pattern)) + (level-no (pcase level + (`error 2) + (`warning 1) + (`info 0)))) + (list regexp 1 2 3 level-no))) + +(defun flycheck-checker-compilation-error-regexp-alist (checker) + "Convert error patterns of CHECKER for use with compile.el. + +Return an alist of all error patterns of CHECKER, suitable for +use with `compilation-error-regexp-alist'." + (mapcar #'flycheck-checker-pattern-to-error-regexp + (flycheck-checker-error-patterns checker))) + +(defun flycheck-checker-shell-command (checker) + "Get a shell command for CHECKER. + +Perform substitution in the arguments of CHECKER, but with +`flycheck-substitute-shell-argument'. + +Return the command of CHECKER as single string, suitable for +shell execution." + ;; Note: Do NOT use `combine-and-quote-strings' here. Despite it's name it + ;; does not properly quote shell arguments, and actually breaks for special + ;; characters. See https://github.com/flycheck/flycheck/pull/522 + (mapconcat + #'shell-quote-argument + (cons (flycheck-checker-executable checker) + (apply #'append + (mapcar (lambda (arg) + (if (memq arg '(source source-inplace source-original)) + (list (or (buffer-file-name) "")) + (flycheck-substitute-argument arg checker))) + (flycheck-checker-arguments checker)))) " ")) + +(defun flycheck-compile-name (_name) + "Get a name for a Flycheck compilation buffer. + +_NAME is ignored." + (format "*Flycheck %s*" (buffer-file-name))) + +(defun flycheck-compile (checker) + "Run CHECKER via `compile'. + +CHECKER must be a valid syntax checker. Interactively, prompt +for a syntax checker to run. + +Instead of highlighting errors in the buffer, this command pops +up a separate buffer with the entire output of the syntax checker +tool, just like `compile' (\\[compile])." + (interactive + (let ((default (flycheck-get-checker-for-buffer))) + (list (read-flycheck-checker "Run syntax checker as compile command: " + (when (get default 'flycheck-command) default) + 'flycheck-command)))) + (unless (flycheck-valid-checker-p checker) + (user-error "%S is not a valid syntax checker" checker)) + (unless (buffer-file-name) + (user-error "Cannot compile buffers without backing file")) + (unless (flycheck-may-use-checker checker) + (user-error "Cannot use syntax checker %S in this buffer" checker)) + (unless (flycheck-checker-executable checker) + (user-error "Cannot run checker %S as shell command" checker)) + (let* ((command (flycheck-checker-shell-command checker)) + (buffer (compilation-start command nil #'flycheck-compile-name))) + (with-current-buffer buffer + (set (make-local-variable 'compilation-error-regexp-alist) + (flycheck-checker-compilation-error-regexp-alist checker))))) + + +;;; General error parsing for command checkers +(defun flycheck-parse-output (output checker buffer) + "Parse OUTPUT from CHECKER in BUFFER. + +OUTPUT is a string with the output from the checker symbol +CHECKER. BUFFER is the buffer which was checked. + +Return the errors parsed with the error patterns of CHECKER." + (funcall (flycheck-checker-error-parser checker) output checker buffer)) + +(defun flycheck-fix-error-filename (err buffer-files) + "Fix the file name of ERR from BUFFER-FILES. + +Make the file name of ERR absolute. If the absolute file name of +ERR is in BUFFER-FILES, replace it with the return value of the +function `buffer-file-name'." + (flycheck-error-with-buffer err + (-when-let (filename (flycheck-error-filename err)) + (setq filename (expand-file-name filename)) + (when (-any? (apply-partially #'flycheck-same-files-p filename) + buffer-files) + (setq filename (buffer-file-name))) + (setf (flycheck-error-filename err) filename))) + err) + + +;;; Error parsers for command syntax checkers +(defun flycheck-parse-xml-region (beg end) + "Parse the xml region between BEG and END. + +Wrapper around `xml-parse-region' which transforms the return +value of this function into one compatible to +`libxml-parse-xml-region' by simply returning the first element +from the node list." + (car (xml-parse-region beg end))) + +(defvar flycheck-xml-parser + (if (fboundp 'libxml-parse-xml-region) + 'libxml-parse-xml-region 'flycheck-parse-xml-region) + "Parse an xml string from a region. + +Use libxml if Emacs is built with libxml support. Otherwise fall +back to `xml-parse-region', via `flycheck-parse-xml-region'.") + +(defun flycheck-parse-xml-string (xml) + "Parse an XML string. + +Return the document tree parsed from XML in the form `(ROOT ATTRS +BODY...)'. ROOT is a symbol identifying the name of the root +element. ATTRS is an alist of the attributes of the root node. +BODY is zero or more body elements, either as strings (in case of +text nodes) or as XML nodes, in the same for as the root node." + (with-temp-buffer + (insert xml) + (funcall flycheck-xml-parser (point-min) (point-max)))) + +(defun flycheck-parse-checkstyle (output checker buffer) + "Parse Checkstyle errors from OUTPUT. + +Parse Checkstyle-like XML output. Use this error parser for +checkers that have an option to output errors in this format. + +See URL `http://checkstyle.sourceforge.net/' for information +about Checkstyle." + (pcase (flycheck-parse-xml-string output) + (`(checkstyle ,_ . ,file-nodes) + (let (errors) + (dolist (node file-nodes) + (pcase node + (`(file ,file-attrs . ,error-nodes) + (dolist (node error-nodes) + (pcase node + (`(error ,error-attrs . ,_) + (let-alist error-attrs + (push (flycheck-error-new-at + (flycheck-string-to-number-safe .line) + (flycheck-string-to-number-safe .column) + (pcase .severity + (`"error" 'error) + (`"warning" 'warning) + (`"info" 'info) + ;; Default to error for unknown .severity + (_ 'error)) + .message + :checker checker :id .source + :buffer buffer + :filename (cdr (assq 'name file-attrs))) + errors)))))))) + (nreverse errors))))) + +(defun flycheck-parse-cppcheck (output checker buffer) + "Parse Cppcheck errors from OUTPUT. + +Parse Cppcheck XML v2 output. + +See URL `http://cppcheck.sourceforge.net/' for more information +about Cppcheck." + (pcase (flycheck-parse-xml-string output) + (`(results ,_ . ,body) + (let (errors) + (dolist (node body) + (pcase node + (`(errors ,_ . ,error-nodes) + (dolist (node error-nodes) + (pcase node + (`(error ,error-attrs . ,loc-nodes) + (let ((id (cdr (assq 'id error-attrs))) + (message (cdr (assq 'verbose error-attrs))) + (level (pcase (cdr (assq 'severity error-attrs)) + (`"error" 'error) + (`"style" 'info) + (`"information" 'info) + (_ 'warning)))) + (dolist (node loc-nodes) + (pcase node + (`(location ,loc-attrs . ,_) + (let-alist loc-attrs + (push (flycheck-error-new-at + (flycheck-string-to-number-safe .line) + nil + level message + :id id + :checker checker + :buffer buffer + :filename .file) + errors)))))))))))) + (nreverse errors))))) + +(defun flycheck-parse-phpmd (output checker buffer) + "Parse phpmd errors from OUTPUT. + +See URL `http://phpmd.org/' for more information about phpmd." + (pcase (flycheck-parse-xml-string output) + (`(pmd ,_ . ,body) + (let (errors) + (dolist (node body) + (pcase node + (`(file ,file-attrs . ,violation-nodes) + (let ((filename (cdr (assq 'name file-attrs)))) + (dolist (node violation-nodes) + (pcase node + (`(violation ,vio-attrs ,(and message (pred stringp))) + (let-alist vio-attrs + ;; TODO: Map priority to an error level? + ;; TODO: Respect endline + (push + (flycheck-error-new-at + (flycheck-string-to-number-safe .beginline) + nil + 'warning (string-trim message) + :id .rule + :checker checker + :buffer buffer + :filename filename) + errors))))))))) + (nreverse errors))))) + + +;;; Error parsing with regular expressions +(defun flycheck-get-regexp (patterns) + "Create a single regular expression from PATTERNS." + (rx-to-string `(or ,@(mapcar (lambda (p) (list 'regexp (car p))) patterns)) + 'no-group)) + +(defun flycheck-tokenize-output-with-patterns (output patterns) + "Tokenize OUTPUT with PATTERNS. + +Split the output into error tokens, using all regular expressions +from the error PATTERNS. An error token is simply a string +containing a single error from OUTPUT. Such a token can then be +parsed into a structured error by applying the PATTERNS again, +see `flycheck-parse-errors-with-patterns'. + +Return a list of error tokens." + (let ((regexp (flycheck-get-regexp patterns)) + (last-match 0) + errors) + (while (string-match regexp output last-match) + (push (match-string 0 output) errors) + (setq last-match (match-end 0))) + (reverse errors))) + +(defun flycheck-try-parse-error-with-pattern (err pattern checker) + "Try to parse a single ERR with a PATTERN for CHECKER. + +Return the parsed error if PATTERN matched ERR, or nil +otherwise." + (let ((regexp (car pattern)) + (level (cdr pattern))) + (when (string-match regexp err) + (let ((filename (match-string 1 err)) + (line (match-string 2 err)) + (column (match-string 3 err)) + (message (match-string 4 err)) + (id (match-string 5 err))) + (flycheck-error-new-at + (flycheck-string-to-number-safe line) + (flycheck-string-to-number-safe column) + level + (unless (string-empty-p message) message) + :id (unless (string-empty-p id) id) + :checker checker + :filename (if (or (null filename) (string-empty-p filename)) + (buffer-file-name) + filename)))))) + +(defun flycheck-parse-error-with-patterns (err patterns checker) + "Parse a gle ERR with error PATTERNS for CHECKER. + +Apply each pattern in PATTERNS to ERR, in the given order, and +return the first parsed error." + ;; Try to parse patterns in the order of declaration to make sure that the + ;; first match wins. + (let (parsed-error) + (while (and patterns + (not (setq parsed-error + (flycheck-try-parse-error-with-pattern + err (car patterns) checker)))) + (setq patterns (cdr patterns))) + parsed-error)) + +(defun flycheck-parse-with-patterns (output checker buffer) + "Parse OUTPUT from CHECKER with error patterns. + +Uses the error patterns of CHECKER to tokenize the output and +tries to parse each error token with all patterns, in the order +of declaration. Hence an error is never matched twice by two +different patterns. The pattern declared first always wins. + +_BUFFER is ignored. + +Return a list of parsed errors and warnings (as `flycheck-error' +objects)." + (with-current-buffer buffer + (let ((patterns (flycheck-checker-error-patterns checker))) + (mapcar (lambda (err) + (flycheck-parse-error-with-patterns err patterns checker)) + (flycheck-tokenize-output-with-patterns output patterns))))) + + +;;; Convenience definition of command-syntax checkers +(defmacro flycheck-define-checker (symbol docstring &rest properties) + "Define SYMBOL as command syntax checker with DOCSTRING and PROPERTIES. + +Like `flycheck-define-command-checker', but PROPERTIES must not +be quoted. Also, implicitly define the executable variable for +SYMBOL with `flycheck-def-executable-var'." + (declare (indent 1) + (doc-string 2)) + (let ((command (plist-get properties :command)) + (parser (plist-get properties :error-parser)) + (filter (plist-get properties :error-filter)) + (predicate (plist-get properties :predicate))) + + `(progn + (flycheck-def-executable-var ,symbol ,(car command)) + + (flycheck-define-command-checker ',symbol + ,docstring + :command ',command + ,@(when parser + `(:error-parser #',parser)) + :error-patterns ',(plist-get properties :error-patterns) + ,@(when filter + `(:error-filter #',filter)) + :modes ',(plist-get properties :modes) + ,@(when predicate + `(:predicate #',predicate)) + :next-checkers ',(plist-get properties :next-checkers))))) + + +;;; Built-in checkers +(flycheck-def-args-var flycheck-gnat-args ada-gnat + :package-version '(flycheck . "0.20")) + +(flycheck-def-option-var flycheck-gnat-include-path nil ada-gnat + "A list of include directories for GNAT. + +The value of this variable is a list of strings, where each +string is a directory to add to the include path of gcc. +Relative paths are relative to the file being checked." + :type '(repeat (directory :tag "Include directory")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.20")) + +(flycheck-def-option-var flycheck-gnat-language-standard "2012" ada-gnat + "The language standard to use in GNAT. + +The value of this variable is either a string denoting a language +standard, or nil, to use the default standard. When non-nil, pass +the language standard via the `-std' option." + :type '(choice (const :tag "Default standard" nil) + (string :tag "Language standard")) + :safe #'stringp + :package-version '(flycheck . "0.20")) + +(flycheck-def-option-var flycheck-gnat-warnings + '("wa") ada-gnat + "A list of additional Ada warnings to enable in GNAT. + +The value of this variable is a list of strings, where each +string is the name of a warning category to enable. By default, +most optional warnings are recommended, as in `-gnata'. + +Refer to Info Node `(gnat_ugn_unw)Warning Message Control' for +more information about GNAT warnings." + :type '(repeat :tag "Warnings" (string :tag "Warning name")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.20")) + +(flycheck-define-checker ada-gnat + "An Ada syntax checker using GNAT. + +Uses the GNAT compiler from GCC. See URL +`https://gcc.gnu.org/onlinedocs/gnat_ugn_unw/'." + :command ("gnatmake" + "-c" ; Just compile, don't bind + "-f" ; Force re-compilation + "-u" ; Compile the main file only + "-gnatf" ; Full error information + "-gnatef" ; Full source file name + "-D" temporary-directory + (option-list "-gnat" flycheck-gnat-warnings concat) + (option-list "-I" flycheck-gnat-include-path concat) + (option "-gnat" flycheck-gnat-language-standard concat) + (eval flycheck-gnat-args) + source) + :error-patterns + ((error line-start + (message "In file included from") " " (file-name) ":" line ":" + column ":" + line-end) + (info line-start (file-name) ":" line ":" column + ": note: " (message) line-end) + (warning line-start (file-name) ":" line ":" column + ": warning: " (message) line-end) + (error line-start (file-name) ":" line ":" column ;no specific error prefix in Ada + ": " (message) line-end)) + :modes ada-mode) + +(flycheck-define-checker asciidoc + "A AsciiDoc syntax checker using the AsciiDoc compiler. + +See URL `http://www.methods.co.nz/asciidoc'." + :command ("asciidoc" source) + :error-patterns + ((error line-start "asciidoc: ERROR: " (file-name) + ": Line " line ": " (message) line-end) + (warning line-start "asciidoc: " (or "WARNING" "DEPRECATED") ": " (file-name) + ": Line " line ": " (message) line-end)) + :modes adoc-mode) + +(flycheck-def-args-var flycheck-clang-args c/c++-clang + :package-version '(flycheck . "0.22")) + +(flycheck-def-option-var flycheck-clang-blocks nil c/c++-clang + "Enable blocks in Clang. + +When non-nil, enable blocks in Clang with `-fblocks'. See URL +`http://clang.llvm.org/docs/BlockLanguageSpec.html' for more +information about blocks." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.20")) + +(flycheck-def-option-var flycheck-clang-definitions nil c/c++-clang + "Additional preprocessor definitions for Clang. + +The value of this variable is a list of strings, where each +string is an additional definition to pass to Clang, via the `-D' +option." + :type '(repeat (string :tag "Definition")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.15")) + +(flycheck-def-option-var flycheck-clang-include-path nil c/c++-clang + "A list of include directories for Clang. + +The value of this variable is a list of strings, where each +string is a directory to add to the include path of Clang. +Relative paths are relative to the file being checked." + :type '(repeat (directory :tag "Include directory")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.14")) + +(flycheck-def-option-var flycheck-clang-includes nil c/c++-clang + "A list of additional include files for Clang. + +The value of this variable is a list of strings, where each +string is a file to include before syntax checking. Relative +paths are relative to the file being checked." + :type '(repeat (file :tag "Include file")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.15")) + +(flycheck-def-option-var flycheck-clang-language-standard nil c/c++-clang + "The language standard to use in Clang. + +The value of this variable is either a string denoting a language +standard, or nil, to use the default standard. When non-nil, +pass the language standard via the `-std' option." + :type '(choice (const :tag "Default standard" nil) + (string :tag "Language standard")) + :safe #'stringp + :package-version '(flycheck . "0.15")) +(make-variable-buffer-local 'flycheck-clang-language-standard) + +(flycheck-def-option-var flycheck-clang-ms-extensions nil c/c++-clang + "Whether to enable Microsoft extensions to C/C++ in Clang. + +When non-nil, enable Microsoft extensions to C/C++ via +`-fms-extensions'." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.16")) + +(flycheck-def-option-var flycheck-clang-no-exceptions nil c/c++-clang + "Whether to disable exceptions in Clang. + +When non-nil, disable exceptions for syntax checks, via +`-fno-exceptions'." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.20")) + +(flycheck-def-option-var flycheck-clang-no-rtti nil c/c++-clang + "Whether to disable RTTI in Clang. + +When non-nil, disable RTTI for syntax checks, via `-fno-rtti'." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.15")) + +(flycheck-def-option-var flycheck-clang-pedantic nil c/c++-clang + "Whether to warn about language extensions in Clang. + +For ISO C, follows the version specified by any -std option used. +When non-nil, disable non-ISO extensions to C/C++ via +`-pedantic'." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.23")) + +(flycheck-def-option-var flycheck-clang-pedantic-errors nil c/c++-clang + "Whether to error on language extensions in Clang. + +For ISO C, follows the version specified by any -std option used. +When non-nil, disable non-ISO extensions to C/C++ via +`-pedantic-errors'." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.23")) + +(flycheck-def-option-var flycheck-clang-standard-library nil c/c++-clang + "The standard library to use for Clang. + +The value of this variable is the name of a standard library as +string, or nil to use the default standard library. + +Refer to the Clang manual at URL +`http://clang.llvm.org/docs/UsersManual.html' for more +information about the standard library." + :type '(choice (const "libc++") + (const :tag "GNU libstdc++" "libstdc++") + (string :tag "Library name")) + :safe #'stringp + :package-version '(flycheck . "0.15")) + +(flycheck-def-option-var flycheck-clang-warnings '("all" "extra") c/c++-clang + "A list of additional warnings to enable in Clang. + +The value of this variable is a list of strings, where each string +is the name of a warning category to enable. By default, all +recommended warnings and some extra warnings are enabled (as by +`-Wall' and `-Wextra' respectively). + +Refer to the Clang manual at URL +`http://clang.llvm.org/docs/UsersManual.html' for more +information about warnings." + :type '(choice (const :tag "No additional warnings" nil) + (repeat :tag "Additional warnings" + (string :tag "Warning name"))) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.14")) + +(defun flycheck-c/c++-quoted-include-directory () + "Get the directory for quoted includes. + +C/C++ compiles typicall look up includes with quotation marks in +the directory of the file being compiled. However, since +Flycheck uses temporary copies for syntax checking, it needs to +explicitly determine the directory for quoted includes. + +This function determines the directory by looking at +`buffer-file-name', or if that is nil, at `default-directory'." + (-if-let (fn (buffer-file-name)) + (file-name-directory fn) + ;; If the buffer has no file name, fall back to its default directory + default-directory)) + +(flycheck-define-checker c/c++-clang + "A C/C++ syntax checker using Clang. + +See URL `http://clang.llvm.org/'." + :command ("clang" + "-fsyntax-only" + "-fno-color-diagnostics" ; Do not include color codes in output + "-fno-caret-diagnostics" ; Do not visually indicate the source + ; location + "-fno-diagnostics-show-option" ; Do not show the corresponding + ; warning group + "-iquote" (eval (flycheck-c/c++-quoted-include-directory)) + (option "-std=" flycheck-clang-language-standard concat) + (option-flag "-pedantic" flycheck-clang-pedantic) + (option-flag "-pedantic-errors" flycheck-clang-pedantic-errors) + (option "-stdlib=" flycheck-clang-standard-library concat) + (option-flag "-fms-extensions" flycheck-clang-ms-extensions) + (option-flag "-fno-exceptions" flycheck-clang-no-exceptions) + (option-flag "-fno-rtti" flycheck-clang-no-rtti) + (option-flag "-fblocks" flycheck-clang-blocks) + (option-list "-include" flycheck-clang-includes) + (option-list "-W" flycheck-clang-warnings concat) + (option-list "-D" flycheck-clang-definitions concat) + (option-list "-I" flycheck-clang-include-path) + (eval flycheck-clang-args) + "-x" (eval + (pcase major-mode + (`c++-mode "c++") + (`c-mode "c"))) + source) + :error-patterns + ((error line-start + (message "In file included from") " " (file-name) ":" line ":" + line-end) + (info line-start (file-name) ":" line ":" column + ": note: " (optional (message)) line-end) + (warning line-start (file-name) ":" line ":" column + ": warning: " (optional (message)) line-end) + (error line-start (file-name) ":" line ":" column + ": " (or "fatal error" "error") ": " (optional (message)) line-end)) + :error-filter + (lambda (errors) + (let ((errors (flycheck-sanitize-errors errors))) + (dolist (err errors) + ;; Clang will output empty messages for #error/#warning pragmas without + ;; messages. We fill these empty errors with a dummy message to get + ;; them past our error filtering + (setf (flycheck-error-message err) + (or (flycheck-error-message err) "no message"))) + (flycheck-fold-include-levels errors "In file included from"))) + :modes (c-mode c++-mode) + :next-checkers ((warning . c/c++-cppcheck))) + +(flycheck-def-args-var flycheck-gcc-args c/c++-gcc + :package-version '(flycheck . "0.22")) + +(flycheck-def-option-var flycheck-gcc-definitions nil c/c++-gcc + "Additional preprocessor definitions for GCC. + +The value of this variable is a list of strings, where each +string is an additional definition to pass to GCC, via the `-D' +option." + :type '(repeat (string :tag "Definition")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.20")) + +(flycheck-def-option-var flycheck-gcc-include-path nil c/c++-gcc + "A list of include directories for GCC. + +The value of this variable is a list of strings, where each +string is a directory to add to the include path of gcc. +Relative paths are relative to the file being checked." + :type '(repeat (directory :tag "Include directory")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.20")) + +(flycheck-def-option-var flycheck-gcc-includes nil c/c++-gcc + "A list of additional include files for GCC. + +The value of this variable is a list of strings, where each +string is a file to include before syntax checking. Relative +paths are relative to the file being checked." + :type '(repeat (file :tag "Include file")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.20")) + +(flycheck-def-option-var flycheck-gcc-language-standard nil c/c++-gcc + "The language standard to use in GCC. + +The value of this variable is either a string denoting a language +standard, or nil, to use the default standard. When non-nil, +pass the language standard via the `-std' option." + :type '(choice (const :tag "Default standard" nil) + (string :tag "Language standard")) + :safe #'stringp + :package-version '(flycheck . "0.20")) +(make-variable-buffer-local 'flycheck-gcc-language-standard) + +(flycheck-def-option-var flycheck-gcc-no-exceptions nil c/c++-gcc + "Whether to disable exceptions in GCC. + +When non-nil, disable exceptions for syntax checks, via +`-fno-exceptions'." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.20")) + +(flycheck-def-option-var flycheck-gcc-no-rtti nil c/c++-gcc + "Whether to disable RTTI in GCC. + +When non-nil, disable RTTI for syntax checks, via `-fno-rtti'." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.20")) + +(flycheck-def-option-var flycheck-gcc-openmp nil c/c++-gcc + "Whether to enable OpenMP in GCC. + +When non-nil, enable OpenMP for syntax checkers, via +`-fopenmp'." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.21")) + +(flycheck-def-option-var flycheck-gcc-pedantic nil c/c++-clang + "Whether to warn about language extensions in GCC. + +For ISO C, follows the version specified by any -std option used. +When non-nil, disable non-ISO extensions to C/C++ via +`-pedantic'." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.23")) + +(flycheck-def-option-var flycheck-gcc-pedantic-errors nil c/c++-clang + "Whether to error on language extensions in GCC. + +For ISO C, follows the version specified by any -std option used. +When non-nil, disable non-ISO extensions to C/C++ via +`-pedantic-errors'." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.23")) + +(flycheck-def-option-var flycheck-gcc-warnings '("all" "extra") c/c++-gcc + "A list of additional warnings to enable in GCC. + +The value of this variable is a list of strings, where each string +is the name of a warning category to enable. By default, all +recommended warnings and some extra warnings are enabled (as by +`-Wall' and `-Wextra' respectively). + +Refer to the gcc manual at URL +`https://gcc.gnu.org/onlinedocs/gcc/' for more information about +warnings." + :type '(choice (const :tag "No additional warnings" nil) + (repeat :tag "Additional warnings" + (string :tag "Warning name"))) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.20")) + +(flycheck-define-checker c/c++-gcc + "A C/C++ syntax checker using GCC. + +Requires GCC 4.8 or newer. See URL `https://gcc.gnu.org/'." + :command ("gcc" + "-fshow-column" + "-fno-diagnostics-show-caret" ; Do not visually indicate the source location + "-fno-diagnostics-show-option" ; Do not show the corresponding + ; warning group + "-iquote" (eval (flycheck-c/c++-quoted-include-directory)) + (option "-std=" flycheck-gcc-language-standard concat) + (option-flag "-pedantic" flycheck-gcc-pedantic) + (option-flag "-pedantic-errors" flycheck-gcc-pedantic-errors) + (option-flag "-fno-exceptions" flycheck-gcc-no-exceptions) + (option-flag "-fno-rtti" flycheck-gcc-no-rtti) + (option-flag "-fopenmp" flycheck-gcc-openmp) + (option-list "-include" flycheck-gcc-includes) + (option-list "-W" flycheck-gcc-warnings concat) + (option-list "-D" flycheck-gcc-definitions concat) + (option-list "-I" flycheck-gcc-include-path) + (eval flycheck-gcc-args) + "-x" (eval + (pcase major-mode + (`c++-mode "c++") + (`c-mode "c"))) + source + ;; GCC performs full checking only when actually compiling, so + ;; `-fsyntax-only' is not enough. Just let it generate assembly + ;; code. + "-S" "-o" null-device) + :error-patterns + ((error line-start + (message "In file included from") " " (file-name) ":" line ":" + column ":" + line-end) + (info line-start (file-name) ":" line ":" column + ": note: " (message) line-end) + (warning line-start (file-name) ":" line ":" column + ": warning: " (message) line-end) + (error line-start (file-name) ":" line ":" column + ": " (or "fatal error" "error") ": " (message) line-end)) + :error-filter + (lambda (errors) + (flycheck-fold-include-levels (flycheck-sanitize-errors errors) + "In file included from")) + :modes (c-mode c++-mode) + :next-checkers ((warning . c/c++-cppcheck))) + +(flycheck-def-option-var flycheck-cppcheck-checks '("style") c/c++-cppcheck + "Enabled checks for Cppcheck. + +The value of this variable is a list of strings, where each +string is the name of an additional check to enable. By default, +all coding style checks are enabled. + +See section \"Enable message\" in the Cppcheck manual at URL +`http://cppcheck.sourceforge.net/manual.pdf', and the +documentation of the `--enable' option for more information, +including a list of supported checks." + :type '(repeat :tag "Additional checks" + (string :tag "Check name")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.14")) + +(flycheck-def-option-var flycheck-cppcheck-inconclusive nil c/c++-cppcheck + "Whether to enable Cppcheck inconclusive checks. + +When non-nil, enable Cppcheck inconclusive checks. This allows Cppcheck to +report warnings it's not certain of, but it may result in false positives. + +This will have no effect when using Cppcheck 1.53 and older." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.19")) + +(flycheck-define-checker c/c++-cppcheck + "A C/C++ checker using cppcheck. + +See URL `http://cppcheck.sourceforge.net/'." + :command ("cppcheck" "--quiet" "--xml-version=2" "--inline-suppr" + (option "--enable=" flycheck-cppcheck-checks concat + flycheck-option-comma-separated-list) + (option-flag "--inconclusive" flycheck-cppcheck-inconclusive) + source) + :error-parser flycheck-parse-cppcheck + :modes (c-mode c++-mode)) + +(flycheck-define-checker cfengine + "A CFEngine syntax checker using cf-promises. + +See URL `http://cfengine.com/'." + :command ("cf-promises" "-Wall" "-f" + ;; We must stay in the same directory to resolve @include + source-inplace) + :error-patterns + ((warning line-start (file-name) ":" line ":" column + ": warning: " (message) line-end) + (error line-start (file-name) ":" line ":" column + ": error: " (message) line-end)) + :modes (cfengine-mode cfengine3-mode)) + +(flycheck-def-option-var flycheck-foodcritic-tags nil chef-foodcritic + "A list of tags to select for Foodcritic. + +The value of this variable is a list of strings where each string +is a tag expression describing Foodcritic rules to enable or +disable, via the `--tags' option. To disable a tag, prefix it +with `~'." + :type '(repeat :tag "Tags" (string :tag "Tag expression")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.23")) + +(flycheck-define-checker chef-foodcritic + "A Chef cookbooks syntax checker using Foodcritic. + +See URL `http://acrmp.github.io/foodcritic/'." + ;; Use `source-inplace' to allow resource discovery with relative paths. + ;; foodcritic interprets these as relative to the source file, so we need to + ;; stay within the source tree. See + ;; https://github.com/flycheck/flycheck/pull/556 + :command ("foodcritic" + (option-list "--tags" flycheck-foodcritic-tags) + source-inplace) + :error-patterns + ((error line-start (message) ": " (file-name) ":" line line-end)) + :modes (enh-ruby-mode ruby-mode) + :predicate + (lambda () + (let ((parent-dir (file-name-directory + (directory-file-name + (expand-file-name default-directory))))) + (or + ;; Chef CookBook + ;; http://docs.opscode.com/chef/knife.html#id38 + (locate-dominating-file parent-dir "recipes") + ;; Knife Solo + ;; http://matschaffer.github.io/knife-solo/#label-Init+command + (locate-dominating-file parent-dir "cookbooks"))))) + +(flycheck-define-checker coffee + "A CoffeeScript syntax checker using coffee. + +See URL `http://coffeescript.org/'." + ;; --print suppresses generation of compiled .js files + :command ("coffee" "--compile" "--print" source) + :error-patterns + ((error line-start (file-name) ":" line ":" column + ": error: " (message) line-end)) + :modes coffee-mode + :next-checkers ((warning . coffee-coffeelint))) + +(flycheck-def-config-file-var flycheck-coffeelintrc coffee-coffeelint + ".coffeelint.json" + :safe #'stringp) + +(flycheck-define-checker coffee-coffeelint + "A CoffeeScript style checker using coffeelint. + +This syntax checker requires coffeelint 1.0 or newer. + +See URL `http://www.coffeelint.org/'." + :command + ("coffeelint" + (config-file "--file" flycheck-coffeelintrc) + "--reporter" "checkstyle" source) + :error-parser flycheck-parse-checkstyle + :error-filter (lambda (errors) + (flycheck-remove-error-ids + (flycheck-sanitize-errors errors))) + :modes coffee-mode) + +(flycheck-define-checker coq + "A Coq syntax checker using the Coq compiler. + +See URL `http://coq.inria.fr/'." + ;; We use coqtop in batch mode, because coqc is picky about file names. + :command ("coqtop" "-batch" "-load-vernac-source" source) + :error-patterns + ((error line-start "File \"" (file-name) "\", line " line + ;; TODO: Parse the end column, once Flycheck supports that + ", characters " column "-" (one-or-more digit) ":\n" + (or "Syntax error: " "Error: ") + ;; Most Coq error messages span multiple lines, and end with a dot. + ;; There are simple one-line messages, too, though. + (message (or (and (one-or-more (or not-newline "\n")) ".") + (one-or-more not-newline))) + line-end)) + :error-filter + (lambda (errors) + (dolist (err errors) + (setf (flycheck-error-message err) + (replace-regexp-in-string (rx (1+ (syntax whitespace)) line-end) + "" (flycheck-error-message err) + 'fixedcase 'literal))) + (flycheck-increment-error-columns errors)) + :modes coq-mode) + +(flycheck-define-checker css-csslint + "A CSS syntax and style checker using csslint. + +See URL `https://github.com/CSSLint/csslint'." + :command ("csslint" "--format=checkstyle-xml" source) + :error-parser flycheck-parse-checkstyle + :error-filter flycheck-dequalify-error-ids + :modes css-mode) + +(defconst flycheck-d-module-re + (rx "module" (one-or-more (syntax whitespace)) + (group (one-or-more (not (syntax whitespace)))) + (zero-or-more (syntax whitespace)) + ";") + "Regular expression to match a D module declaration.") + +(defun flycheck-d-base-directory () + "Get the relative base directory path for this module." + (let* ((file-name (buffer-file-name)) + (module-file (if (string= (file-name-nondirectory file-name) + "package.d") + (directory-file-name (file-name-directory file-name)) + file-name))) + (flycheck-module-root-directory + (flycheck-find-in-buffer flycheck-d-module-re) + module-file))) + +(flycheck-def-option-var flycheck-dmd-include-path nil d-dmd + "A list of include directories for dmd. + +The value of this variable is a list of strings, where each +string is a directory to add to the include path of dmd. +Relative paths are relative to the file being checked." + :type '(repeat (directory :tag "Include directory")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.18")) + +(flycheck-def-args-var flycheck-dmd-args d-dmd + :package-version '(flycheck . "0.24")) + +(flycheck-define-checker d-dmd + "A D syntax checker using the DMD compiler. + +Requires DMD 2.066 or newer. See URL `http://dlang.org/'." + :command ("dmd" + "-debug" ; Compile in debug mode + "-o-" ; Don't generate an object file + "-vcolumns" ; Add columns in output + "-wi" ; Compilation will continue even if there are warnings + (eval (concat "-I" (flycheck-d-base-directory))) + (option-list "-I" flycheck-dmd-include-path concat) + (eval flycheck-dmd-args) + source) + :error-patterns + ((error line-start + (file-name) "(" line "," column "): Error: " (message) + line-end) + (warning line-start (file-name) "(" line "," column "): " + (or "Warning" "Deprecation") ": " (message) line-end)) + :modes d-mode) + +(defconst flycheck-this-emacs-executable + (concat invocation-directory invocation-name) + "The path to the currently running Emacs executable.") + +(defconst flycheck-emacs-args '("-Q" "--batch") + "Common arguments to Emacs invocations.") + +(defmacro flycheck-prepare-emacs-lisp-form (&rest body) + "Prepare BODY for use as check form in a subprocess." + (declare (indent 0)) + `(flycheck-sexp-to-string + '(progn + (defvar jka-compr-inhibit) + (unwind-protect + ;; Flycheck inhibits compression of temporary files, thus we + ;; must not attempt to decompress. + (let ((jka-compr-inhibit t)) + ;; Strip option-argument separator from arguments, if present + (when (equal (car command-line-args-left) "--") + (setq command-line-args-left (cdr command-line-args-left))) + ,@body) + ;; Prevent Emacs from processing the arguments on its own, see + ;; https://github.com/flycheck/flycheck/issues/319 + (setq command-line-args-left nil))))) + +(defconst flycheck-emacs-lisp-check-form + (flycheck-prepare-emacs-lisp-form + ;; Keep track of the generated bytecode files, to delete them after byte + ;; compilation. + (defvar flycheck-byte-compiled-files nil) + (let ((byte-compile-dest-file-function + (lambda (source) + (let ((temp-file (make-temp-file (file-name-nondirectory source)))) + (push temp-file flycheck-byte-compiled-files) + temp-file)))) + (unwind-protect + (byte-compile-file (car command-line-args-left)) + (mapc (lambda (f) (ignore-errors (delete-file f))) + flycheck-byte-compiled-files))))) + +(flycheck-def-option-var flycheck-emacs-lisp-load-path nil emacs-lisp + "Load path to use in the Emacs Lisp syntax checker. + +When set to `inherit', use the `load-path' of the current Emacs +session during syntax checking. + +When set to a list of strings, add each directory in this list to +the `load-path' before invoking the byte compiler. Relative +paths in this list are expanded against the `default-directory' +of the buffer to check. + +When nil, do not explicitly set the `load-path' during syntax +checking. The syntax check only uses the built-in `load-path' of +Emacs in this case. + +Note that changing this variable can lead to wrong results of the +syntax check, e.g. if an unexpected version of a required library +is used." + :type '(choice (const :tag "Inherit current `load-path'" inherit) + (repeat :tag "Load path" directory)) + :risky t + :package-version '(flycheck . "0.14")) + +(flycheck-def-option-var flycheck-emacs-lisp-initialize-packages + 'auto emacs-lisp + "Whether to initialize packages in the Emacs Lisp syntax checker. + +To initialize packages, call `package-initialize' before +byte-compiling the file to check. + +When nil, never initialize packages. When `auto', initialize +packages only when checking `user-init-file' or files from +`user-emacs-directory'. For any other non-nil value, always +initialize packages." + :type '(choice (const :tag "Do not initialize packages" nil) + (const :tag "Initialize packages for configuration only" auto) + (const :tag "Always initialize packages" t)) + :risky t + :package-version '(flycheck . "0.14")) + +(defconst flycheck-emacs-lisp-package-initialize-form + (flycheck-sexp-to-string + '(with-demoted-errors "Error during package initialization: %S" + (package-initialize))) + "Form used to initialize packages.") + +(defun flycheck-option-emacs-lisp-package-initialize (value) + "Option VALUE filter for `flycheck-emacs-lisp-initialize-packages'." + (let ((shall-initialize + (if (eq value 'auto) + (or (flycheck-in-user-emacs-directory-p (buffer-file-name)) + ;; `user-init-file' is nil in non-interactive sessions. Now, + ;; no user would possibly use Flycheck in a non-interactive + ;; session, but our unit tests run non-interactively, so we + ;; have to handle this case anyway + (and user-init-file + (flycheck-same-files-p (buffer-file-name) + user-init-file))) + value))) + (when shall-initialize + ;; If packages shall be initialized, return the corresponding form, + ;; otherwise make Flycheck ignore the option by returning nil. + flycheck-emacs-lisp-package-initialize-form))) + +(flycheck-def-option-var flycheck-emacs-lisp-package-user-dir nil emacs-lisp + "Package directory for the Emacs Lisp syntax checker. + +When set to a string, set `package-user-dir' to the value of this +variable before initializing packages. + +This variable has no effect, if +`flycheck-emacs-lisp-initialize-packages' is nil." + :type '(choice (const :tag "Default package directory" nil) + (directory :tag "Custom package directory")) + :risky t + :package-version '(flycheck . "0.14")) + +(defun flycheck-option-emacs-lisp-package-user-dir (value) + "Option VALUE filter for `flycheck-emacs-lisp-package-user-dir'." + (unless value + ;; Inherit the package directory from our Emacs session + (setq value (and (boundp 'package-user-dir) package-user-dir))) + (when value + (flycheck-sexp-to-string `(setq package-user-dir ,value)))) + +(flycheck-define-checker emacs-lisp + "An Emacs Lisp syntax checker using the Emacs Lisp Byte compiler. + +See Info Node `(elisp)Byte Compilation'." + :command ("emacs" (eval flycheck-emacs-args) + (eval + (let ((path (pcase flycheck-emacs-lisp-load-path + (`inherit load-path) + (p (mapcar #'expand-file-name p))))) + (flycheck-prepend-with-option "--directory" path))) + (option "--eval" flycheck-emacs-lisp-package-user-dir nil + flycheck-option-emacs-lisp-package-user-dir) + (option "--eval" flycheck-emacs-lisp-initialize-packages nil + flycheck-option-emacs-lisp-package-initialize) + "--eval" (eval flycheck-emacs-lisp-check-form) + "--" + source-inplace) + :error-patterns + ((error line-start (file-name) ":" line ":" column ":Error:" + (message (zero-or-more not-newline) + (zero-or-more "\n " (zero-or-more not-newline))) + line-end) + (warning line-start (file-name) ":" line ":" column ":Warning:" + (message (zero-or-more not-newline) + (zero-or-more "\n " (zero-or-more not-newline))) + line-end)) + :error-filter + (lambda (errors) + (flycheck-collapse-error-message-whitespace + (flycheck-sanitize-errors errors))) + :modes (emacs-lisp-mode lisp-interaction-mode) + :predicate + (lambda () + (and + ;; Ensure that we only check buffers with a backing file. For buffers + ;; without a backing file we cannot guarantee that file names in error + ;; messages are properly resolved, because `byte-compile-file' emits file + ;; names *relative to the directory of the checked file* instead of the + ;; working directory. Hence our backwards-substitution will fail, because + ;; the checker process has a different base directory to resolve relative + ;; file names than the Flycheck code working on the buffer to check. + (buffer-file-name) + ;; Do not check buffers which should not be byte-compiled. The checker + ;; process will refuse to compile these, which would confuse Flycheck + (not (bound-and-true-p no-byte-compile)) + ;; Do not check buffers used for autoloads generation during package + ;; installation. These buffers are too short-lived for being checked, and + ;; doing so causes spurious errors. See + ;; https://github.com/flycheck/flycheck/issues/45 and + ;; https://github.com/bbatsov/prelude/issues/248. We must also not check + ;; compilation buffers, but as these are ephemeral, Flycheck won't check + ;; them anyway. + (not (flycheck-autoloads-file-p)))) + :next-checkers (emacs-lisp-checkdoc)) + +(defconst flycheck-emacs-lisp-checkdoc-form + (flycheck-prepare-emacs-lisp-form + (require 'checkdoc) + + (let ((source (car command-line-args-left)) + ;; Remember the default directory of the process + (process-default-directory default-directory)) + (with-temp-buffer + (insert-file-contents source 'visit) + (setq buffer-file-name source) + ;; And change back to the process default directory to make file-name + ;; back-substutition work + (setq default-directory process-default-directory) + (with-demoted-errors "Error in checkdoc: %S" + ;; If we have `checkdoc-file' (in Emacs 25) use it, otherwise fall + ;; back to printing the result buffer of checkdoc. + (if (fboundp 'checkdoc-file) + (checkdoc-file source) + (checkdoc-current-buffer t) + (with-current-buffer checkdoc-diagnostic-buffer + (princ (buffer-substring-no-properties (point-min) (point-max))) + (kill-buffer)))))))) + +(flycheck-define-checker emacs-lisp-checkdoc + "An Emacs Lisp style checker using CheckDoc. + +The checker runs `checkdoc-current-buffer'." + :command ("emacs" (eval flycheck-emacs-args) + "--eval" (eval flycheck-emacs-lisp-checkdoc-form) + "--" source) + :error-patterns + ((warning line-start (file-name) ":" line ": " (message) line-end)) + :modes (emacs-lisp-mode) + :predicate + (lambda () + ;; Do not check Autoloads, Cask/Carton and dir-locals files. These files + ;; really don't need to follow Checkdoc conventions. + (not (or (flycheck-autoloads-file-p) + (and (buffer-file-name) + (member (file-name-nondirectory (buffer-file-name)) + '("Cask" "Carton" ".dir-locals.el"))))))) + +(progn + ;; Use the currently running Emacs by default. + (setcar (get 'emacs-lisp 'flycheck-command) flycheck-this-emacs-executable) + (setcar (get 'emacs-lisp-checkdoc 'flycheck-command) + flycheck-this-emacs-executable)) + +(flycheck-def-option-var flycheck-erlang-include-path nil erlang + "A list of include directories for Erlang. + +The value of this variable is a list of strings, where each +string is a directory to add to the include path of erlc. +Relative paths are relative to the file being checked." + :type '(repeat (directory :tag "Include directory")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.24")) + +(flycheck-define-checker erlang + "An Erlang syntax checker using the Erlang interpreter. + +See URL `http://www.erlang.org/'." + :command ("erlc" + "-o" temporary-directory + (option-list "-I" flycheck-erlang-include-path) + "-Wall" + source) + :error-patterns + ((warning line-start (file-name) ":" line ": Warning:" (message) line-end) + (error line-start (file-name) ":" line ": " (message) line-end)) + :modes erlang-mode) + +(flycheck-define-checker eruby-erubis + "A eRuby syntax checker using the `erubis' command. + +See URL `http://www.kuwata-lab.com/erubis/'." + :command ("erubis" "-z" source) + :error-patterns + ((error line-start (file-name) ":" line ": " (message) line-end)) + :modes (html-erb-mode rhtml-mode)) + +(flycheck-def-args-var flycheck-gfortran-args fortran-gfortran + :package-version '(flycheck . "0.22")) + +(flycheck-def-option-var flycheck-gfortran-include-path nil fortran-gfortran + "A list of include directories for GCC Fortran. + +The value of this variable is a list of strings, where each +string is a directory to add to the include path of gcc. +Relative paths are relative to the file being checked." + :type '(repeat (directory :tag "Include directory")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.20")) + +(flycheck-def-option-var flycheck-gfortran-language-standard "f95" fortran-gfortran + "The language standard to use in GFortran. + +The value of this variable is either a string denoting a language +standard, or nil, to use the default standard. When non-nil, +pass the language standard via the `-std' option." + :type '(choice (const :tag "Default standard" nil) + (string :tag "Language standard")) + :safe #'stringp + :package-version '(flycheck . "0.20")) + +(flycheck-def-option-var flycheck-gfortran-layout nil fortran-gfortran + "The source code layout to use in GFortran. + +The value of this variable is one of the following symbols: + +nil + Let gfortran determine the layout from the extension + +`free' + Use free form layout + + +`fixed' + Use fixed form layout + +In any other case, an error is signaled.") + +(defun flycheck-option-gfortran-layout (value) + "Option VALUE filter for `flycheck-gfortran-layout'." + (pcase value + (`nil nil) + (`free "free-form") + (`fixed "fixed-form") + (_ (error "Invalid value for flycheck-gfortran-layout: %S" value)))) + +(flycheck-def-option-var flycheck-gfortran-warnings '("all" "extra") + fortran-gfortran + "A list of warnings for GCC Fortran. + +The value of this variable is a list of strings, where each string +is the name of a warning category to enable. By default, all +recommended warnings and some extra warnings are enabled (as by +`-Wall' and `-Wextra' respectively). + +Refer to the gfortran manual at URL +`https://gcc.gnu.org/onlinedocs/gfortran/' for more information +about warnings") + +(flycheck-define-checker fortran-gfortran + "An Fortran syntax checker using GCC. + +Uses GCC's Fortran compiler gfortran. See URL +`https://gcc.gnu.org/onlinedocs/gfortran/'." + :command ("gfortran" + "-fsyntax-only" + "-fshow-column" + "-fno-diagnostics-show-caret" ; Do not visually indicate the source location + "-fno-diagnostics-show-option" ; Do not show the corresponding + ; warning group + ;; Fortran has similar include processing as C/C++ + "-iquote" (eval (flycheck-c/c++-quoted-include-directory)) + (option "-std=" flycheck-gfortran-language-standard concat) + (option "-f" flycheck-gfortran-layout concat + flycheck-option-gfortran-layout) + (option-list "-W" flycheck-gfortran-warnings concat) + (option-list "-I" flycheck-gfortran-include-path concat) + (eval flycheck-gfortran-args) + source) + :error-patterns + ((error line-start (file-name) ":" line "." column ":\n" + (= 3 (zero-or-more not-newline) "\n") + (or "Error" "Fatal Error") ": " (message) line-end) + (warning line-start (file-name) ":" line "." column ":\n" + (= 3 (zero-or-more not-newline) "\n") + "Warning: " (message) line-end)) + :modes (fortran-mode f90-mode)) + +(flycheck-define-checker go-gofmt + "A Go syntax and style checker using the gofmt utility. + +See URL `http://golang.org/cmd/gofmt/'." + :command ("gofmt" source) + :error-patterns + ((error line-start (file-name) ":" line ":" column ": " (message) line-end)) + :modes go-mode + :next-checkers ((warning . go-golint) + ;; Fall back, if go-golint doesn't exist + (warning . go-vet) + ;; Fall back, if go-vet doesn't exist + (warning . go-build) (warning . go-test) + (warning . go-errcheck))) + +(flycheck-define-checker go-golint + "A Go style checker using Golint. + +See URL `https://github.com/golang/lint'." + :command ("golint" source) + :error-patterns + ((warning line-start (file-name) ":" line ":" column ": " (message) line-end)) + :modes go-mode + :next-checkers (go-vet + ;; Fall back, if go-vet doesn't exist + go-build go-test go-errcheck)) + +(flycheck-def-option-var flycheck-go-vet-print-functions nil go-vet + "A list of print-like functions for `go tool vet'. + +Go vet will check these functions for format string problems and +issues, such as a mismatch between the number of formats used, +and the number of arguments given. + +Each entry is in the form Name:N where N is the zero-based +argument position of the first argument involved in the print: +either the format or the first print argument for non-formatted +prints. For example, if you have Warn and Warnf functions that +take an io.Writer as their first argument, like Fprintf, +-printfuncs=Warn:1,Warnf:1 " + :type '(repeat :tag "print-like functions" + (string :tag "function")) + :safe #'flycheck-string-list-p) + +(flycheck-define-checker go-vet + "A Go syntax checker using the `go tool vet' command. + +See URL `http://golang.org/cmd/go/' and URL +`http://godoc.org/golang.org/x/tools/cmd/vet'." + :command ("go" "tool" "vet" + (option "-printfuncs=" flycheck-go-vet-print-functions concat + flycheck-option-comma-separated-list) + source) + :error-patterns + ((warning line-start (file-name) ":" line ": " (message) line-end)) + :modes go-mode + ;; We must explicitly check whether the "vet" tool is available + :predicate (lambda () + (let ((go (flycheck-checker-executable 'go-vet))) + (member "vet" (ignore-errors (process-lines go "tool"))))) + :next-checkers (go-build + go-test + ;; Fall back if `go build' or `go test' can be used + go-errcheck)) + +(flycheck-define-checker go-build + "A Go syntax and type checker using the `go build' command. + +See URL `http://golang.org/cmd/go'." + ;; We need to use `temporary-file-name' instead of `null-device', because Go + ;; can't write to the null device. It's “too magic”. See + ;; https://code.google.com/p/go/issues/detail?id=4851 for details. + :command ("go" "build" "-o" temporary-file-name) + :error-patterns + ((error line-start (file-name) ":" line ":" + (optional column ":") " " + (message (one-or-more not-newline) + (zero-or-more "\n\t" (one-or-more not-newline))) + line-end)) + :modes go-mode + :predicate (lambda () + (and (flycheck-buffer-saved-p) + (not (string-suffix-p "_test.go" (buffer-file-name))))) + :next-checkers ((warning . go-errcheck))) + +(flycheck-define-checker go-test + "A Go syntax and type checker using the `go test' command. + +See URL `http://golang.org/cmd/go'." + ;; This command builds the test executable and leaves it in the current + ;; directory. Unfortunately 'go test -c' does not have the '-o' option. + :command ("go" "test" "-c") + :error-patterns + ((error line-start (file-name) ":" line ": " + (message (one-or-more not-newline) + (zero-or-more "\n\t" (one-or-more not-newline))) + line-end)) + :modes go-mode + :predicate + (lambda () (and (flycheck-buffer-saved-p) + (string-suffix-p "_test.go" (buffer-file-name)))) + :next-checkers ((warning . go-errcheck))) + +(defun flycheck-go-package-name (&optional file-name gopath) + "Determine the package name for FILE-NAME and GOPATH. + +FILE-NAME defaults to `buffer-file-name'. GOPATH defaults to +$GOPATH. + +Return the package name for FILE-NAME, or nil if FILE-NAME is not +part of any package or if GOPATH is nil." + (-when-let* ((gopath (or gopath (getenv "GOPATH"))) + (file-name (or file-name (buffer-file-name)))) + (let ((gosrc (file-name-as-directory (expand-file-name "src/" gopath))) + (file-name (expand-file-name file-name))) + (when (string-prefix-p gosrc file-name) + ;; The file is part of a package, so determine the package name, as + ;; relative file name to the GO source directory + (directory-file-name ; Remove trailing / + (file-relative-name (file-name-directory file-name) gosrc)))))) + +(flycheck-define-checker go-errcheck + "A Go checker for unchecked errors. + +See URL `https://github.com/kisielk/errcheck'." + :command ("errcheck" (eval (flycheck-go-package-name))) + :error-patterns + ((warning line-start + (file-name) ":" line ":" column (one-or-more "\t") + (message) + line-end)) + :error-filter + (lambda (errors) + (let ((errors (flycheck-sanitize-errors errors)) + (gosrc (expand-file-name "src/" (getenv "GOPATH")))) + (dolist (err errors) + ;; File names are relative to the Go source directory, so we need to + ;; unexpand and re-expand them + (setf (flycheck-error-filename err) + (expand-file-name + ;; Get the relative name back, since Flycheck has already + ;; expanded the name for us + (file-relative-name (flycheck-error-filename err)) + ;; And expand it against the Go source directory + gosrc)) + (-when-let (message (flycheck-error-message err)) + ;; Improve the messages reported by errcheck to make them more clear. + (setf (flycheck-error-message err) + (format "Ignored `error` returned from `%s`" message))))) + errors) + :modes go-mode + :predicate + (lambda () + ;; We need a valid package name, since errcheck only works on entire + ;; packages, and can't check individual Go files. + (and (flycheck-buffer-saved-p) (flycheck-go-package-name)))) + +(flycheck-define-checker haml + "A Haml syntax checker using the Haml compiler. + +See URL `http://haml.info'." + :command ("haml" "-c" source) + :error-patterns + ((error line-start "Syntax error on line " line ": " (message) line-end)) + :modes haml-mode) + +(flycheck-define-checker handlebars + "A Handlebars syntax checker using the Handlebars compiler. + +See URL `http://handlebarsjs.com/'." + :command ("handlebars" source) + :error-patterns + ((error line-start + "Error: Parse error on line " line ":" (optional "\r") "\n" + (zero-or-more not-newline) "\n" (zero-or-more not-newline) "\n" + (message) line-end)) + :modes (handlebars-mode handlebars-sgml-mode web-mode) + :predicate + (lambda () + (if (eq major-mode 'web-mode) + ;; Check if this is a handlebars file since web-mode does not store the + ;; non-canonical engine name + (let* ((regexp-alist (bound-and-true-p web-mode-engine-file-regexps)) + (pattern (cdr (assoc "handlebars" regexp-alist)))) + (and pattern (buffer-file-name) + (string-match-p pattern (buffer-file-name)))) + t))) + +(defconst flycheck-haskell-module-re + (rx line-start (zero-or-more (or "\n" (any space))) + "module" (one-or-more (or "\n" (any space))) + (group (one-or-more (not (any space "\n"))))) + "Regular expression for a Haskell module name.") + +(flycheck-def-args-var flycheck-ghc-args haskell-ghc + :package-version '(flycheck . "0.22")) + +(flycheck-def-option-var flycheck-ghc-no-user-package-database nil haskell-ghc + "Whether to disable the user package database in GHC. + +When non-nil, disable the user package database in GHC, via +`-no-user-package-db'." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.16")) + +(flycheck-def-option-var flycheck-ghc-package-databases nil haskell-ghc + "Additional module databases for GHC. + +The value of this variable is a list of strings, where each +string is a directory of a package database. Each package +database is given to GHC via `-package-db'." + :type '(repeat (directory :tag "Package database")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.16")) + +(flycheck-def-option-var flycheck-ghc-search-path nil haskell-ghc + "Module search path for GHC. + +The value of this variable is a list of strings, where each +string is a directory containing Haskell modules. Each directory +is added to the GHC search path via `-i'." + :type '(repeat (directory :tag "Module directory")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.16")) + +(flycheck-def-option-var flycheck-ghc-language-extensions nil haskell-ghc + "Language extensions for GHC. + +The value of this variable is a list of strings, where each +string is a Haskell language extension, as in the LANGUAGE +pragma. Each extension is enabled via `-X'." + :type '(repeat (string :tag "Language extension")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.19")) + +(flycheck-define-checker haskell-ghc + "A Haskell syntax and type checker using ghc. + +See URL `http://www.haskell.org/ghc/'." + :command ("ghc" "-Wall" "-fno-code" + (option-flag "-no-user-package-db" + flycheck-ghc-no-user-package-database) + (option-list "-package-db" flycheck-ghc-package-databases) + (option-list "-i" flycheck-ghc-search-path concat) + ;; Include the parent directory of the current module tree, to + ;; properly resolve local imports + (eval (concat + "-i" + (flycheck-module-root-directory + (flycheck-find-in-buffer flycheck-haskell-module-re)))) + (option-list "-X" flycheck-ghc-language-extensions concat) + (eval flycheck-ghc-args) + "-x" (eval + (pcase major-mode + (`haskell-mode "hs") + (`literate-haskell-mode "lhs"))) + source) + :error-patterns + ((warning line-start (file-name) ":" line ":" column ":" + (or " " "\n ") "Warning:" (optional "\n") + (message + (one-or-more " ") (one-or-more not-newline) + (zero-or-more "\n" + (one-or-more " ") + (one-or-more not-newline))) + line-end) + (error line-start (file-name) ":" line ":" column ":" + (or (message (one-or-more not-newline)) + (and "\n" + (message + (one-or-more " ") (one-or-more not-newline) + (zero-or-more "\n" + (one-or-more " ") + (one-or-more not-newline))))) + line-end)) + :error-filter + (lambda (errors) + (flycheck-sanitize-errors (flycheck-dedent-error-messages errors))) + :modes (haskell-mode literate-haskell-mode) + :next-checkers ((warning . haskell-hlint))) + +(flycheck-define-checker haskell-hlint + "A Haskell style checker using hlint. + +See URL `https://github.com/ndmitchell/hlint'." + :command ("hlint" source-inplace) + :error-patterns + ((warning line-start + (file-name) ":" line ":" column + ": Warning: " + (message (one-or-more not-newline) + (one-or-more "\n" (one-or-more not-newline))) + line-end) + (error line-start + (file-name) ":" line ":" column + ": Error: " + (message (one-or-more not-newline) + (one-or-more "\n" (one-or-more not-newline))) + line-end)) + :modes (haskell-mode literate-haskell-mode)) + +(flycheck-def-config-file-var flycheck-tidyrc html-tidy ".tidyrc" + :safe #'stringp) + +(flycheck-define-checker html-tidy + "A HTML syntax and style checker using Tidy. + +See URL `https://github.com/w3c/tidy-html5'." + :command ("tidy" (config-file "-config" flycheck-tidyrc) "-e" "-q" source) + :error-patterns + ((error line-start + "line " line + " column " column + " - Error: " (message) line-end) + (warning line-start + "line " line + " column " column + " - Warning: " (message) line-end)) + :modes (html-mode nxhtml-mode)) + +(flycheck-def-config-file-var flycheck-jshintrc javascript-jshint ".jshintrc" + :safe #'stringp) + +(flycheck-define-checker javascript-jshint + "A Javascript syntax and style checker using jshint. + +See URL `http://www.jshint.com'." + :command ("jshint" "--checkstyle-reporter" + (config-file "--config" flycheck-jshintrc) + source) + :error-parser flycheck-parse-checkstyle + :error-filter flycheck-dequalify-error-ids + :modes (js-mode js2-mode js3-mode) + :next-checkers ((warning . javascript-jscs))) + +(flycheck-def-option-var flycheck-eslint-rulesdir nil javascript-eslint + "The directory of custom rules for ESLint. + +The value of this variable is either a string containing the path +to a directory with custom rules, or nil, to not give any custom +rules to ESLint. + +Refer to the ESLint manual at URL +`https://github.com/eslint/eslint/tree/master/docs/command-line-interface#--rulesdir' +for more information about the custom directory." + :type '(choice (const :tag "No custom rules directory" nil) + (directory :tag "Custom rules directory")) + :safe #'stringp + :package-version '(flycheck . "0.16")) + +(flycheck-def-config-file-var flycheck-eslintrc javascript-eslint nil + :safe #'stringp + :package-version '(flycheck . "0.20")) + +(flycheck-define-checker javascript-eslint + "A Javascript syntax and style checker using eslint. + +See URL `https://github.com/eslint/eslint'." + :command ("eslint" "--format=checkstyle" + (config-file "--config" flycheck-eslintrc) + (option "--rulesdir" flycheck-eslint-rulesdir) + ;; We need to use source-inplace because eslint looks for + ;; configuration files in the directory of the file being checked. + ;; See https://github.com/flycheck/flycheck/issues/447 + source-inplace) + :error-parser flycheck-parse-checkstyle + :error-filter (lambda (errors) + (mapc (lambda (err) + ;; Parse error ID from the error message + (setf (flycheck-error-message err) + (replace-regexp-in-string + (rx " (" + (group (one-or-more (not (any ")")))) + ")" string-end) + (lambda (s) + (setf (flycheck-error-id err) + (match-string 1 s)) + "") + (flycheck-error-message err)))) + (flycheck-sanitize-errors (flycheck-increment-error-columns errors))) + errors) + :modes (js-mode js2-mode js3-mode) + :next-checkers ((warning . javascript-jscs))) + +(flycheck-def-config-file-var flycheck-gjslintrc javascript-gjslint ".gjslintrc" + :safe #'stringp) + +(flycheck-define-checker javascript-gjslint + "A Javascript syntax and style checker using Closure Linter. + +See URL `https://developers.google.com/closure/utilities'." + :command ("gjslint" "--unix_mode" + (config-file "--flagfile" flycheck-gjslintrc) + source) + :error-patterns ((warning + line-start (file-name) ":" line ":(" + (id (one-or-more digit)) ") " (message) line-end)) + :modes (js-mode js2-mode js3-mode) + :next-checkers ((warning . javascript-jscs))) + +(defun flycheck-parse-jscs (output checker buffer) + "Parse JSCS OUTPUT from CHECKER and BUFFER. + +Like `flycheck-parse-checkstyle', but catches errors about no +configuration found and prevents to be reported as a suspicious +error." + (if (string-match-p (rx string-start "No configuration found") output) + (let ((message "No JSCS configuration found. Set `flycheck-jscsrc' for JSCS")) + (list (flycheck-error-new-at 1 nil 'warning message + :checker checker + :buffer buffer + :filename (buffer-file-name buffer)))) + (flycheck-parse-checkstyle output checker buffer))) + +(flycheck-def-config-file-var flycheck-jscsrc javascript-jscs ".jscsrc" + :safe #'stringp + :package-version '(flycheck . "0.24")) + +(flycheck-define-checker javascript-jscs + "A Javascript style checker using JSCS. + +See URL `http://www.jscs.info'." + :command ("jscs" "--reporter=checkstyle" + (config-file "--config" flycheck-jscsrc) + source) + :error-parser flycheck-parse-jscs + :error-filter (lambda (errors) + (flycheck-remove-error-ids + (flycheck-sanitize-errors errors))) + :modes (js-mode js2-mode js3-mode)) + +(flycheck-define-checker javascript-standard + "A Javascript code and style checker for the (Semi-)Standard Style. + +This checker works with `standard' and `semistandard', defaulting +to the former. To use it with the latter, set +`flycheck-javascript-standard-executable' to `semistandard'. + +See URL `https://github.com/feross/standard' and URL +`https://github.com/Flet/semistandard'." + :command ("standard" source) + :error-patterns + ((error line-start + " " (file-name) ":" line ":" column ":" (message) + line-end)) + :modes (js-mode js2-mode js3-mode)) + +(flycheck-define-checker json-jsonlint + "A JSON syntax and style checker using jsonlint. + +See URL `https://github.com/zaach/jsonlint'." + :command ("jsonlint" "-c" "-q" source) + :error-patterns + ((error line-start + (file-name) + ": line " line + ", col " column ", " + (message) line-end)) + :predicate + (lambda () + (or + (eq major-mode 'json-mode) + (and (buffer-file-name) + (string= (file-name-extension (buffer-file-name)) "json"))))) + +(flycheck-define-checker less + "A LESS syntax checker using lessc. + +At least version 1.4 of lessc is required. + +See URL `http://lesscss.org'." + :command ("lessc" "--lint" "--no-color" + ;; We need `source-inplace' to resolve relative `data-uri' paths, + ;; see https://github.com/flycheck/flycheck/issues/471 + source-inplace) + :error-patterns + ((error line-start (one-or-more word) ":" + (message) + " in " + (file-name) + + " on line " line + ", column " column ":" + line-end)) + :modes less-css-mode) + +(flycheck-def-config-file-var flycheck-luacheckrc luacheck ".luacheckrc" + :safe #'stringp + :package-version '(flycheck . "0.23")) + +(flycheck-define-checker luacheck + "A Lua syntax checker using luacheck. + +See URL `https://github.com/mpeterv/luacheck'." + :command ("luacheck" + (config-file "--config" flycheck-luacheckrc) + "--formatter" "plain" + "--codes" ; Show warning codes + "--no-color" + source) + :error-patterns + ((warning line-start (file-name) + ":" line ":" column ": (" (id (and "W" (one-or-more digit))) + ") " (message) line-end) + (error line-start (file-name) + ":" line ":" column ":" (message) line-end)) + :modes lua-mode) + +(flycheck-define-checker lua + "A Lua syntax checker using the Lua compiler. + +See URL `http://www.lua.org/'." + :command ("luac" "-p" source) + :error-patterns + ((error line-start + ;; Skip the name of the luac executable. We also skip the file name, + ;; because luac is stupid enough as to abbreviate file names in its + ;; output, which for obvious reasons breaks our file name + ;; detection. See https://github.com/flycheck/flycheck/issues/251 + (minimal-match (zero-or-more not-newline)) + ":" line ": " (message) line-end)) + :modes lua-mode) + +(flycheck-def-option-var flycheck-perl-include-path nil perl + "A list of include directories for Perl. + +The value of this variable is a list of strings, where each +string is a directory to add to the include path of Perl. +Relative paths are relative to the file being checked." + :type '(repeat (directory :tag "Include directory")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.24")) + +(flycheck-define-checker perl + "A Perl syntax checker using the Perl interpreter. + +See URL `http://www.perl.org'." + :command ("perl" "-w" "-c" + (option-list "-I" flycheck-perl-include-path) + source) + :error-patterns + ((error line-start (minimal-match (message)) + " at " (file-name) " line " line + (or "." (and ", " (zero-or-more not-newline))) line-end)) + :modes (perl-mode cperl-mode) + :next-checkers (perl-perlcritic)) + +(flycheck-def-option-var flycheck-perlcritic-severity nil perl-perlcritic + "The message severity for Perl Critic. + +The value of this variable is a severity level as integer, for +the `--severity' option to Perl Critic." + :type '(integer :tag "Severity level") + :safe #'integerp + :package-version '(flycheck . "0.18")) + +(define-obsolete-variable-alias 'flycheck-perlcritic-verbosity + 'flycheck-perlcritic-severity "0.22") + +(flycheck-define-checker perl-perlcritic + "A Perl syntax checker using Perl::Critic. + +See URL `https://metacpan.org/pod/Perl::Critic'." + :command ("perlcritic" "--no-color" "--verbose" "%f/%l/%c/%s/%p/%m (%e)\n" + (option "--severity" flycheck-perlcritic-severity nil + flycheck-option-int) + source) + :error-patterns + ((info line-start + (file-name) "/" line "/" column "/" (any "1") "/" + (id (one-or-more (not (any "/")))) "/" (message) + line-end) + (warning line-start + (file-name) "/" line "/" column "/" (any "234") "/" + (id (one-or-more (not (any "/")))) "/" (message) + line-end) + (error line-start + (file-name) "/" line "/" column "/" (any "5") "/" + (id (one-or-more (not (any "/")))) "/" (message) + line-end)) + :modes (cperl-mode perl-mode)) + +(flycheck-define-checker php + "A PHP syntax checker using the PHP command line interpreter. + +See URL `http://php.net/manual/en/features.commandline.php'." + :command ("php" "-l" "-d" "error_reporting=E_ALL" "-d" "display_errors=1" + "-d" "log_errors=0" source) + :error-patterns + ((error line-start (or "Parse" "Fatal" "syntax") " error" (any ":" ",") " " + (message) " in " (file-name) " on line " line line-end)) + :modes (php-mode php+-mode) + :next-checkers ((warning . php-phpmd) + (warning . php-phpcs))) + +(flycheck-def-option-var flycheck-phpmd-rulesets + '("cleancode" "codesize" "controversial" "design" "naming" "unusedcode") + php-phpmd + "The rule sets for PHP Mess Detector. + +Set default rule sets and custom rule set files. + +See section \"Using multiple rule sets\" in the PHP Mess Detector +manual at URL `http://phpmd.org/documentation/index.html'." + :type '(repeat :tag "rule sets" + (string :tag "A filename or rule set")) + :safe #'flycheck-string-list-p) + +(flycheck-define-checker php-phpmd + "A PHP style checker using PHP Mess Detector. + +See URL `http://phpmd.org/'." + :command ("phpmd" source "xml" + (eval (flycheck-option-comma-separated-list + flycheck-phpmd-rulesets))) + :error-parser flycheck-parse-phpmd + :modes (php-mode php+-mode) + :next-checkers (php-phpcs)) + +(flycheck-def-option-var flycheck-phpcs-standard nil php-phpcs + "The coding standard for PHP CodeSniffer. + +When nil, use the default standard from the global PHP +CodeSniffer configuration. When set to a string, pass the string +to PHP CodeSniffer which will interpret it as name as a standard, +or as path to a standard specification." + :type '(choice (const :tag "Default standard" nil) + (string :tag "Standard name or file")) + :safe #'stringp) + +(flycheck-define-checker php-phpcs + "A PHP style checker using PHP_CodeSniffer. + +See URL `http://pear.php.net/package/PHP_CodeSniffer/'." + :command ("phpcs" "--report=checkstyle" + (option "--standard=" flycheck-phpcs-standard concat) + source) + :error-parser flycheck-parse-checkstyle + :modes (php-mode php+-mode)) + +(flycheck-define-checker puppet-parser + "A Puppet DSL syntax checker using puppet's own parser. + +See URL `http://puppetlabs.com/'." + :command ("puppet" "parser" "validate" "--color=false" source) + :error-patterns + ( + ;; Patterns for Puppet 4 + (error line-start "Error: Could not parse for environment " + (one-or-more word) ":" + (message) " at " (file-name) ":" line ":" column line-end) + (error line-start "Error: Could not parse for environment " + (one-or-more word) ":" + (message) " in file " (file-name) " at line " line ":" column + line-end) + ;; Errors from Puppet < 4 + (error line-start + ;; Skip over the path of the Puppet executable + (minimal-match (zero-or-more not-newline)) + ": Could not parse for environment " (one-or-more word) + ": " (message (minimal-match (zero-or-more anything))) + " at " (file-name "/" (zero-or-more not-newline)) ":" line line-end)) + :modes puppet-mode + :next-checkers ((warning . puppet-lint))) + +(flycheck-define-checker puppet-lint + "A Puppet DSL style checker using puppet-lint. + +See URL `http://puppet-lint.com/'." + ;; We must check the original file, because Puppetlint is quite picky on the + ;; names of files and there place in the directory structure, to comply with + ;; Puppet's autoload directory layout. For instance, a class foo::bar is + ;; required to be in a file foo/bar.pp. Any other place, such as a Flycheck + ;; temporary file will cause an error. + :command ("puppet-lint" + "--log-format" "%{path}:%{linenumber}:%{kind}: %{message} (%{check})" + source-original) + :error-patterns + ((warning line-start (file-name) ":" line ":warning: " (message) line-end) + (error line-start (file-name) ":" line ":error: " (message) line-end)) + :modes puppet-mode + ;; Since we check the original file, we can only use this syntax checker if + ;; the buffer is actually linked to a file, and if it is not modified. + :predicate flycheck-buffer-saved-p) + +(flycheck-def-config-file-var flycheck-flake8rc python-flake8 ".flake8rc" + :safe #'stringp) + +(flycheck-def-option-var flycheck-flake8-error-level-alist + '(("^E9.*$" . error) ; Syntax errors from pep8 + ("^F82.*$" . error) ; undefined variables from pyflakes + ("^F83.*$" . error) ; Duplicate arguments from flake8 + ("^N.*$" . info) ; Naming issues from naming + ) + python-flake8 + "An alist mapping flake8 error IDs to Flycheck error levels. + +Each item in this list is a cons cell `(PATTERN . LEVEL)' where +PATTERN is a regular expression matched against the error ID, and +LEVEL is a Flycheck error level symbol. + +Each PATTERN is matched in the order of appearance in this list +against the error ID. If it matches the ID, the level of the +corresponding error is set to LEVEL. An error that is not +matched by any PATTERN defaults to warning level. + +This option exists because flake8 categorises errors by the +underlying tool that produced them (e.g. F for pyflakes messages, +E for pep8 messages, etc.). These categorisations do not map +directly to Flycheck error levels. Hence, this option exists to +allow for a custom mapping. The default value handles all of the +built-in tools of flake8, and naming errors from pep8-naming." + :type '(repeat (cons (regexp :tag "Error ID pattern") + (symbol :tag "Error level"))) + :package-version '(flycheck . "0.22")) + +(flycheck-def-option-var flycheck-flake8-maximum-complexity nil python-flake8 + "The maximum McCabe complexity of methods. + +If nil, do not check the complexity of methods. If set to an +integer, report any complexity greater than the value of this +variable as warning. + +If set to an integer, this variable overrules any similar setting +in the configuration file denoted by `flycheck-flake8rc'." + :type '(choice (const :tag "Do not check McCabe complexity" nil) + (integer :tag "Maximum complexity")) + :safe #'integerp) + +(flycheck-def-option-var flycheck-flake8-maximum-line-length nil python-flake8 + "The maximum length of lines. + +If set to an integer, the value of this variable denotes the +maximum length of lines, overruling any similar setting in the +configuration file denoted by `flycheck-flake8rc'. An error will +be reported for any line longer than the value of this variable. + +If set to nil, use the maximum line length from the configuration +file denoted by `flycheck-flake8rc', or the PEP 8 recommendation +of 79 characters if there is no configuration with this setting." + :type '(choice (const :tag "Default value") + (integer :tag "Maximum line length in characters")) + :safe #'integerp) + +(defun flycheck-flake8-fix-error-level (err) + "Fix the error level of ERR. + +Update the error level of ERR according to +`flycheck-flake8-error-level-alist'." + (pcase-dolist (`(,pattern . ,level) flycheck-flake8-error-level-alist) + (when (string-match-p pattern (flycheck-error-id err)) + (setf (flycheck-error-level err) level))) + err) + +(flycheck-define-checker python-flake8 + "A Python syntax and style checker using Flake8. + +Requires Flake8 2.0 or newer. See URL +`https://pypi.python.org/pypi/flake8'." + :command ("flake8" + (config-file "--config" flycheck-flake8rc) + (option "--max-complexity" flycheck-flake8-maximum-complexity nil + flycheck-option-int) + (option "--max-line-length" flycheck-flake8-maximum-line-length nil + flycheck-option-int) + source) + :error-filter (lambda (errors) + (let ((errors (flycheck-sanitize-errors errors))) + (mapc #'flycheck-flake8-fix-error-level errors) + errors)) + :error-patterns + ((warning line-start + (file-name) ":" line ":" (optional column ":") " " + (id (one-or-more (any alpha)) (one-or-more digit)) " " + (message (one-or-more not-newline)) + line-end)) + :modes python-mode) + +(flycheck-def-config-file-var flycheck-pylintrc python-pylint + ".pylintrc" + :safe #'stringp) + +(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_id}:{msg}" + (config-file "--rcfile" flycheck-pylintrc) + ;; Need `source-inplace' for relative imports (e.g. `from .foo + ;; import bar'), see https://github.com/flycheck/flycheck/issues/280 + source-inplace) + :error-filter + (lambda (errors) + (flycheck-sanitize-errors (flycheck-increment-error-columns errors))) + :error-patterns + ((error line-start (file-name) ":" line ":" column ":" + (or "E" "F") ":" + (id (one-or-more (not (any ":")))) ":" + (message) line-end) + (warning line-start (file-name) ":" line ":" column ":" + (or "W" "R") ":" + (id (one-or-more (not (any ":")))) ":" + (message) line-end) + (info line-start (file-name) ":" line ":" column ":" + "C:" (id (one-or-more (not (any ":")))) ":" + (message) line-end)) + :modes python-mode) + +(flycheck-define-checker python-pycompile + "A Python syntax checker using Python's builtin compiler. + +See URL `https://docs.python.org/3.4/library/py_compile.html'." + :command ("python" "-m" "py_compile" source) + :error-patterns + ;; Python 2.7 + ((error line-start " File \"" (file-name) "\", line " line "\n" + (= 2 (zero-or-more not-newline) "\n") + "SyntaxError: " (message) line-end) + (error line-start "Sorry: IndentationError: " + (message) "(" (file-name) ", line " line ")" + line-end) + ;; 2.6 + (error line-start "SyntaxError: ('" (message (one-or-more (not (any "'")))) + "', ('" (file-name (one-or-more (not (any "'")))) "', " + line ", " column ", " (one-or-more not-newline) line-end)) + :modes python-mode) + +(flycheck-def-option-var flycheck-lintr-caching t r-lintr + "Whether to enable caching in lintr. + +By default, lintr caches all expressions in a file and re-checks +only those that have changed. Setting this option to nil +disables caching in case there are problems." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.23")) + +(flycheck-def-option-var flycheck-lintr-linters "default_linters" r-lintr + "Linters to use with lintr. + +The value of this variable is a string containing an R +expression, which selects linters for lintr." + :type 'string + :risky t + :package-version '(flycheck . "0.23")) + +(flycheck-define-checker r-lintr + "An R style and syntax checker using the lintr package. + +See URL `https://github.com/jimhester/lintr'." + :command ("R" "--slave" "--restore" "--no-save" "-e" + (eval (concat + "library(lintr);" + "try(lint(commandArgs(TRUE)" + ", cache=" (if flycheck-lintr-caching "TRUE" "FALSE") + ", " flycheck-lintr-linters + "))")) + "--args" source) + :error-patterns + ((info line-start (file-name) ":" line ":" column ": style: " (message) + line-end) + (warning line-start (file-name) ":" line ":" column ": warning: " (message) + line-end) + (error line-start (file-name) ":" line ":" column ": error: " (message) + line-end)) + :modes ess-mode) + +(flycheck-define-checker racket + "A Racket syntax checker using the Racket compiler. + +See URL `http://racket-lang.org/'." + :command ("racket" "-f" source-inplace) + :error-patterns + ((error line-start (file-name) ":" line ":" column ":" (message) line-end)) + :modes racket-mode) + +(flycheck-define-checker rpm-rpmlint + "A RPM SPEC file syntax checker using rpmlint. + +See URL `http://sourceforge.net/projects/rpmlint/'." + :command ("rpmlint" source) + :error-patterns + ((error line-start + (file-name) ":" (optional line ":") " E: " (message) + line-end) + (warning line-start + (file-name) ":" (optional line ":") " W: " (message) + line-end)) + :error-filter + ;; Add fake line numbers if they are missing in the lint output + (lambda (errors) + (dolist (err errors) + (unless (flycheck-error-line err) + (setf (flycheck-error-line err) 1))) + errors) + :modes (sh-mode rpm-spec-mode) + :predicate (lambda () (or (not (eq major-mode 'sh-mode)) + ;; In `sh-mode', we need the proper shell + (eq sh-shell 'rpm)))) + +(defun flycheck-locate-sphinx-source-directory () + "Locate the Sphinx source directory for the current buffer. + +Return the source directory, or nil, if the current buffer is not +part of a Sphinx project." + (-when-let* ((filename (buffer-file-name)) + (dir (locate-dominating-file filename "conf.py"))) + (expand-file-name dir))) + +(flycheck-define-checker rst + "A ReStructuredText (RST) syntax checker using Docutils. + +See URL `http://docutils.sourceforge.net/'." + ;; We need to use source-inplace to properly resolve relative paths in + ;; include:: directives + :command ("rst2pseudoxml.py" "--report=2" "--halt=5" source-inplace) + :error-patterns + ((warning line-start (file-name) ":" line ": (WARNING/2) " (message) line-end) + (error line-start + (file-name) ":" line + ": (" (or "ERROR/3" "SEVERE/4") ") " + (message) line-end)) + :modes rst-mode + ;; Don't use the generic ReST checker in Sphinx projects, because it'll + ;; produce a lot of false positives. + :predicate (lambda () (not (flycheck-locate-sphinx-source-directory)))) + +(flycheck-def-option-var flycheck-sphinx-warn-on-missing-references t rst-sphinx + "Whether to warn about missing references in Sphinx. + +When non-nil (the default), warn about all missing references in +Sphinx via `-n'." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.17")) + +(flycheck-define-checker rst-sphinx + "A ReStructuredText (RST) syntax checker using Sphinx. + +Requires Sphinx 1.2 or newer. See URL `http://sphinx-doc.org'." + :command ("sphinx-build" "-b" "pseudoxml" + "-q" "-N" ; Reduced output and no colors + (option-flag "-n" flycheck-sphinx-warn-on-missing-references) + (eval (flycheck-locate-sphinx-source-directory)) + temporary-directory ; Redirect the output to a temporary + ; directory + source-original) ; Sphinx needs the original document + :error-patterns + ((warning line-start (file-name) ":" line ": WARNING: " (message) line-end) + (error line-start + (file-name) ":" line + ": " (or "ERROR" "SEVERE") ": " + (message) line-end)) + :modes rst-mode + :predicate (lambda () (and (flycheck-buffer-saved-p) + (flycheck-locate-sphinx-source-directory)))) + +(flycheck-def-config-file-var flycheck-rubocoprc ruby-rubocop ".rubocop.yml" + :safe #'stringp) + +(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 + :package-version '(flycheck . "0.16")) + +(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) + source) + :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))) + +;; Default to `nil' to let Rubylint find its configuration file by itself, and +;; to maintain backwards compatibility with older Rubylint and Flycheck releases +(flycheck-def-config-file-var flycheck-rubylintrc ruby-rubylint nil + :safe #'stringp) + +(flycheck-define-checker ruby-rubylint + "A Ruby syntax and code analysis checker using ruby-lint. + +Requires ruby-lint 2.0 or newer. To use `flycheck-rubylintrc', +ruby-lint 2.0.2 or newer is required. See URL +`https://github.com/YorickPeterse/ruby-lint'." + :command ("ruby-lint" "--presenter=syntastic" + (config-file "--config" flycheck-rubylintrc) + source) + :error-patterns + ((info line-start + (file-name) ":I:" line ":" column ": " (message) line-end) + (warning line-start + (file-name) ":W:" line ":" column ": " (message) line-end) + (error line-start + (file-name) ":E:" line ":" column ": " (message) line-end)) + :modes (enh-ruby-mode ruby-mode)) + +(flycheck-define-checker ruby + "A Ruby syntax checker using the standard Ruby interpreter. + +Please note that the output of different Ruby versions and +implementations varies wildly. This syntax checker supports +current versions of MRI and JRuby, but may break when used with +other implementations or future versions of these +implementations. + +Please consider using `ruby-rubocop' or `ruby-rubylint' instead. + +See URL `https://www.ruby-lang.org/'." + :command ("ruby" "-w" "-c" source) + :error-patterns + ;; These patterns support output from JRuby, too, to deal with RVM or Rbenv + ((error line-start + "SyntaxError in " (file-name) ":" line ": " (message) + line-end) + (warning line-start + (file-name) ":" line ":" (optional column ":") + " warning: " (message) line-end) + (error line-start (file-name) ":" line ": " (message) line-end)) + :modes (enh-ruby-mode ruby-mode) + :next-checkers ((warning . ruby-rubylint))) + +(flycheck-define-checker ruby-jruby + "A Ruby syntax checker using the JRuby interpreter. + +This syntax checker is very primitive, and may break on future +versions of JRuby. + +Please consider using `ruby-rubocop' or `ruby-rubylint' instead. + +See URL `http://jruby.org/'." + :command ("jruby" "-w" "-c" source) + :error-patterns + ((error line-start + "SyntaxError in " (file-name) ":" line ": " (message) + line-end) + (warning line-start (file-name) ":" line " warning: " (message) line-end) + (error line-start (file-name) ":" line ": " (message) line-end)) + :modes (enh-ruby-mode ruby-mode) + :next-checkers ((warning . ruby-rubylint))) + +(flycheck-def-args-var flycheck-rust-args rust + :package-version '(flycheck . "0.24")) + +(flycheck-def-option-var flycheck-rust-check-tests t rust + "Whether to check test code in Rust. + +When non-nil, `rustc' is passed the `--test' flag, which will +check any code marked with the `#[cfg(test)]' attribute and any +functions marked with `#[test]'. Otherwise, `rustc' is not passed +`--test' and test code will not be checked. Skipping `--test' is +necessary when using `#![no_std]', because compiling the test +runner requires `std'." + :type 'boolean + :safe #'booleanp + :package-version '("flycheck" . "0.19")) + +(flycheck-def-option-var flycheck-rust-crate-root nil rust + "A path to the crate root for the current buffer. + +The value of this variable is either a string with the path to +the crate root for the current buffer, or nil if the current buffer +is a crate. A relative path is relative to the current buffer. + +If this variable is non nil the current buffer will only be checked +if it is not modified, i.e. after it has been saved." + :type 'string + :package-version '(flycheck . "0.20") + :safe #'stringp) +(make-variable-buffer-local 'flycheck-rust-crate-root) + +(flycheck-def-option-var flycheck-rust-crate-type "lib" rust + "The type of the Rust Crate to check. + +The value of this variable is a string denoting the crate type, +for the `--crate-type' flag." + :type 'string + :safe #'stringp + :package-version '("flycheck" . "0.20")) +(make-variable-buffer-local 'flycheck-rust-crate-type) + +(flycheck-def-option-var flycheck-rust-library-path nil rust + "A list of library directories for Rust. + +The value of this variable is a list of strings, where each +string is a directory to add to the library path of Rust. +Relative paths are relative to the file being checked." + :type '(repeat (directory :tag "Library directory")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.18")) + +(flycheck-define-checker rust + "A Rust syntax checker using Rust compiler. + +This syntax checker needs Rust 1.0.0 alpha or newer. + +See URL `http://www.rust-lang.org'." + :command ("rustc" "-Z" "no-trans" + (option "--crate-type" flycheck-rust-crate-type) + (option-flag "--test" flycheck-rust-check-tests) + (option-list "-L" flycheck-rust-library-path concat) + (eval flycheck-rust-args) + (eval (or flycheck-rust-crate-root + (flycheck-substitute-argument 'source-inplace 'rust)))) + :error-patterns + ((error line-start (file-name) ":" line ":" column ": " + (one-or-more digit) ":" (one-or-more digit) " error: " + (or + ;; Multiline errors + (and (message (minimal-match (one-or-more anything))) + " [" (id "E" (one-or-more digit)) "]") + (message)) + line-end) + (warning line-start (file-name) ":" line ":" column ": " + (one-or-more digit) ":" (one-or-more digit) " warning: " + (message) line-end) + (info line-start (file-name) ":" line ":" column ": " + (one-or-more digit) ":" (one-or-more digit) " " (or "note" "help") ": " + (message) line-end)) + :modes rust-mode + :predicate (lambda () + (or (not flycheck-rust-crate-root) (flycheck-buffer-saved-p)))) + +(defvar flycheck-sass-scss-cache-directory nil + "The cache directory for `sass' and `scss'.") + +(defun flycheck-sass-scss-cache-location () + "Get the cache location for `sass' and `scss'. + +If no cache directory exists yet, create one and return it. +Otherwise return the previously used cache directory." + (setq flycheck-sass-scss-cache-directory + (or flycheck-sass-scss-cache-directory + (make-temp-file "flycheck-sass-scss-cache" 'directory)))) + +(flycheck-def-option-var flycheck-sass-compass nil sass + "Whether to enable the Compass CSS framework. + +When non-nil, enable the Compass CSS framework, via `--compass'." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.16")) + +(flycheck-define-checker sass + "A Sass syntax checker using the Sass compiler. + +See URL `http://sass-lang.com'." + :command ("sass" + "--cache-location" (eval (flycheck-sass-scss-cache-location)) + (option-flag "--compass" flycheck-sass-compass) + "-c" source) + :error-patterns + ((error line-start "Syntax error on line " line ": " (message)) + (warning line-start "WARNING on line " line " of " (file-name) + ":" (optional "\r") "\n" (message) line-end) + (error line-start + (or "Syntax error: " "Error: ") + (message (one-or-more not-newline) + (zero-or-more "\n" + (one-or-more " ") + (one-or-more not-newline))) + (optional "\r") "\n on line " line " of " (file-name) + line-end)) + :modes sass-mode) + +(flycheck-define-checker scala + "A Scala syntax checker using the Scala compiler. + +See URL `http://www.scala-lang.org/'." + :command ("scalac" "-Ystop-after:parser" source) + :error-patterns + ((error line-start (file-name) ":" line ": error: " (message) line-end)) + :modes scala-mode + :next-checkers ((warning . scala-scalastyle))) + +(flycheck-def-config-file-var flycheck-scalastylerc scala-scalastyle nil + :safe #'stringp + :package-version '(flycheck . "0.20")) + +(flycheck-def-option-var flycheck-scalastyle-jar nil scala-scalastyle + "The path to the main JAR file of Scalastyle. + +If this option is nil, or points to a non-existing file, +`scala-scalastyle' can not be used." + :type '(file :must-match t) + :safe #'stringp + :package-version '(flycheck . "0.20")) + +(flycheck-define-checker scala-scalastyle + "A Scala style checker using scalastyle. + +Note that this syntax checker is not used if +`flycheck-scalastyle-jar' or `flycheck-scalastylerc' are nil or +point to non-existing files. + +See URL `http://www.scalastyle.org'." + :command ("java" + (option "-jar" flycheck-scalastyle-jar) + (config-file "-c" flycheck-scalastylerc) + source) + :error-patterns + ((error line-start "error file=" (file-name) " message=" + (message) " line=" line (optional " column=" column) line-end) + (warning line-start "warning file=" (file-name) " message=" + (message) " line=" line (optional " column=" column) line-end)) + :modes scala-mode + :predicate + ;; Inhibit this syntax checker if the JAR or the configuration are unset or + ;; missing + (lambda () (and flycheck-scalastyle-jar flycheck-scalastylerc + (file-exists-p flycheck-scalastyle-jar) + (file-exists-p (flycheck-locate-config-file + flycheck-scalastylerc 'scala-scalastyle))))) + +(defconst flycheck-scss-lint-checkstyle-re + (rx "cannot load such file" (1+ not-newline) "scss_lint_reporter_checkstyle") + "Regular expression to parse missing checkstyle error.") + +(defun flycheck-parse-scss-lint (output checker buffer) + "Parse SCSS-Lint OUTPUT from CHECKER and BUFFER. + +Like `flycheck-parse-checkstyle', but catches errors about +missing checkstyle reporter from SCSS-Lint." + (if (string-match-p flycheck-scss-lint-checkstyle-re output) + (list (flycheck-error-new-at + 1 nil 'error "Checkstyle reporter for SCSS-Lint missing. +Please run gem install scss_lint_reporter_checkstyle" + :checker checker + :buffer buffer + :filename (buffer-file-name buffer))) + (flycheck-parse-checkstyle output checker buffer))) + +(flycheck-def-config-file-var flycheck-scss-lintrc scss-lint ".scss-lint.yml" + :safe #'stringp + :package-version '(flycheck . "0.23")) + +(flycheck-define-checker scss-lint + "A SCSS syntax checker using SCSS-Lint. + +See URL `https://github.com/brigade/scss-lint'." + :command ("scss-lint" + "--require=scss_lint_reporter_checkstyle" + "--format=Checkstyle" + (config-file "--config" flycheck-scss-lintrc) + source) + ;; We cannot directly parse Checkstyle XML, since for some mysterious reason + ;; SCSS-Lint doesn't have a built-in Checkstyle reporter, and instead ships it + ;; as an addon which might not be installed. We use a custom error parser to + ;; check whether the addon is missing and turn that into a special kind of + ;; Flycheck error. + :error-parser flycheck-parse-scss-lint + :modes scss-mode) + +(flycheck-def-option-var flycheck-scss-compass nil scss + "Whether to enable the Compass CSS framework. + +When non-nil, enable the Compass CSS framework, via `--compass'." + :type 'boolean + :safe #'booleanp + :package-version '(flycheck . "0.16")) + +(flycheck-define-checker scss + "A SCSS syntax checker using the SCSS compiler. + +See URL `http://sass-lang.com'." + :command ("scss" + "--cache-location" (eval (flycheck-sass-scss-cache-location)) + (option-flag "--compass" flycheck-scss-compass) + "-c" source) + :error-patterns + ((error line-start "Syntax error on line " line ": " (message)) + (warning line-start "WARNING on line " line " of " (file-name) + ":" (optional "\r") "\n" (message) line-end) + (error line-start + (or "Syntax error: " "Error: ") + (message (one-or-more not-newline) + (zero-or-more "\n" + (one-or-more " ") + (one-or-more not-newline))) + (optional "\r") "\n" (one-or-more " ") "on line " line " of " (file-name) + line-end)) + :modes scss-mode) + +(flycheck-define-checker sh-bash + "A Bash syntax checker using the Bash shell. + +See URL `http://www.gnu.org/software/bash/'." + :command ("bash" "--norc" "-n" "--" source) + :error-patterns ((error line-start + (file-name) ":" (one-or-more (not (any digit))) + line (zero-or-more " ") ":" (zero-or-more " ") + (message) line-end)) + :modes sh-mode + :predicate (lambda () (eq sh-shell 'bash)) + :next-checkers ((warning . sh-shellcheck))) + +(flycheck-define-checker sh-posix-dash + "A POSIX Shell syntax checker using the Dash shell. + +See URL `http://gondor.apana.org.au/~herbert/dash/'." + :command ("dash" "-n" source) + :error-patterns + ((error line-start (file-name) ": " line ": " (backref 1) ": " (message))) + :modes sh-mode + :predicate (lambda () (eq sh-shell 'sh)) + :next-checkers ((warning . sh-shellcheck))) + +(flycheck-define-checker sh-posix-bash + "A POSIX Shell syntax checker using the Bash shell. + +See URL `http://www.gnu.org/software/bash/'." + :command ("bash" "--posix" "--norc" "-n" "--" source) + :error-patterns + ((error line-start + (file-name) ":" (one-or-more (not (any digit))) + line (zero-or-more " ") ":" (zero-or-more " ") + (message) line-end)) + :modes sh-mode + :predicate (lambda () (eq sh-shell 'sh)) + :next-checkers ((warning . sh-shellcheck))) + +(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)) + :next-checkers ((warning . sh-shellcheck))) + +(defconst flycheck-shellcheck-supported-shells '(bash ksh88 sh) + "Shells supported by ShellCheck.") + +(flycheck-def-option-var flycheck-shellcheck-excluded-warnings nil sh-shellcheck + "A list of excluded warnings for ShellCheck. + +The value of this variable is a list of strings, where each +string is a warning code to be excluded from ShellCheck reports. +By default, no warnings are excluded." + :type '(repeat :tag "Excluded warnings" + (string :tag "Warning code")) + :safe #'flycheck-string-list-p + :package-version '(flycheck . "0.21")) + +(flycheck-define-checker sh-shellcheck + "A shell script syntax and style checker using Shellcheck. + +See URL `https://github.com/koalaman/shellcheck/'." + :command ("shellcheck" + "--format" "checkstyle" + "--shell" (eval (symbol-name sh-shell)) + (option "--exclude" flycheck-shellcheck-excluded-warnings list + flycheck-option-comma-separated-list) + source) + :error-parser flycheck-parse-checkstyle + :error-filter flycheck-dequalify-error-ids + :modes sh-mode + :predicate (lambda () (memq sh-shell flycheck-shellcheck-supported-shells))) + +(flycheck-define-checker slim + "A Slim syntax checker using the Slim compiler. + +See URL `http://slim-lang.com'." + :command ("slimrb" "-c" source) + :error-patterns + ((error line-start + "Slim::Parser::SyntaxError:" (message) (optional "\r") "\n " + (file-name) ", Line " line (optional ", Column " column) + line-end)) + :modes slim-mode) + +(flycheck-def-config-file-var flycheck-chktexrc tex-chktex ".chktexrc" + :safe #'stringp) + +(flycheck-define-checker tex-chktex + "A TeX and LaTeX syntax and style checker using chktex. + +See URL `http://www.nongnu.org/chktex/'." + :command ("chktex" (config-file "-l" flycheck-chktexrc) "-v0" "-q" "-I" + source-inplace) + :error-patterns + ((warning line-start (file-name) ":" line ":" column ":" + (id (one-or-more digit)) ":" (message) line-end)) + :error-filter + (lambda (errors) + (flycheck-sanitize-errors (flycheck-increment-error-columns errors))) + :modes (latex-mode plain-tex-mode)) + +(flycheck-define-checker tex-lacheck + "A LaTeX syntax and style checker using lacheck. + +See URL `http://www.ctan.org/pkg/lacheck'." + :command ("lacheck" source-inplace) + :error-patterns + ((warning line-start + "\"" (file-name) "\", line " line ": " (message) + line-end)) + :modes latex-mode) + +(flycheck-define-checker texinfo + "A Texinfo syntax checker using makeinfo. + +See URL `http://www.gnu.org/software/texinfo/'." + :command ("makeinfo" "-o" null-device source-inplace) + :error-patterns + ((warning line-start (file-name) ":" + line (optional ":" column) ": " + "warning: " (message) line-end) + (error line-start (file-name) ":" + line (optional ":" column) ": " + (message) line-end)) + :modes texinfo-mode) + +(flycheck-define-checker verilog-verilator + "A Verilog syntax checker using the Verilator Verilog HDL simulator. + +See URL `http://www.veripool.org/wiki/verilator'." + :command ("verilator" "--lint-only" "-Wall" source) + :error-patterns + ((warning line-start "%Warning-" (zero-or-more not-newline) ": " + (file-name) ":" line ": " (message) line-end) + (error line-start "%Error: " (file-name) ":" + line ": " (message) line-end)) + :modes verilog-mode) + +(flycheck-define-checker xml-xmlstarlet + "A XML syntax checker and validator using the xmlstarlet utility. + +See URL `http://xmlstar.sourceforge.net/'." + :command ("xmlstarlet" "val" "-e" "-q" source) + :error-patterns + ((error line-start (file-name) ":" line "." column ": " (message) line-end)) + :modes (xml-mode nxml-mode)) + +(flycheck-define-checker xml-xmllint + "A XML syntax checker and validator using the xmllint utility. + +The xmllint is part of libxml2, see URL +`http://www.xmlsoft.org/'." + :command ("xmllint" "--noout" source) + :error-patterns + ((error line-start (file-name) ":" line ": " (message) line-end)) + :modes (xml-mode nxml-mode)) + +(flycheck-define-checker yaml-jsyaml + "A YAML syntax checker using JS-YAML. + +See URL `https://github.com/nodeca/js-yaml'." + :command ("js-yaml" source) + :error-patterns + ((error line-start + "JS-YAML: " (message) " at line " line ", column " column ":" + line-end)) + :modes yaml-mode) + +(flycheck-define-checker yaml-ruby + "A YAML syntax checker using Ruby's YAML parser. + +This syntax checker uses the YAML parser from Ruby's standard +library. + +See URL `http://www.ruby-doc.org/stdlib-2.0.0/libdoc/yaml/rdoc/YAML.html'." + :command ("ruby" "-ryaml" "-e" "begin; + file_name = ARGV[0]; \ + YAML.load(ARGF); \ + rescue Exception => e; \ + STDERR.puts \"#{file_name}:#{e}\"; \ + end" source) + :error-patterns + (;; Syck (Ruby <= 1.9.2, unmaintained) + (error line-start (file-name) + ":syntax error on line " line ", col " column ": `" (message) "'" line-end) + ;; Psych (Ruby >= 1.9.3) + (error line-start (file-name) ":" (zero-or-more not-newline) ":" (message) + "at line " line " column " column line-end)) + :modes yaml-mode) + +(provide 'flycheck) + +;; Local Variables: +;; coding: utf-8 +;; indent-tabs-mode: nil +;; End: + +;;; flycheck.el ends here diff --git a/elpa/flycheck-20150703.359/flycheck.info b/elpa/flycheck-20150703.359/flycheck.info new file mode 100644 index 00000000..3cc82f21 --- /dev/null +++ b/elpa/flycheck-20150703.359/flycheck.info @@ -0,0 +1,2893 @@ +This is flycheck.info, produced by makeinfo version 5.2 from +flycheck.texi. + +Modern on-the-fly syntax checking for GNU Emacs 24. + + Copyright © 2014–2015 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 . + + 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 + . +INFO-DIR-SECTION Emacs +START-INFO-DIR-ENTRY +* Flycheck: (flycheck). Modern on-the-fly syntax checking +END-INFO-DIR-ENTRY + + +File: flycheck.info, Node: Top, Next: Introduction, Up: (dir) + +Flycheck +******** + +Modern on-the-fly syntax checking for GNU Emacs 24. + + Copyright © 2014–2015 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 . + + 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 + . + + 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. + + *Note Introduction::, for more information about Flycheck. For +installations instructions and a quick tutorial, *note Installation:: +and *note Quickstart:: respectively. *Note Usage::, for a detailed user +guide. + +* Menu: + +* 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 +* Issues:: How to report issues in 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 + + +File: flycheck.info, Node: Introduction, Next: Installation, Prev: Top, Up: Top + +1 Introduction +************** + +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. + + • Over 40 languages with more than 70 checkers. *Note Supported + languages::. + • Fully automatic, fail-safe, on-the-fly syntax checking in buffers + • In-buffer error highlighting, with fringe indicators + • Error navigation + • Auto-updating error list + • Many customisation options + • A comprehensive manual + • A simple API to add support for new languages and tools + • A “doesn’t get in your way guarantee” + + +File: flycheck.info, Node: Installation, Next: Quickstart, Prev: Introduction, Up: Top + +2 Installation +************** + +2.1 Prerequisites +================= + +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. + + *Warning:* Flycheck tries to maintain compatibility with Windows as +well, and generally works well on Windows. Pull requests which fix or +improve Windows compatibility are _very_ welcome. However, Flycheck +does not explicitly support Windows. If there are issues or problems on +Windows, _you are on your own_. The Flycheck developers cannot answer +questions about Windows, or fix Windows-specific issues. + +2.2 Syntax checking tools +========================= + +Flycheck does _not_ check buffers itself. It relies on _external_ +programs to check buffers, which need to be installed separately. *Note +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.) + +2.3 Installation +================ + +Install Flycheck via Emacs’ built-in package manager, from the MELPA +Stable (http://stable.melpa.org) repository: + + M-x package-install RET flycheck + + Alternatively, you may use the MELPA (http://melpa.org) 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) + + *Warning:* Flycheck is available from Marmalade +(https://marmalade-repo.org/), but due to frequent outages of this +repository we recommend against it. + +2.4 Cask +======== + +If you use Cask (https://github.com/cask/cask) to manage your packages, +add the following to your ‘Cask’ file: + + (source gnu) + (source melpa-stable) + + (depends-on "flycheck") + + +File: flycheck.info, Node: Quickstart, Next: Usage, Prev: Installation, Up: Top + +3 Quickstart +************ + +3.1 Install and enable Flycheck +=============================== + +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’. + +3.2 Install syntax checker tools +================================ + +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 +(http://pylint.org): + + $ pip install pylint + + For Ruby, you might want to use Rubocop +(https://github.com/bbatsov/rubocop) and ruby-lint +(https://github.com/YorickPeterse/ruby-lint): + + $ gem install rubocop ruby-lint + + *Note Supported languages::, for a complete list of all languages +that Flycheck supports. + +3.3 Check syntax in a buffer +============================ + +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’). + +3.4 Navigate and list errors +============================ + +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. + +3.5 More features +================= + +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. + + +File: flycheck.info, Node: Usage, Next: Syntax checker definitions, Prev: Quickstart, Up: Top + +4 Usage +******* + +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. + +* Menu: + +* 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 + + +File: flycheck.info, Node: Checking buffers, Next: Syntax checkers, Up: Usage + +4.1 Checking buffers +==================== + +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 + + • the buffer is saved, + • new lines are inserted, + • or a short time after you stopped to make changes to the buffer. + + You can customise this behaviour by changing +‘flycheck-check-syntax-automatically’: + + -- User Option: 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: + +‘C-c ! c’ +‘M-x flycheck-buffer’ + Check syntax in the current buffer. + +*Note:* If syntax checking does not work, please check your setup: + +‘C-c ! v’ +‘M-x flycheck-verify-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’. + + +File: flycheck.info, Node: Syntax checkers, Next: Reporting results, Prev: Checking buffers, Up: Usage + +4.2 Syntax checkers +=================== + +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’: + + -- User Option: 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, *note (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 ! ?’ +‘M-x flycheck-describe-checker’ + 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: + +‘C-c ! s’ +‘M-x flycheck-select-checker’ + Prompt for a syntax checker and select this syntax checker for the + current buffer. + +‘C-u C-c ! s’ +‘C-u M-x flycheck-select-checker’ Remove any manual + 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: + + -- Variable: flycheck-checker + 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 (http://flake8.readthedocs.org/en/2.2.3/) + 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’. *Note (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: + +‘C-c ! x’ +‘M-x flycheck-disable-checker’ + Prompt for a syntax checker to disable in the current buffer. + +‘C-u C-c ! x’ +‘C-u M-x flycheck-disable-checker’ + 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 . + + ‘flycheck-disable-checker’ acutally sets the buffer-local value of +the ‘flycheck-disabled-checkers’ option: + + -- User Option: flycheck-disabled-checkers + A list of disabled syntax checkers. Flycheck will _never_ use + disabled syntax checkers to check a buffer. + + You can customise this variable with 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))) + + *Note (emacs)Directory Variables::, for more information about + directory variables. + + You can change the completion system used by the commands of this +section with ‘flycheck-completion-system’. + + +File: flycheck.info, Node: Reporting results, Next: Navigating errors, Prev: Syntax checkers, Up: Usage + +4.3 Reporting results of syntax checking +======================================== + +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: + + • It highlights errors and warnings reported by a syntax checking in + the buffer according to ‘flycheck-highlighting-mode’, + • and indicates these locations in the fringe according to + ‘flycheck-indication-mode’. + + -- User Option: flycheck-highlighting-mode + How Flycheck highlights errors and warnings in the buffer: + + ‘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. + + -- User Option: flycheck-indication-mode + How Flycheck indicates errors and warnings: + + ‘left-fringe’ + ‘right-fringe’ + Indicate errors in the left or right fringe respectively. + *Note (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. + + +File: flycheck.info, Node: Navigating errors, Next: Displaying errors, Prev: Reporting results, Up: Usage + +4.4 Navigating errors +===================== + +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. +*Note (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’: + +‘C-c ! n’ +‘M-x flycheck-next-error’ + 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. + +‘C-c ! p’ +‘M-x flycheck-previous-error’ + 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. + +‘M-x flycheck-first-error’ + 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: + + -- User Option: flycheck-navigation-minimum-level + 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. + + +File: flycheck.info, Node: Displaying errors, Next: Killing errors, Prev: Navigating errors, Up: Usage + +4.5 Displaying errors +===================== + +If the point is on a Flycheck error, Flycheck will display the message +and ID of the error at point in the echo area after a short delay. + + -- User Option: flycheck-display-errors-delay + The number of seconds to wait before displaying the error at point. + Floating point numbers can express fractions of seconds. + + You can set ‘flycheck-display-errors-function’ to change how Flycheck +displays error, and what information it displays: + + -- User Option: flycheck-display-errors-function + A function to display errors. The function is called with a list + of Flycheck error objects to display. *Note Errors::, for more + information about these objects. + + Flycheck provides some built-in display functions: + + -- Function: flycheck-display-error-messages + Show error messages and IDs in the echo area. + + -- Function: flycheck-display-error-messages-unless-error-list + Like ‘flycheck-display-error-messages’, but does not show anything + if the error list is visible. *Note Listing errors::, for more + information about the error list. + + The flycheck-pos-tip (https://github.com/flycheck/flycheck-pos-tip) +extension provides an alternative display function, which shows error +messages in a graphical popup. + + +File: flycheck.info, Node: Killing errors, Next: Listing errors, Prev: Displaying errors, Up: Usage + +4.6 Killing errors +================== + +You can also put error messages into the kill ring: + +‘C-c ! C-w’ +‘M-x flycheck-copy-errors-as-kill’ + 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. + +‘C-u C-c ! C-w’ +‘C-u M-x flycheck-copy-errors-as-kill’ + Copy all Flycheck error messages at point, including their IDs. + +‘M-0 C-c ! C-w’ +‘M-0 M-x flycheck-copy-errors-as-kill’ + Copy the IDs of the errors at point. + + +File: flycheck.info, Node: Listing errors, Next: Mode line display, Prev: Killing errors, Up: Usage + +4.7 Listing errors +================== + +To get an overview of all errors in the current buffer you can popup an +error list: + +‘C-c ! l’ +‘M-x flycheck-list-errors’ +‘M-x list-flycheck-errors’ + 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: + +‘n’ + Move to the next error. +‘p’ + Move to the previous error. +‘q’ + Hide the error list window. +‘RET’ + Jump to the location of the error at point. +‘g’ + Refresh the error list, by triggering a new syntax check in the + associated buffer. +‘S’ + 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. + + 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. + + +File: flycheck.info, Node: Mode line display, Next: Configuring checkers, Prev: Listing errors, Up: Usage + +4.8 Mode line display +===================== + +Flycheck always indicates its current state in the mode line, with one +of the following strings: + +‘FlyC’ + There are no errors in the current buffer. +‘FlyC*’ + Flycheck currently checks the current buffer. +‘FlyC:3/5’ + There are three errors and five warnings in the current buffer. +‘FlyC-’ + Flycheck did not find any syntax checker for the current buffer. + Try ‘C-c ! v’ (‘flycheck-verify-setup’) to find out why. +‘FlyC!’ + The syntax check failed. Inspect the ‘*Messages*’ buffer for more + information about the failure. +‘FlyC?’ + 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. *Note Issues::, for more information. + + The 3rd party extension flycheck-color-mode-line +(https://github.com/flycheck/flycheck-color-mode-line) automatically +changes the background colour of the mode line according to the results +of the last syntax check. + + +File: flycheck.info, Node: Configuring checkers, Prev: Mode line display, Up: Usage + +4.9 Configuring syntax checkers +=============================== + +Flycheck provides a rich interface to configure syntax checkers. There +are three different kinds of options for syntax checkers: + + • _Syntax checker options_ which directly change specific settings of + syntax checkers, + • _syntax checker configuration files_ which point syntax checkers to + configuration files which can comprehensively configure a syntax + checker, and + • _syntax checker executables_ which change the executables that + Flycheck runs for syntax checkers. + +4.9.1 Syntax checker options +---------------------------- + +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. *Note (emacs)File Variables::, and *note +(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: + +4.9.2 Syntax checker configuration files +---------------------------------------- + +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: + + 1. If the value contains a directory separator, expand the path + against the ‘default-directory’ of the current buffer. + 2. If the buffer has a file name, search the buffer’s directory and + any ancestor directories up to the root directory for the + configuration file. + 3. Eventually try to find the configuration file in the user’s home + directory. + + 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’: + + -- User Option: 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 (*note Syntax checker options::) you can +set these variables with file or directory variables. *Note (emacs)File +Variables::, and *note (emacs)Directory Variables:: respectively, for +more information. + +4.9.3 Syntax checker executables +-------------------------------- + +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: + +‘C-c ! e’ +‘M-x flycheck-set-checker-executable’ + 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. +‘C-u C-c ! e’ +‘C-u M-x flycheck-set-checker-executable’ + Reset the executable of a syntax checker in the current buffer. + + Prompt for a syntax checker and reset its executable to the + default. + + +File: flycheck.info, Node: Syntax checker definitions, Next: Flycheck hooks, Prev: Usage, Up: Top + +5 Syntax checker definitions +**************************** + +This chapter explains how to add new syntax checkers and how to extend +built-in syntax checkers, by example. *Note 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 (*note Issues::), so that +we can consider it for inclusion to make it available to all other users +of Flycheck. + +* Menu: + +* 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 + + +File: flycheck.info, Node: Defining syntax checkers, Next: Finding error patterns, Up: Syntax checker definitions + +5.1 Defining syntax checkers +============================ + +Flycheck provides the macro ‘flycheck-define-checker’ to define a new +syntax checker. The following example defines a simple syntax checker +for the popular Pylint (http://www.pylint.org/) tool for Python: + + (flycheck-define-checker python-pylint + "A Python syntax and style checker using Pylint. + + See URL `http://www.pylint.org/'." + :command ("pylint" + "--msg-template" "{path}:{line}:{column}:{C}:{msg} ({msg_id})" + source) + :error-patterns + ((error line-start (file-name) ":" line ":" column ":" + (or "E" "F") ":" (message) line-end) + (warning line-start (file-name) ":" line ":" column ":" + (or "W" "R") ":" (message) line-end) + (info line-start (file-name) ":" line ":" column ":" + "C:" (message) line-end)) + :modes python-mode) + + 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 ! ? +python-pylint’. + + 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: + + • The ‘:command’ specifies the command Flycheck should run to check + the buffer. It’s a simple list containing the executable and its + arguments. + + In our example we first the ‘--msg-template’ option to ‘pylint’ to + configure a comprehensive and parseable output format. + + Then we use the “special” ‘source’ argument to pass the contents of + the buffer as input file to ‘pylint’. Whenever it sees the + ‘source’ argument, Flycheck creates a temporary file, fills it with + the current contents of the buffer and passes that file to the + syntax checker. This allows to check the real contents of a buffer + even if the buffer is not saved to disk. + + Refer to the function ‘flycheck-substitute-argument’ for a complete + list of all special symbols. + + • The ‘: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: + + • The ‘(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. + • The ‘line’ and ‘column’ forms match a sequence of one or more + digits as line and column respectively of the error. + + Refer to the function ‘flycheck-rx-to-string’ for a complete list + of supported forms. + + • The ‘:modes’ property denotes the major modes, in which Flycheck + may use this syntax checker. ‘pylint’ checks Javascript, so the + ‘:modes’ of our example specify ‘python-mode’. + + +File: flycheck.info, Node: Finding error patterns, Next: Trying new checkers, Prev: Defining syntax checkers, Up: Syntax checker definitions + +5.2 Finding the right error patterns +==================================== + +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’. + +‘C-c ! C-c’ +‘M-x 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. + + Sometimes however an output format doesn’t lend itself to error +patterns. In this case, you need to write a more sophisticated parser +yourself. *Note Parsing structured output::, for more information. + + +File: flycheck.info, Node: Trying new checkers, Next: Registering new checkers, Prev: Finding error patterns, Up: Syntax checker definitions + +5.3 Trying a new syntax checker +=============================== + +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. + + +File: flycheck.info, Node: Registering new checkers, Next: Parsing structured output, Prev: Trying new checkers, Up: Syntax checker definitions + +5.4 Registering new syntax checkers +=================================== + +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. + + *Note*: Do _not_ use ‘flycheck-checker’ and ‘flycheck-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 +calling ‘flycheck-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) + + +File: flycheck.info, Node: Parsing structured output, Next: Passing configuration to checkers, Prev: Registering new checkers, Up: Syntax checker definitions + +5.5 Parsing structured output +============================= + +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 +(http://www.jshint.com/) 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. *Note Error parsers::, for more +information about error parsers. + + +File: flycheck.info, Node: Passing configuration to checkers, Next: Controlling use of checkers, Prev: Parsing structured output, Up: Syntax checker definitions + +5.6 Passing options and configuration files to syntax checkers +============================================================== + +Many linting tools provide a rich set of options to configure their +analysis. Flycheck makes it to define proper Emacs options and map them +to options of commands. + + For instance, the Rubocop (bbatsov/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, other Flycheck omits the entire argument. + + Flycheck also supports other special ‘option-’ arguments for plain +values or lists of values. *Note 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. *Note Syntax +checker options::, for more information about syntax checker +configuration, and *note 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 +(http://www.pylint.org/) 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. *Note Syntax checker configuration files::, for +more information about syntax checker configuration, and *note Checker +configuration::, for the corresponding API reference. + + +File: flycheck.info, Node: Controlling use of checkers, Next: Applying multiple checkers, Prev: Passing configuration to checkers, Up: Syntax checker definitions + +5.7 Controlling the use of a syntax checker +=========================================== + +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. + + +File: flycheck.info, Node: Applying multiple checkers, Prev: Controlling use of checkers, Up: Syntax checker definitions + +5.8 Applying multiple syntax checkers +===================================== + +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 +(koalaman/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 +(*note 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. + + +File: flycheck.info, Node: Flycheck hooks, Next: Flycheck API, Prev: Syntax checker definitions, Up: Top + +6 Flycheck hooks +**************** + +This chapter gives you a brief overview over Flycheck’s rich hook +interface, which you can use for your own extensions. + +6.1 Status changes +================== + +‘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 +(https://github.com/flycheck/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. + +6.2 Error processing +==================== + +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. + +6.3 Error display +================= + +The function ‘flycheck-display-errors-function’ is called to display an +error at point. The flycheck-pos-tip +(https://github.com/flycheck/flycheck-pos-tip) extension uses this hook +to show errors in a GUI popup like conventional IDEs do. + + +File: flycheck.info, Node: Flycheck API, Next: Supported languages, Prev: Flycheck hooks, Up: Top + +7 Flycheck API +************** + +TODO: The API documentation still needs to be written. + +* Menu: + +* Command syntax checkers:: Syntax checkers with external commands +* Errors:: Error representation in Flycheck + + +File: flycheck.info, Node: Command syntax checkers, Next: Errors, Up: Flycheck API + +7.1 Command syntax checkers +=========================== + +* Menu: + +* Argument Substitution:: Argument substitution in syntax checker commands +* Checker configuration:: Configuration for command checkers +* Error parsers:: Parsing structured output formats + + +File: flycheck.info, Node: Argument Substitution, Next: Checker configuration, Up: Command syntax checkers + +7.1.1 Argument substitution +--------------------------- + + +File: flycheck.info, Node: Checker configuration, Next: Error parsers, Prev: Argument Substitution, Up: Command syntax checkers + +7.1.2 Configuration options and files +------------------------------------- + + +File: flycheck.info, Node: Error parsers, Prev: Checker configuration, Up: Command syntax checkers + +7.1.3 Error parsers +------------------- + + +File: flycheck.info, Node: Errors, Prev: Command syntax checkers, Up: Flycheck API + +7.2 Errors +========== + + +File: flycheck.info, Node: Supported languages, Next: Issues, Prev: Flycheck API, Up: Top + +Appendix A Supported languages +****************************** + +This chapter lists the languages supported by Flycheck. Some 3rd party +extensions add support for more languages: + + • flycheck-ledger (https://github.com/flycheck-ledger) adds a syntax + checker for files of the Ledger (http://ledger-cli.org/) accounting + tool. + • flycheck-mercury (https://github.com/flycheck/flycheck-mercury) + adds a syntax checker for the Mercury (http://mercurylang.org/) + programming language. + • flycheck-ocaml (https://github.com/flycheck/flycheck-ocaml) adds a + syntax checker for the OCaml programming language, using the Merlin + (https://github.com/the-lambda-church/merlin) tool. + + 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. + +Ada +=== + + • ‘ada-gnat’ (GNAT (https://gcc.gnu.org/onlinedocs/gnat_ugn_unw/)), + 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’ (AsciiDoc (http://www.methods.co.nz/asciidoc)) + +C/C++ +===== + + 1. ‘c/c++-clang’ (syntax and type check with Clang + (http://clang.llvm.org/)) or ‘c/c++-gcc’ (syntax and type check + with GCC (https://gcc.gnu.org/)), and + 2. ‘c/c++-cppcheck’ (style and error check with cppcheck + (http://cppcheck.sourceforge.net/)). + + ‘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. + +CFEngine +======== + + • ‘cfengine’ (CFEngine (http://cfengine.com/)) + +Chef +==== + + • ‘chef-foodcritic’ (style check with foodcritic + (http://acrmp.github.io/foodcritic/)), with the following option: + + ‘flycheck-foodcritic-tags’ + A list of tags to select for Foodcritic. + +Coffeescript +============ + + 1. ‘coffee’ (syntax check with coffee (http://coffeescript.org/)) + 2. ‘coffee-coffeelint’ (code style check with coffeelint + (http://www.coffeelint.org/)), with the following option: + + ‘flycheck-coffeelintrc’ + Configuration file for coffeelint. *Note Syntax checker + configuration files::, for more information about + configuration files. + +Coq +=== + + • ‘coq’ (Coq (http://coq.inria.fr/)) + +CSS +=== + + • ‘css-csslint’ (style and error check with CSSLint + (https://github.com/CSSLint/csslint)) + +D += + + • ‘d-dmd’ (DMD (http://dlang.org/)), with the following options: + + ‘flycheck-dmd-include-path’ + A list of include directories for DMD. + ‘flycheck-dmd-args’ + A list of additional arguments for DMD. + + The extension flycheck-d-unittest + (https://github.com/flycheck/flycheck-d-unittest) adds a syntax + checker which runs D unittests on the fly and reports the results. + +Emacs Lisp +========== + + 1. ‘emacs-lisp’ (syntax check with the built-in Emacs byte compiler) + 2. ‘emacs-lisp-checkdoc’ (code and documentation check with + ‘checkdoc’) + + The extension flycheck-package + (https://github.com/purcell/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’ (Erlang (http://www.erlang.org/)) + + ‘flycheck-erlang-include-path’ + A list of include directories for Erlang. + +ERuby +===== + + • ‘eruby-erubis’ (‘erubis’ (http://www.kuwata-lab.com/erubis/)) + +Fortran +======= + + 1. ‘fortran-gfortran’ (GFortran + (https://gcc.gnu.org/onlinedocs/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 +== + + 1. ‘go-gofmt’ (syntax check with gofmt (http://golang.org/cmd/gofmt/)) + 2. ‘go-golint’ (coding style with Golint + (https://github.com/golang/lint)) + 3. ‘go-vet’ (check for suspicious code with ‘go tool vet’ + (http://godoc.org/golang.org/x/tools/cmd/vet)) + 4. ‘go-build’ or ‘go-test’ (syntax and type check with Go + (http://golang.org/cmd/go), for source and tests respectively) + 5. ‘go-errcheck’ (check for unhandled error returns with errcheck + (https://github.com/kisielk/errcheck)) + + ‘go-vet’ provides the following option: + +‘flycheck-go-vet-print-functions’ + A list of print-like functions for go vet. Go vet will check these + functions for format string problems. + +Haml +==== + + • ‘haml’ (Haml (http://haml.info/)) + +Handlebars +========== + + • ‘handlebars’ (Handlebars (http://handlebarsjs.com/)) + +Haskell +======= + + 1. ‘haskell-ghc’ (syntax and type checker with GHC + (http://www.haskell.org/ghc/)), and + + 2. ‘haskell-hlint’ (style checker with hlint + (https://github.com/ndmitchell/hlint)) + + The extension flycheck-haskell + (https://github.com/flycheck/flycheck-haskell) configures Flycheck + from the current Cabal project, and adds support for Cabal + sandboxes. The extension flycheck-hdevtools + (https://github.com/flycheck/flycheck-hdevtools) adds an + alternative syntax checker for ‘haskell-ghc’ using hdevtools + (https://github.com/bitc/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 +==== + + • ‘html-tidy’ (Tidy HTML5 (https://github.com/w3c/tidy-html5)), with + the following option: + + ‘flycheck-tidyrc’ + Configuration file for Tidy. *Note Syntax checker + configuration files::, for more information about + configuration files. + +Javascript +========== + + 1. • ‘javascript-jshint’ (JSHint (http://jshint.com/)) + • Or ‘javascript-eslint’ (ESLint (http://eslint.org/)) + • Or ‘javascript-gjslint’ (Closure Linter + (https://developers.google.com/closure/utilities)) + 2. ‘javascript-jscs’ (JSCS (http://jscs.info/)) + 3. ‘javascript-standard’ (Standard + (https://github.com/feross/standard) or Semistandard + (https://github.com/Flet/semistandard)) + + The ‘javascript-eslint’ checker provides the following option: + +‘flycheck-eslint-rulesdir’ + A directory with custom rules for ESLint. +‘flycheck-eslintrc’ + Configuration file for ESLint. *Note Syntax checker configuration + files::, for more information about configuration files. + + ‘javascript-jshint’, ‘javascript-gjslint’ and ‘javascript-jscs’ read +configuration files: + +‘flycheck-jshintrc’ + Configuration file for JSHint. *Note Syntax checker configuration + files::, for more information about configuration files. +‘flycheck-gjslintrc’ + Configuration file for Closure Linter. *Note Syntax checker + configuration files::, for more information about configuration + files. +‘flycheck-jscsrc’ + Configuration file for JSCS. *Note Syntax checker configuration + files::, for more information about configuration files. + +JSON +==== + + • ‘json-jsonlint’ (jsonlint (https://github.com/zaach/jsonlint)) + +Less +==== + + • ‘less’ (less (http://lesscss.org/)) + +Lua +=== + + • ‘luacheck’ (Luacheck (https://github.com/mpeterv/luacheck)) with + the following option: + + ‘flycheck-luacheckrc’ + Configuration file for Luacheck. *Note Syntax checker + configuration files::, for more information about + configuration files. + + • ‘lua’ (Lua compiler (http://www.lua.org/)) + +Perl +==== + + 1. ‘perl’ (syntax check with the Perl interpreter + (http://www.perl.org/)) + 2. ‘perl-perlcritic’ (style and code check with Perl::Critic + (https://metacpan.org/pod/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-perlcritic-severity’ + The severity level for Perl::Critic, as integer for the + ‘--severity’ option of Perl::Critic. + +PHP +=== + + 1. ‘php’ (syntax check with PHP CLI + (https://metacpan.org/pod/Perl::Critic)) + 2. ‘php-phpmd’ (code check with PHP Mess Detector (http://phpmd.org/)) + 3. ‘php-phpcs’ (style check with PHP CodeSniffer + (http://pear.php.net/package/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. + +Puppet +====== + + • ‘puppet-parser’ (syntax check with Puppet (http://puppetlabs.com/)) + • ‘puppet-lint’ (style check with Puppet Lint + (http://puppet-lint.com/)) + +Python +====== + + • ‘python-flake8’ (syntax and style checking with flake8 + (https://pypi.python.org/pypi/flake8)), or + • ‘python-pylint’ (syntax and style checking with Pylint + (http://pylint.org/)), or + • ‘python-pycompile’ (syntax checking with Python’s built-in byte + compiler (https://docs.python.org/3.4/library/py_compile.html), as + last resort) + + The extension flycheck-pyflakes + (https://github.com/Wilfred/flycheck-pyflakes) adds a syntax + checker using Pyflakes (https://pypi.python.org/pypi/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. *Note Syntax checker configuration + files::, for more information about configuration files. + + ‘python-pylint’ reads a configuration file: + +‘flycheck-pylintrc’ + Configuration file for Pylint. *Note Syntax checker configuration + files::, for more information about configuration files. + +R += + + • ‘r-lintr’ (syntax and style check with lintr (jimhester/lintr)), + with the following options: + + ‘flycheck-lintr-caching’ + Whether to enable caching in lintr. On by default. Only + disable it if caching causes real problems. + + ‘flycheck-lintr-linters’ + Linters to use with lintr, as a string containing an R + expression which selects the linters to use. + +Racket +====== + + • ‘racket’ (Racket (http://racket-lang.org/)) + +RPM Spec +======== + + • ‘rpm-rpmlint’ (rpmlint (http://sourceforge.net/projects/rpmlint/)) + +reStructuredText +================ + + • ‘rst’ (using docutils (http://docutils.sourceforge.net/), for plain + reStructuredFiles files), or ‘rst-sphinx’ (using Sphinx + (http://sphinx-doc.org/), for Sphinx documentation files) + + ‘rst-sphinx’ provides the following option: + +‘flycheck-sphinx-warn-on-missing-references’ + Whether to emit warnings for all missing references in Sphinx. + +Ruby +==== + + 1. ‘ruby-rubocop’ (syntax and style check using RuboCop + (http://batsov.com/rubocop/)) + 2. ‘ruby-rubylint’ (syntax and style check using ruby-lint + (http://code.yorickpeterse.com/ruby-lint/latest/)) + + 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. *Note Syntax checker configuration + files::, for more information about configuration files. +‘flycheck-rubylintrc’ + Configuration file for ruby-lint. *Note 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 + (https://www.ruby-lang.org/)), + • ‘ruby-jruby’ (using JRuby (http://jruby.org/)) + +Rust +==== + + • ‘rust’ (using the Rust compiler (http://www.rust-lang.org/)), with + 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. + + ‘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 library directories for Rust. Relative paths are + relative to the buffer being checked. + + The flycheck-rust (https://github.com/flycheck/flycheck-rust) + extension configures Flycheck according to the current Cargo + (http://doc.crates.io/guide.html) project. + +Sass +==== + + • ‘sass’ (using the standard Sass processor (http://sass-lang.com/)), + with the following option: + + ‘flycheck-sass-compass’ + Whether to enable the Compass CSS framework in SASS, via + ‘--compass’. + +Scala +===== + + 1. ‘scala’ (syntax and type check using the Scala compiler + (http://www.scala-lang.org/)) + 2. ‘scala-scalastyle’ (style check using Scalastyle + (http://www.scalastyle.org/)) + + The ‘scala-scalastyle’ syntax checker needs the following options: + +‘flycheck-scalastyle-jar’ + The path to the main JAR file of Scalastyle. +‘flycheck-scalastylerc’ + Configuration file for Scalastyle. *Note Syntax checker + configuration files::, for more information about configuration + files. + + If these options are not set, ‘scala-scalastyle’ will not be used. + +SCSS +==== + + • ‘scss-lint’ (using SCSS-Lint + (https://github.com/brigade/scss-lint)), or + • ‘scss’ (using the standard SCSS processor (http://sass-lang.com/)) + + 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. *Note Syntax checker + configuration files::, for more information about configuration + files. + +Shell scripting languages +========================= + + 1. Syntax check with one of the following checkers, depending on the + shell used for the current Sh Mode buffer, + • ‘sh-bash’ (for Bash (http://www.gnu.org/software/bash/)) + • ‘sh-posix-dash’ or ‘sh-posix-bash’ (for POSIX shell scripts, + using Dash (http://gondor.apana.org.au/~herbert/dash/) or Bash + (http://www.gnu.org/software/bash/) respectively) + • ‘sh-zsh’ (for Zsh (http://www.zsh.org/)) + 2. ‘sh-shellcheck’ (code and style check using ShellCheck + (https://github.com/koalaman/shellcheck/)) + + ‘sh-shellcheck’ provides the following option: + +‘flycheck-shellcheck-excluded-warnings’ + A list of excluded warnings for ShellCheck. + +Slim +==== + + • ‘slim’ (using Slim (http://slim-lang.com/)) + +TeX/LaTeX +========= + + • ‘tex-chktex’ (style check using ChkTeX + (http://www.nongnu.org/chktex/)), or + • ‘tex-lacheck’ (style check using Lacheck + (http://www.ctan.org/pkg/lacheck)) + + ‘tex-chktex’ provides the following option: + +‘flycheck-chktexrc’ + Configuration file for ChkTeX. *Note Syntax checker configuration + files::, for more information about configuration files. + +Texinfo +======= + + • ‘texinfo’ (using makeinfo (http://www.gnu.org/software/texinfo/)) + +Verilog +======= + + • ‘verilog-verilator’ (using Verilator + (http://www.veripool.org/wiki/verilator)) + +XML +=== + + • ‘xml-xmlstarlet’ (using XMLStarlet + (http://xmlstar.sourceforge.net)), or + • ‘xml-xmllint’ (using xmllint (http://www.xmlsoft.org/)) + +YAML +==== + + • ‘yaml-jsyaml’ (using js-yaml (https://github.com/nodeca/js-yaml)), + or + • ‘yaml-ruby’ (using Ruby’s YAML parser) + + +File: flycheck.info, Node: Issues, Next: GNU Free Documentation License, Prev: Supported languages, Up: Top + +Appendix B Issues +***************** + +Please report any bugs or issues to the issue tracker +(https://github.com/flycheck/flycheck/issues). If you report a bug, +please include the following information to help us identify and fix the +culprit: + + • The output of ‘M-x flycheck-verify-setup’ in affected buffers + • The version of Emacs, as reported by ‘M-x emacs-version’ + • The version of Flycheck, as reported by ‘M-x flycheck-version’ + • A complete and precise description of the issue, including a + description of the expected _and_ the observed behaviour. + + Please also tell us your ideas for improvements or new features. + + Patches are _very_ welcome as well. If you have code to contribute, +please do not hesitate to open a pull request. We would like to ask you +to obey a few Guidelines +(https://github.com/flycheck/flycheck/blob/master/CONTRIBUTING.md), +though. + + +File: flycheck.info, Node: GNU Free Documentation License, Next: Main Index, Prev: Issues, Up: Top + +Appendix C GNU Free Documentation License +***************************************** + + Version 1.3, 3 November 2008 + + Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + 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. + + 1. APPLICABILITY AND DEFINITIONS + + 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. + + 2. VERBATIM COPYING + + 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. + + 3. COPYING IN QUANTITY + + 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. + + 4. MODIFICATIONS + + 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: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document’s + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled “History”, Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled “History” in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + “History” section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled “Acknowledgements” or “Dedications”, + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled “Endorsements”. Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + “Endorsements” or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + 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. + + 5. COMBINING DOCUMENTS + + 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.” + + 6. COLLECTIONS OF DOCUMENTS + + 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. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + 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. + + 8. TRANSLATION + + 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. + + 9. TERMINATION + + 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. + + 10. FUTURE REVISIONS OF THIS LICENSE + + 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 + . + + 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. + + 11. RELICENSING + + “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. + +ADDENDUM: How to use this License for your documents +==================================================== + +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. + + +File: flycheck.info, Node: Main Index, Next: Key Index, Prev: GNU Free Documentation License, Up: Top + +Main Index +********** + +[index] +* Menu: + +* Ada language: Supported languages. (line 30) +* AsciiDoc language: Supported languages. (line 47) +* automatic syntax checker selection: Syntax checkers. (line 6) +* C/C++ language: Supported languages. (line 52) +* cask: Installation. (line 61) +* CFEngine language: Supported languages. (line 115) +* chaining of syntax checkers: Syntax checkers. (line 15) +* Chef language: Supported languages. (line 120) +* Coffeescript language: Supported languages. (line 129) +* configuration files of syntax checkers: Configuring checkers. + (line 43) +* Coq language: Supported languages. (line 141) +* CSS language: Supported languages. (line 146) +* D language: Supported languages. (line 152) +* Emacs Lisp language: Supported languages. (line 166) +* Erlang language: Supported languages. (line 194) +* ERuby language: Supported languages. (line 202) +* executables of syntax checkers: Configuring checkers. + (line 110) +* features: Introduction. (line 16) +* flycheck mode: Checking buffers. (line 6) +* Fortran language: Supported languages. (line 207) +* Go language: Supported languages. (line 233) +* Haml language: Supported languages. (line 252) +* Handlebars language: Supported languages. (line 257) +* Haskell language: Supported languages. (line 262) +* HTML language: Supported languages. (line 298) +* installation: Installation. (line 37) +* Javascript language: Supported languages. (line 309) +* JSON language: Supported languages. (line 343) +* Language, Ada: Supported languages. (line 30) +* Language, AsciiDoc: Supported languages. (line 47) +* Language, C/C++: Supported languages. (line 52) +* Language, CFEngine: Supported languages. (line 115) +* Language, Chef: Supported languages. (line 120) +* Language, Coffeescript: Supported languages. (line 129) +* Language, Coq: Supported languages. (line 141) +* Language, CSS: Supported languages. (line 146) +* Language, D: Supported languages. (line 152) +* Language, Emacs Lisp: Supported languages. (line 166) +* Language, Erlang: Supported languages. (line 194) +* Language, ERuby: Supported languages. (line 202) +* Language, Fortran: Supported languages. (line 207) +* Language, Go: Supported languages. (line 233) +* Language, Haml: Supported languages. (line 252) +* Language, Handlebars: Supported languages. (line 257) +* Language, Haskell: Supported languages. (line 262) +* Language, HTML: Supported languages. (line 298) +* Language, Javascript: Supported languages. (line 309) +* Language, JSON: Supported languages. (line 343) +* Language, Less: Supported languages. (line 348) +* Language, Lua: Supported languages. (line 353) +* Language, Perl: Supported languages. (line 366) +* Language, PHP: Supported languages. (line 383) +* Language, Puppet: Supported languages. (line 403) +* Language, Python: Supported languages. (line 410) +* Language, R: Supported languages. (line 446) +* Language, Racket: Supported languages. (line 460) +* Language, reStructuredText: Supported languages. (line 470) +* Language, RPM Spec: Supported languages. (line 465) +* Language, Ruby: Supported languages. (line 482) +* Language, Rust: Supported languages. (line 510) +* Language, Sass: Supported languages. (line 537) +* Language, Scala: Supported languages. (line 547) +* Language, SCSS: Supported languages. (line 566) +* Language, Shell scripting languages: Supported languages. (line 583) +* Language, Slim: Supported languages. (line 601) +* Language, TeX/LaTeX: Supported languages. (line 606) +* Language, Texinfo: Supported languages. (line 620) +* Language, Verilog: Supported languages. (line 625) +* Language, XML: Supported languages. (line 631) +* Language, YAML: Supported languages. (line 638) +* Less language: Supported languages. (line 348) +* Lua language: Supported languages. (line 353) +* manual syntax checker selection: Syntax checkers. (line 39) +* operating system: Installation. (line 9) +* options of syntax checkers: Configuring checkers. + (line 20) +* Perl language: Supported languages. (line 366) +* PHP language: Supported languages. (line 383) +* prerequisites: Installation. (line 9) +* Puppet language: Supported languages. (line 403) +* Python language: Supported languages. (line 410) +* R language: Supported languages. (line 446) +* Racket language: Supported languages. (line 460) +* reStructuredText language: Supported languages. (line 470) +* RPM Spec language: Supported languages. (line 465) +* Ruby language: Supported languages. (line 482) +* Rust language: Supported languages. (line 510) +* Sass language: Supported languages. (line 537) +* Scala language: Supported languages. (line 547) +* SCSS language: Supported languages. (line 566) +* Shell scripting languages language: Supported languages. (line 583) +* Slim language: Supported languages. (line 601) +* syntax checker: Syntax checkers. (line 6) +* syntax checker configuration files: Configuring checkers. + (line 43) +* syntax checker executables: Configuring checkers. + (line 110) +* syntax checker options: Configuring checkers. + (line 20) +* syntax checker selection, automatic: Syntax checkers. (line 6) +* syntax checker selection, manual: Syntax checkers. (line 39) +* TeX/LaTeX language: Supported languages. (line 606) +* Texinfo language: Supported languages. (line 620) +* Verilog language: Supported languages. (line 625) +* XML language: Supported languages. (line 631) +* YAML language: Supported languages. (line 638) + + +File: flycheck.info, Node: Key Index, Next: Function and Variable Index, Prev: Main Index, Up: Top + +Key Index +********* + +[index] +* Menu: + +* C-c ! ?: Syntax checkers. (line 31) +* C-c ! c: Checking buffers. (line 57) +* C-c ! C-c: Finding error patterns. + (line 16) +* C-c ! C-w: Killing errors. (line 8) +* C-c ! e: Configuring checkers. + (line 125) +* C-c ! l: Listing errors. (line 9) +* C-c ! n: Navigating errors. (line 22) +* C-c ! p: Navigating errors. (line 32) +* C-c ! s: Syntax checkers. (line 43) +* C-c ! v: Checking buffers. (line 63) +* C-c ! x: Syntax checkers. (line 85) +* C-u C-c ! C-w: Killing errors. (line 16) +* C-u C-c ! e: Configuring checkers. + (line 130) +* C-u C-c ! s: Syntax checkers. (line 48) +* C-u C-c ! x: Syntax checkers. (line 89) +* M-0 C-c ! C-w: Killing errors. (line 20) + + +File: flycheck.info, Node: Function and Variable Index, Prev: Key Index, Up: Top + +Function and variable index +*************************** + +[index] +* Menu: + +* flycheck-buffer: Checking buffers. (line 57) +* flycheck-check-syntax-automatically: Checking buffers. (line 33) +* flycheck-checker: Syntax checkers. (line 58) +* flycheck-checker-error-threshold: Reporting results. (line 50) +* flycheck-checkers: Syntax checkers. (line 10) +* flycheck-chktexrc: Supported languages. (line 614) +* flycheck-clang-args: Supported languages. (line 61) +* flycheck-clang-blocks: Supported languages. (line 64) +* flycheck-clang-definitions: Supported languages. (line 66) +* flycheck-clang-include-path: Supported languages. (line 69) +* flycheck-clang-includes: Supported languages. (line 73) +* flycheck-clang-language-standard: Supported languages. (line 77) +* flycheck-clang-ms-extensions: Supported languages. (line 81) +* flycheck-clang-no-exceptions: Supported languages. (line 83) +* flycheck-clang-no-rtti: Supported languages. (line 86) +* flycheck-clang-pedantic: Supported languages. (line 93) +* flycheck-clang-pedantic-errors: Supported languages. (line 96) +* flycheck-clang-standard-library: Supported languages. (line 89) +* flycheck-clang-warnings: Supported languages. (line 99) +* flycheck-clear: Reporting results. (line 55) +* flycheck-coffeelintrc: Supported languages. (line 134) +* flycheck-compile: Finding error patterns. + (line 16) +* flycheck-completion-system: Syntax checkers. (line 123) +* flycheck-copy-errors-as-kill: Killing errors. (line 8) +* flycheck-cppcheck-checks: Supported languages. (line 106) +* flycheck-cppcheck-inconclusive: Supported languages. (line 109) +* flycheck-describe-checker: Syntax checkers. (line 31) +* flycheck-disable-checker: Syntax checkers. (line 85) +* flycheck-disabled-checkers: Syntax checkers. (line 102) +* flycheck-display-error-messages: Displaying errors. (line 23) +* flycheck-display-error-messages-unless-error-list: Displaying errors. + (line 26) +* flycheck-display-errors-delay: Displaying errors. (line 9) +* flycheck-display-errors-function: Displaying errors. (line 16) +* flycheck-dmd-args: Supported languages. (line 157) +* flycheck-dmd-include-path: Supported languages. (line 155) +* flycheck-emacs-lisp-initialize-packages: Supported languages. + (line 182) +* flycheck-emacs-lisp-load-path: Supported languages. (line 177) +* flycheck-emacs-lisp-package-user-dir: Supported languages. (line 188) +* flycheck-erlang-include-path: Supported languages. (line 197) +* flycheck-error: Reporting results. (line 32) +* flycheck-error-list-after-refresh-hook: Listing errors. (line 14) +* flycheck-error-list-highlight: Listing errors. (line 41) +* flycheck-eslint-rulesdir: Supported languages. (line 321) +* flycheck-eslintrc: Supported languages. (line 323) +* flycheck-first-error: Navigating errors. (line 42) +* flycheck-flake8-error-level-alist: Supported languages. (line 425) +* flycheck-flake8-maximum-complexity: Supported languages. (line 428) +* flycheck-flake8-maximum-line-length: Supported languages. (line 431) +* flycheck-flake8rc: Supported languages. (line 434) +* flycheck-foodcritic-tags: Supported languages. (line 124) +* flycheck-gcc-args: Supported languages. (line 62) +* flycheck-gcc-definitions: Supported languages. (line 67) +* flycheck-gcc-include-path: Supported languages. (line 70) +* flycheck-gcc-includes: Supported languages. (line 74) +* flycheck-gcc-language-standard: Supported languages. (line 78) +* flycheck-gcc-no-exceptions: Supported languages. (line 84) +* flycheck-gcc-no-rtti: Supported languages. (line 87) +* flycheck-gcc-openmp: Supported languages. (line 91) +* flycheck-gcc-pedantic: Supported languages. (line 94) +* flycheck-gcc-pedantic-errors: Supported languages. (line 97) +* flycheck-gcc-warnings: Supported languages. (line 100) +* flycheck-gfortran-args: Supported languages. (line 212) +* flycheck-gfortran-include-path: Supported languages. (line 215) +* flycheck-gfortran-language-standard: Supported languages. (line 219) +* flycheck-gfortran-layout: Supported languages. (line 223) +* flycheck-gfortran-warnings: Supported languages. (line 228) +* flycheck-ghc-args: Supported languages. (line 279) +* flycheck-ghc-language-extensions: Supported languages. (line 293) +* flycheck-ghc-no-user-package-database: Supported languages. (line 282) +* flycheck-ghc-package-databases: Supported languages. (line 285) +* flycheck-ghc-search-path: Supported languages. (line 290) +* flycheck-gjslintrc: Supported languages. (line 333) +* flycheck-global-modes: Checking buffers. (line 6) +* flycheck-gnat-args: Supported languages. (line 34) +* flycheck-gnat-include-path: Supported languages. (line 36) +* flycheck-gnat-language-standard: Supported languages. (line 39) +* flycheck-gnat-warnings: Supported languages. (line 41) +* flycheck-go-vet-print-functions: Supported languages. (line 246) +* flycheck-highlighting-mode: Reporting results. (line 15) +* flycheck-idle-change-delay: Checking buffers. (line 40) +* flycheck-indication-mode: Reporting results. (line 36) +* flycheck-info: Reporting results. (line 32) +* flycheck-jscsrc: Supported languages. (line 337) +* flycheck-jshintrc: Supported languages. (line 330) +* flycheck-keymap-prefix: Usage. (line 8) +* flycheck-lintr-caching: Supported languages. (line 450) +* flycheck-lintr-linters: Supported languages. (line 454) +* flycheck-list-errors: Listing errors. (line 9) +* flycheck-locate-config-file-functions: Configuring checkers. + (line 84) +* flycheck-luacheckrc: Supported languages. (line 357) +* flycheck-mode: Checking buffers. (line 6) +* flycheck-navigation-minimum-level: Navigating errors. (line 55) +* flycheck-next-error: Navigating errors. (line 22) +* flycheck-perl-include-path: Supported languages. (line 374) +* flycheck-perlcritic-severity: Supported languages. (line 377) +* flycheck-phpcs-standard: Supported languages. (line 397) +* flycheck-phpmd-rulesets: Supported languages. (line 392) +* flycheck-previous-error: Navigating errors. (line 32) +* flycheck-pylintrc: Supported languages. (line 440) +* flycheck-rubocop-lint-only: Supported languages. (line 490) +* flycheck-rubocoprc: Supported languages. (line 493) +* flycheck-rubylintrc: Supported languages. (line 496) +* flycheck-rust-args: Supported languages. (line 514) +* flycheck-rust-check-tests: Supported languages. (line 516) +* flycheck-rust-crate-root: Supported languages. (line 519) +* flycheck-rust-crate-type: Supported languages. (line 523) +* flycheck-rust-library-path: Supported languages. (line 527) +* flycheck-sass-compass: Supported languages. (line 541) +* flycheck-scalastyle-jar: Supported languages. (line 555) +* flycheck-scalastylerc: Supported languages. (line 557) +* flycheck-scss-compass: Supported languages. (line 573) +* flycheck-scss-lintrc: Supported languages. (line 576) +* flycheck-select-checker: Syntax checkers. (line 43) +* flycheck-set-checker-executable: Configuring checkers. + (line 125) +* flycheck-shellcheck-excluded-warnings: Supported languages. (line 596) +* flycheck-sphinx-warn-on-missing-references: Supported languages. + (line 477) +* flycheck-standard-error-navigation: Navigating errors. (line 6) +* flycheck-temp-prefix: Checking buffers. (line 71) +* flycheck-tidyrc: Supported languages. (line 302) +* flycheck-verify-setup: Checking buffers. (line 63) +* flycheck-warning: Reporting results. (line 32) +* global-flycheck-mode: Checking buffers. (line 6) +* list-flycheck-errors: Listing errors. (line 9) + + + +Tag Table: +Node: Top1137 +Node: Introduction3358 +Node: Installation4451 +Node: Quickstart6739 +Node: Usage9275 +Node: Checking buffers10275 +Node: Syntax checkers13099 +Node: Reporting results18498 +Node: Navigating errors20817 +Node: Displaying errors23373 +Node: Killing errors24782 +Node: Listing errors25569 +Node: Mode line display27121 +Node: Configuring checkers28434 +Ref: Syntax checker options29150 +Ref: Syntax checker configuration files30168 +Ref: Syntax checker executables33055 +Node: Syntax checker definitions34259 +Node: Defining syntax checkers35440 +Node: Finding error patterns39659 +Node: Trying new checkers41006 +Node: Registering new checkers41691 +Node: Parsing structured output43239 +Node: Passing configuration to checkers44482 +Node: Controlling use of checkers48086 +Node: Applying multiple checkers49188 +Node: Flycheck hooks52441 +Node: Flycheck API54074 +Node: Command syntax checkers54412 +Node: Argument Substitution54782 +Node: Checker configuration54952 +Node: Error parsers55164 +Node: Errors55310 +Node: Supported languages55422 +Ref: language-Ada56631 +Ref: language-AsciiDoc57255 +Ref: language-C/C++57338 +Ref: language-CFEngine59792 +Ref: language-Chef59860 +Ref: language-Coffeescript60105 +Ref: language-Coq60505 +Ref: language-CSS60561 +Ref: language-D60671 +Ref: language-Emacs Lisp61116 +Ref: language-Erlang62244 +Ref: language-ERuby62405 +Ref: language-Fortran62500 +Ref: language-Go63393 +Ref: language-Haml64143 +Ref: language-Handlebars64212 +Ref: language-Haskell64294 +Ref: language-HTML65534 +Ref: language-Javascript65843 +Ref: language-JSON67203 +Ref: language-Less67289 +Ref: language-Lua67346 +Ref: language-Perl67704 +Ref: language-PHP68239 +Ref: language-Puppet68931 +Ref: language-Python69113 +Ref: language-R70397 +Ref: language-Racket70834 +Ref: language-RPM Spec70909 +Ref: language-reStructuredText71023 +Ref: language-Ruby71412 +Ref: language-Rust72423 +Ref: language-Sass73361 +Ref: language-Scala73614 +Ref: language-SCSS74221 +Ref: language-Shell scripting languages74781 +Ref: language-Slim75517 +Ref: language-TeX/LaTeX75594 +Ref: language-Texinfo76006 +Ref: language-Verilog76101 +Ref: language-XML76206 +Ref: language-YAML76374 +Node: Issues76513 +Node: GNU Free Documentation License77534 +Node: Main Index102881 +Node: Key Index110860 +Node: Function and Variable Index112368 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: