A Flycheck syntax checker that implements Holberton School Betty-Style as an
Emacs extension, providing C style syntax checking On the Fly.
More information on: Betty repository
- Betty executable
- Emacs 24.3+ (for Flycheck)
- Flycheck
- Linux or OsX (for the install script)
Clone this repository, cd
to Betty-On-Emacs
directory and run the script try_it_first.sh
That's it!
This script will run an instance of Emacs in an isolated environment using this repo as the Emacs home directory and load the configuration from the .emacs config file where everything is already set for you. ;-)
You can indeed use the .emacs
file as reference to implement your own configuration.
Flycheck is available through MELPA the Emacs Lisp Package Archive.
If not already installed on your system follow the Installation instructions
that consists basically of the addition 3 lines of lisp code to your .emacs
config file.
-
Clone this repo somewhere in your system and run the
install.sh
script:$ git clone [email protected]:havk64/Betty-on-Emacs.git $ cd Betty-on-Emacs $ ./install.sh
The script
install.sh
uses GNU Stow which is a tool for managing the
installation of multiple software packages in the same run-time directory tree,
thus, a reliable and secure tool to manage dotfiles too.Running the
install.sh
script will create symlinks in the~/.emacs.d
directory pointing to the files in this repo. Hence you don't need to copy or
update them locally/manually if they get updated. -
Add this two lines to your Emacs config file
~/.emacs
:(load "~/.emacs.d/private/Betty/betty-style") (add-to-list 'flycheck-checkers 'betty-style)
The first line loads the byte-compiled version of the lisp source code and the
second addbetty-style
to the list of availableflycheck-checkers
enabling it.
For a brief introduction into Flycheck and overview of most important features
check the Quickstart page.
-
CFLAGS:
Thegcc
flycheck checker by default checks for the-Wall
and-Wextra
flags
by means of the variableflycheck-gcc-warnings
which should have the value:
("all" "extra")
.
You can also add the flag pedantic by customizing the variable
flycheck-gcc-pedantic
totrue
and add the flag-Werror
to the list
like this:(setq flycheck-gcc-pedantic t) (setq flycheck-gcc-warnings '("all" "extra" "error"))
to have the flags
-Wall -Werror -Wextra -pedantic
checked on the fly.Note: to check the value of a variable on Emacs execute:
Ctrl-h v name-of-variable RET
-
ShellCheck:
Flycheck by default provide syntax check for shell scripts via Shellcheck
and more than 40 different programming languages
To enable Shellcheck or any of the other syntax checkers(linters) you just
need to install the respective executable system-wide.
More information here