forked from nakib/elphbolt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinter.el
More file actions
19 lines (17 loc) · 879 Bytes
/
linter.el
File metadata and controls
19 lines (17 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
;; This script lints all .f90 files in the directories [./src/, ./app/, and ./test/].
;; It applies the default linting rules of the emacs f90-mode.
;;
;; It is recommended that you run the linter before commiting your changes.
;;
;; Run the linter by saying the following in your shell: emacs --batch -l linter.el
;;
;; Note that if you have a currently open buffer visiting the file that has been linted, you will not be able to see the changes unless you "refresh" the view. To refresh, say C-x C-v on the file.
(defun lint-all-files (directory)
(let ((file-list (directory-files directory t "\\.f90$")))
(dolist (file file-list)
(with-temp-buffer
(insert-file-contents file)
(f90-mode)
(indent-region (point-min) (point-max)) ;; "TAB" entire buffer
(write-file file)))))
(mapcar #'lint-all-files '("./src/" "./app/" "./test/"))