spacemacs/layers/+tools/cfengine/README.org
Miciah Dashiel Butler Masters 78297be625 Fix various typos
* Fix various isolated typos

"apppend" -> "append"

"availabe" -> "available"

"Descripti using ternon" -> "Description"

"you have not them" -> "you don't have them"

"new on" -> "new one"

"plained" -> "curved"

"repel" -> "REPL"

"vairable" -> "variable"

* Fix a few errors in the CoffeeScript layer readme

Add a missing "the".

Correct a reference to the layer as "javascript" to "coffeescript".

Fix the syntax on the link to CoffeeLint.

* Fix typos: "dofile" -> "dotfile"

* Fix typos: "formated" and "formating"

"formated" -> "formatted"

"formating" -> "formatting"

* hy: Fix docstrings in funcs.el

Fix copy-and-pasted docstring text for
spacemacs/hy-shell-eval-current-form-and-go and
spacemacs/hy-shell-eval-region-and-go.

* Fix typos: "indendation" -> "indentation"

* Fix typos: "the the", "a a"

Fix duplicated (or misplaced) articles.

* Fix typos: "wether" -> "whether"

* Fix typos: "intialize" -> "initialize"
2018-05-23 22:12:30 -04:00

89 lines
2.6 KiB
Org Mode

#+TITLE: CFEngine layer
#+PROPERTY: header-args :eval never-export
[[file:./img/agent.png]]
* Table of Contents :TOC_4_gh:noexport:
- [[#description][Description]]
- [[#features][Features:]]
- [[#install][Install]]
- [[#configuration][Configuration]]
- [[#set-file-permission-on-save][Set file permission on save]]
- [[#indentation][Indentation]]
- [[#execution-of-cfengine3-src-blocks][Execution of =cfengine3= SRC blocks]]
- [[#key-bindings][Key bindings]]
* Description
This layer adds support for CFEngine policies to Spacemacs.
** Features:
- Syntax highlighting
- On the fly syntax checking via =flycheck= integration.
- Auto completion via =company= integration.
- Execution of =cfengine3= =SRC= blocks in =org-mode= via =ob-cfengine3= package.
* Install
Add =cfengine= to the =dotspacemacs-configuration-layers= in your =~/.spacemacs=
to use this layer.
* Configuration
** Set file permission on save
Here is a function to set permissions to 600 on save, this can help avoid
errors like:
=File ./example.cf (owner 1000) is writable by others (security exception)=
#+BEGIN_SRC elisp
(defun cfengine-permissions-policy-owner-only ()
"If file starts with a shebang, make `buffer-file-name' executable"
(save-excursion
(set-file-modes buffer-file-name #o600)
(message (concat "Made " buffer-file-name " accessibly only by the owner (600)."))))
(add-hook 'after-save-hook 'cfengine-permissions-policy-owner-only nil 'make-it-local)
#+END_SRC
** Indentation
If you like attributes to be intended from the promiser set =Indentation amount
from anchor= to =2=. For example:
#+begin_src cfengine3
bundle agent main
{
vars:
"promiser"
string => "value",
comment => "Indented 2 spaces from promiser";
}
#+end_src
* Execution of =cfengine3= SRC blocks
This layers add support for =cfengine3= source blocks in org files.
With the insertion point inside the SRC block press ~,,~ or ~CTRL-c Ctrl-c~
#+BEGIN_SRC cfengine3
bundle agent main
{
reports:
"Hello World!";
}
#+END_SRC
#+RESULTS:
: R: Hello World!
See the ob-cfengine3 [[https://github.com/nickanderson/ob-cfengine3/blob/master/README.org][README]] for information on controlling inclusion of the
stdlib, definition of classes and controlling the =bundlesequence= using header
args.
To suppress the confirmation when executing a block set
=(setq org-confirm-babel-evaluate nil)= in =dotspacemacs/user-config()=.
* Key bindings
| Key Binding | Description |
|-------------+-----------------------|
| ~SPC m j~ | Reformats JSON string |