From 3d14eb581f2d3134ec8a5add17216ed831064ab1 Mon Sep 17 00:00:00 2001 From: Romanos Skiadas Date: Fri, 16 Sep 2016 19:49:29 +0300 Subject: [PATCH] Yaml layer: enable flycheck --- layers/+lang/yaml/README.org | 7 ++++++- layers/+lang/yaml/config.el | 2 +- layers/+lang/yaml/packages.el | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/layers/+lang/yaml/README.org b/layers/+lang/yaml/README.org index e1042026c4bd..418e7407c0cc 100644 --- a/layers/+lang/yaml/README.org +++ b/layers/+lang/yaml/README.org @@ -3,11 +3,16 @@ * Table of Contents :TOC_4_gh:noexport: - [[#description][Description]] - [[#install][Install]] + - [[#syntax-checking-with-flycheck][Syntax checking with flycheck]] * Description -This layer provides syntax highlighting for YAML files. +This layer provides syntax highlighting and syntax checking via [[http://www.flycheck.org/en/latest/languages.html#yaml][flycheck]] for YAML files. * Install To use this configuration layer, add it to your =~/.spacemacs=. You will need to add =yaml= to the existing =dotspacemacs-configuration-layers= list in this file. + +* Syntax checking with flycheck +Flycheck checks YAML with yaml-jsyaml or yaml-ruby. The flycheck YAML +documentation can be found at the [[http://www.flycheck.org/en/latest/languages.html#yaml][flycheck website]]. diff --git a/layers/+lang/yaml/config.el b/layers/+lang/yaml/config.el index dd462e5f89ef..fa10b6dd6c04 100644 --- a/layers/+lang/yaml/config.el +++ b/layers/+lang/yaml/config.el @@ -1,4 +1,4 @@ -;;; config.el --- YAML Layer packages File for Spacemacs +;;; config.el --- YAML Layer configuration File for Spacemacs ;; ;; Copyright (c) 2012-2016 Sylvain Benner & Contributors ;; diff --git a/layers/+lang/yaml/packages.el b/layers/+lang/yaml/packages.el index 70d139826360..de5fe74201e6 100644 --- a/layers/+lang/yaml/packages.el +++ b/layers/+lang/yaml/packages.el @@ -9,11 +9,15 @@ ;; ;;; License: GPLv3 (setq yaml-packages '(company + flycheck yaml-mode)) (defun yaml/post-init-company () (spacemacs|add-company-hook yaml-mode)) +(defun yaml/post-init-flycheck () + (spacemacs/add-flycheck-hook 'yaml-mode)) + (defun yaml/init-yaml-mode () "Initialize YAML mode" (use-package yaml-mode