mirror of
https://github.com/vale981/melpazoid
synced 2025-03-05 09:21:39 -05:00
misc small code cleanups
This commit is contained in:
parent
32a976753b
commit
94f8e84135
3 changed files with 16 additions and 17 deletions
|
@ -1,3 +1,2 @@
|
||||||
(add-to-list 'load-path (getenv "ELISP_PATH"))
|
(add-to-list 'load-path (getenv "ELISP_PATH"))
|
||||||
(package-initialize)
|
(package-initialize)
|
||||||
(require 'melpazoid)
|
|
||||||
|
|
|
@ -80,8 +80,9 @@
|
||||||
(ignore-errors (kill-buffer "*Warnings*"))
|
(ignore-errors (kill-buffer "*Warnings*"))
|
||||||
(let ((sentence-end-double-space nil) ; be a little more lenient
|
(let ((sentence-end-double-space nil) ; be a little more lenient
|
||||||
(checkdoc-proper-noun-list nil)
|
(checkdoc-proper-noun-list nil)
|
||||||
(checkdoc-common-verbs-wrong-voice nil))
|
(checkdoc-common-verbs-wrong-voice nil)
|
||||||
(let ((inhibit-message t)) (ignore-errors (checkdoc-file filename))))
|
(inhibit-message t))
|
||||||
|
(ignore-errors (checkdoc-file filename)))
|
||||||
(if (not (get-buffer "*Warnings*"))
|
(if (not (get-buffer "*Warnings*"))
|
||||||
(melpazoid-insert "- No issues!")
|
(melpazoid-insert "- No issues!")
|
||||||
(with-current-buffer "*Warnings*"
|
(with-current-buffer "*Warnings*"
|
||||||
|
@ -233,16 +234,16 @@ then also scan comments for REGEXP; similar for INCLUDE-STRINGS."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(while (re-search-forward regexp nil t)
|
(while (re-search-forward regexp nil t)
|
||||||
(when (save-excursion
|
(save-excursion
|
||||||
(goto-char (match-beginning 0))
|
(goto-char (match-beginning 0))
|
||||||
(and
|
(when (and
|
||||||
(or include-comments (not (nth 4 (syntax-ppss))))
|
(or include-comments (not (nth 4 (syntax-ppss))))
|
||||||
(or include-strings (not (nth 3 (syntax-ppss))))))
|
(or include-strings (not (nth 3 (syntax-ppss)))))
|
||||||
;; print a header unless it's already been printed:
|
;; print a header unless it's already been printed:
|
||||||
(unless melpazoid--misc-header-printed-p
|
(unless melpazoid--misc-header-printed-p
|
||||||
(melpazoid-insert "Other possible lints:")
|
(melpazoid-insert "Other possible lints:")
|
||||||
(setq melpazoid--misc-header-printed-p t))
|
(setq melpazoid--misc-header-printed-p t))
|
||||||
(melpazoid--annotate-line msg)))))
|
(melpazoid--annotate-line msg))))))
|
||||||
|
|
||||||
(defun melpazoid--annotate-line (msg)
|
(defun melpazoid--annotate-line (msg)
|
||||||
"Annotate the current line with MSG."
|
"Annotate the current line with MSG."
|
||||||
|
@ -278,7 +279,7 @@ OBJECTS are objects to interpolate into the string using `format'."
|
||||||
(set-buffer (find-file filename))
|
(set-buffer (find-file filename))
|
||||||
(melpazoid-byte-compile filename)
|
(melpazoid-byte-compile filename)
|
||||||
(melpazoid-checkdoc filename)
|
(melpazoid-checkdoc filename)
|
||||||
;; (melpazoid--check-declare)
|
;; (melpazoid-check-declare)
|
||||||
(melpazoid-package-lint)
|
(melpazoid-package-lint)
|
||||||
(melpazoid-check-sharp-quotes)
|
(melpazoid-check-sharp-quotes)
|
||||||
(melpazoid-check-misc))
|
(melpazoid-check-misc))
|
||||||
|
|
|
@ -253,9 +253,8 @@ def _main_file(files: List[str], recipe: str) -> str:
|
||||||
# looks for name-pkg.el, then name-pkg.el.in, and then name.el,
|
# looks for name-pkg.el, then name-pkg.el.in, and then name.el,
|
||||||
# which happens to match sorted() order:
|
# which happens to match sorted() order:
|
||||||
for el in sorted(files)
|
for el in sorted(files)
|
||||||
if os.path.basename(el) == f"{name}-pkg.el"
|
if os.path.basename(el)
|
||||||
or os.path.basename(el) == f"{name}-pkg.el.in"
|
in (f"{name}-pkg.el", f"{name}-pkg.el.in", f"{name}.el")
|
||||||
or os.path.basename(el) == f"{name}.el"
|
|
||||||
)
|
)
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
return ''
|
return ''
|
||||||
|
@ -715,7 +714,7 @@ def _clone(repo: str, into: str, branch: str, fetcher: str = 'github') -> bool:
|
||||||
if branch:
|
if branch:
|
||||||
_note(f"CI workflow detected; using branch '{branch}'", CLR_INFO)
|
_note(f"CI workflow detected; using branch '{branch}'", CLR_INFO)
|
||||||
|
|
||||||
subprocess.run(['mkdir', '-p', into])
|
os.makedirs(into, exist_ok=True)
|
||||||
scm = 'hg' if fetcher == 'hg' else 'git'
|
scm = 'hg' if fetcher == 'hg' else 'git'
|
||||||
if scm == 'git':
|
if scm == 'git':
|
||||||
# If a package's repository doesn't use the master branch, then the
|
# If a package's repository doesn't use the master branch, then the
|
||||||
|
|
Loading…
Add table
Reference in a new issue