Skip to content
Back to top
View this page
Edit this page

# Flycheck — Syntax checking for GNU Emacs

Flycheck is a modern on-the-fly syntax checking extension for GNU Emacs, intended as replacement for the older Flymake extension which is part of GNU Emacs. For a detailed comparison to Flymake see Flycheck versus Flymake.

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:

Out of the box Flycheck supports over 40 different programming languages with more than 80 different syntax checking tools, and comes with a simple interface to define new syntax checkers.

Many 3rd party extensions provide new syntax checkers and other features like alternative error displays or mode line indicators.

## Try out

Flycheck needs GNU Emacs 27.1+, and works best on Unix systems. Windows users, please be aware that Flycheck does not support Windows officially, although it should mostly work fine on Windows. See Windows support and watch out for known Windows issues!

To try Flycheck in your Emacs session install some syntax checker tools and type the following in your `*scratch*` buffer and run `M-x eval-buffer`:

    (require 'package)
    (add-to-list 'package-archives
                 '("MELPA Stable" . "http://stable.melpa.org/packages/") t)
    (package-initialize)
    (package-refresh-contents)

    (package-install 'flycheck)

    (global-flycheck-mode)

On macOS also add the following to fix your $PATH environment variable:

    (package-install 'exec-path-from-shell)
    (exec-path-from-shell-initialize)

For a permanent installation of Flycheck follow the Installation instructions. For a gentle introduction into Flycheck features go through the Quickstart guide.

Important

If Flycheck fails to run properly or gives you any error messages please take a look at the troubleshooting section which covers some common setup issues and helps you debug and fix problems with Flycheck.

## The User Guide

The User Guide provides installation and usage help for Flycheck. It starts with installation instructions and a quick start tutorial and then focuses on an in-depth reference to all parts of Flycheck.

- Installation
  - Prerequisites
    - Windows support
    - Syntax checking tools
  - Package installation
    - use-package
    - Distribution packages
  - Legacy installation methods
- Quickstart
  - Enable Flycheck
  - Install syntax checker programs
  - Check syntax in a buffer
  - Navigate and list errors
  - More features
- Troubleshooting
  - Common issues
    - Flycheck can’t find any programs in GUI Emacs on macOS
    - Flycheck warns about “non-zero exit code, but no errors”
  - Verify your setup
  - Debug syntax checkers
  - If all else fails…
- Check buffers
  - Check automatically
  - Check manually
- Syntax checkers
  - Select syntax checkers automatically
  - Select syntax checkers manually
  - Disable syntax checkers
  - Configure syntax checkers
    - Configuration files
  - Change syntax checker executables
  - Configuring checker chains
- See errors in buffers
  - Error levels
  - Error highlights
  - Fringe and margin icons
  - Mode line
  - Error thresholds
  - Clear results
- List all errors
  - Filter the list
  - Sort the list
  - Tune error list display
- Interact with errors
  - Navigate errors
  - Display errors
  - Errors from other files
  - Explain errors
  - Kill errors
- Flycheck versus Flymake
  - Overview
  - Detailed review
    - Relation to Emacs
    - Automatic syntax checking
    - Syntax checkers
      - Supported languages
      - 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
    - Errors
      - Error identifiers
      - Error explanations
      - Error indicators
      - Error parsing
      - Error message display
      - Supported by Eglot
      - Supported by lsp-mode

## The Community Guide

The Community Guide provides information about Flycheck’s ecosystem and community.

- Flycheck Code of Conduct
  - Conduct
  - Moderation
- Recommended extensions
  - User interface
  - Eglot
  - Language support
    - Cadence
    - Clojure
    - C/C++/Objective C
    - D
    - Deno
    - Emacs Lisp
    - Julia
    - Haskell
    - Kotlin
    - Ledger
    - Mercury
    - OCaml
    - PHP
    - Python
    - Rust
    - Shell scripts
- Get help
- People
  - Teams
    - Maintainers
    - Moderators
    - Language teams
      - Elixir
      - Go
      - Haskell
      - Javascript
      - Lua
      - Mercury
      - PHP
      - Puppet
      - Ruby
      - Rust
      - TypeScript
  - Packagers
  - Acknowledgments
  - Contributors

## The Developer Guide

The Developer Guide shows how to extend Flycheck and how to write syntax checkers for Flycheck.

- Developer’s Guide
  - An overview of Flycheck internals
  - Adding a syntax checker to Flycheck
    - Writing the checker
    - Registering the checker
    - Writing more complex checkers
    - Sharing your checker
    - Issues with auto-quoting in `flycheck-define-checker`

## The Contributor Guide

The Contributor Guide explains how to contribute to Flycheck.

- Contributor’s Guide
  - Bug reports
    - Windows-only issues
  - Feature requests
  - The build system
  - Pull requests
  - Writing documentation
  - Issue management
  - Out of tree contributions
- Style Guide
  - Features
  - Backward compatibility
  - Style
  - Libraries
  - Tests
  - Documentation
  - Commits
    - Commit message style
- Maintainer’s Guide
  - Issue triage
  - Git workflow
    - Branch rules
    - Pull requests reviews
      - As a maintainer
      - As a contributor
      - Merge guidelines
    - Signatures for commits and tags
  - Tooling and Services
  - Maintenance scripts
  - Versioning and releases
    - Release process
  - New maintainers

## Indices and Tables

- Supported Languages

- Glossary

- Changes

- Index

- Search Page

## Licensing

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

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

See GNU General Public License 3 for a copy of the GNU General Public License.

You may copy, distribute and/or modify the Flycheck documentation under the terms of the Creative Commons Attribution-ShareAlike 4.0 International Public License. See Creative Commons Attribution-ShareAlike 4.0 International for a copy of the license.

Permission is granted to copy, distribute and/or modify the Flycheck logo under the terms of the Creative Commons Attribution-ShareAlike 4.0 International Public License. See Creative Commons Attribution-ShareAlike 4.0 International for a copy of the license.