summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTakuya Fujiwara <tyru.exe@gmail.com>2018-10-27 01:29:17 +0900
committerw0rp <w0rp@users.noreply.github.com>2018-10-26 17:29:17 +0100
commit34318aedf4ffaf4558a102db6c03ae3b13d5ff08 (patch)
tree283fb2a9e72c80aacf07dc2bdeb2bb0ca1960c2d /doc
parent3d74a4f8a6d89ccaf5194736ab91936124d62cb1 (diff)
downloadale-34318aedf4ffaf4558a102db6c03ae3b13d5ff08.zip
Add prolog swipl linter (#1979)
* add prolog/swipl linter * use load_files/2 instead of read_term/2 Because it also checks some semantic warnings / errors not only syntactic warnings / errors. e.g.: * singleton warning * discontiguous warning * ... cf. http://www.swi-prolog.org/pldoc/doc_for?object=style_check/1 * support error messages with no line number :- module(module_name, [pred/0]). causes ERROR: Exported procedure module_name:pred/0 is not defined * add test for prolog/swipl handler * cosmetic fixes * detect timeout using SIGALRM * rename g:prolog_swipl_goals to g:prolog_swipl_load * write doc for prolog/swipl linter * update toc and README * fix ignore patterns
Diffstat (limited to 'doc')
-rw-r--r--doc/ale-prolog.txt56
-rw-r--r--doc/ale.txt3
2 files changed, 59 insertions, 0 deletions
diff --git a/doc/ale-prolog.txt b/doc/ale-prolog.txt
new file mode 100644
index 00000000..14062a5a
--- /dev/null
+++ b/doc/ale-prolog.txt
@@ -0,0 +1,56 @@
+===============================================================================
+ALE Prolog Integration *ale-prolog-options*
+
+
+===============================================================================
+swipl *ale-prolog-swipl*
+
+g:ale_prolog_swipl_executable *g:ale_prolog_swipl_executable*
+ *b:ale_prolog_swipl_executable*
+ Type: |String|
+ Default: `'swipl'`
+
+ The executable that will be run for the `swipl` linter.
+
+g:ale_prolog_swipl_load *g:ale_prolog_swipl_load*
+ *b:ale_prolog_swipl_load*
+ Type: |String|
+ Default: `'current_prolog_flag(argv, [File]), load_files(File, [sandboxed(true)]), halt.'`
+
+ The prolog goals that will be passed to |g:ale_prolog_swipl_executable| with `-g` option.
+
+ It does:
+ 1. Takes the first command argument (current file path)
+ 2. Checks (syntactic / semantic) problems and output to stderr
+
+ NOTE: `sandboxed(true)` prohibits executing some directives such as 'initialization main'.
+
+g:ale_prolog_swipl_timeout *g:ale_prolog_swipl_timeout*
+ *b:ale_prolog_swipl_timeout*
+ Type: |Number|
+ Default: `3`
+
+ Timeout seconds to detect long-running linter.
+ It is done by setting SIGALRM.
+ See |g:ale_prolog_swipl_alarm| and |g:ale_prolog_swipl_alarm_handler|.
+
+g:ale_prolog_swipl_alarm *g:ale_prolog_swipl_alarm*
+ *b:ale_prolog_swipl_alarm*
+ Type: |String|
+ Default: `'alarm(%t, (%h), _, [])'`
+
+ The prolog goals to be expected to set SIGALRM.
+ `%t` is replaced by |g:ale_prolog_swipl_timeout|.
+ `%h` is replaced by |g:ale_prolog_swipl_alarm_handler|.
+
+g:ale_prolog_swipl_alarm_handler *g:ale_prolog_swipl_alarm_handler*
+ *b:ale_prolog_swipl_alarm_handler*
+ Type: |String|
+ Default: `'writeln(user_error, "ERROR: Exceeded %t seconds, Please change g:prolog_swipl_timeout to modify the limit."), halt(1)'`
+
+ The prolog goals to be expected that will be run on SIGALRM.
+ `%t` is replaced by |g:ale_prolog_swipl_timeout|.
+
+
+===============================================================================
+ vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/doc/ale.txt b/doc/ale.txt
index 66ce8ab1..95110431 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -226,6 +226,8 @@ CONTENTS *ale-contents*
write-good..........................|ale-pod-write-good|
pony..................................|ale-pony-options|
ponyc...............................|ale-pony-ponyc|
+ prolog................................|ale-prolog-options|
+ swipl...............................|ale-prolog-swipl|
proto.................................|ale-proto-options|
protoc-gen-lint.....................|ale-proto-protoc-gen-lint|
pug...................................|ale-pug-options|
@@ -453,6 +455,7 @@ Notes:
* PO: `alex`!!, `msgfmt`, `proselint`, `write-good`
* Pod: `alex`!!, `proselint`, `write-good`
* Pony: `ponyc`
+* Prolog: `swipl`
* proto: `protoc-gen-lint`
* Pug: `pug-lint`
* Puppet: `languageserver`, `puppet`, `puppet-lint`