-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathflycheck-fortran-linter.el
87 lines (63 loc) · 2.65 KB
/
flycheck-fortran-linter.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
;;; flycheck-fortran-linter.el --- Help to have compliant fortran
;; Copyright (C) 2017 Corentin Cadiou
;; Author: Corentin Cadiou <[email protected]>
;; URL: https://github.com/cphyc/fortran-syntax
;; Version: 1.0.1
;; Keywords: flycheck, fortran, fortran90
;; Package-Requires: ((flycheck))
;; This file is not part of GNU Emacs.
;; This program 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.
;; This program 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.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This is extension for Flycheck.
;;;; Setup
;; (eval-after-load 'flycheck
;; '(progn
;; (require 'flycheck-fortran-linter)
;; ;; Add Fortran linter
;; (flycheck-add-next-checker 'fortran/fortran-gfortran `append)))
;;; Code:
(require 'flycheck)
(flycheck-def-option-var flycheck-fortran-linter-linelength "80" fortran-linter
"The allowed line length for Fortran linter.
linelength=digits
This is the allowed line length for the project. The default value is
80 characters.
Examples:
--linelength=120"
:type '(string :tag "Line length")
:safe #'stringp
:package-version '(flycheck . "0.18"))
(flycheck-def-option-var flycheck-fortran-linter-max-errors "500" fortran-linter
"Maximum number of errors to report.
This is the maximum number of errors the linter will report. The default value is
500 characters.
Examples:
--max-errs=500"
:type '(string :tag "Max errors")
:safe #'stringp
:package-version '(flycheck . "0.18"))
(flycheck-define-checker fortran-linter
"A Fortran linter.
See URL `https://github.com/cphyc/fortran-syntax'."
:command ("/home/ccc/.bin/fortran-linter.py"
"--syntax-only"
(option "--linelength=" flycheck-fortran-linter-linelength concat)
(option "--max-errors=" flycheck-fortran-linter-max-errors concat)
source)
:error-patterns
((warning line-start (file-name) ":" line (or ":" ".") column (or ": " ":\n")
(or (= 3 (zero-or-more not-newline) "\n") "")
"Warning: " (message) line-end))
:modes (f90-mode))
(add-to-list 'flycheck-checkers 'fortran-linter 'append)
(provide 'flycheck-fortran-linter)
;;; flycheck-fortran-linter.el ends here