[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/flycheck 0c8de6de03 5/6: Reorganize flycheck--stylelints t
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/flycheck 0c8de6de03 5/6: Reorganize flycheck--stylelints to be above all stylelint checkers |
Date: |
Sun, 17 Mar 2024 04:00:31 -0400 (EDT) |
branch: elpa/flycheck
commit 0c8de6de03bb1639552007f70a9c66ebdd382496
Author: Justin Barclay <git@justinbarclay.ca>
Commit: Bozhidar Batsov <bozhidar@batsov.dev>
Reorganize flycheck--stylelints to be above all stylelint checkers
---
flycheck.el | 58 +++++++++++++++++++++++++++++-----------------------------
1 file changed, 29 insertions(+), 29 deletions(-)
diff --git a/flycheck.el b/flycheck.el
index 51ff3876d7..9f5d1eaa82 100644
--- a/flycheck.el
+++ b/flycheck.el
@@ -8225,6 +8225,35 @@ about the JSON format of stylelint."
;; Return the combined errors (deprecations, invalid options, warnings)
(append deprecations invalid-options warnings))))
+(defun flycheck--stylelint-config-exists-p (checker)
+ "Whether there is a valid stylelint CHECKER config for the current buffer."
+ (eql 0 (flycheck-call-checker-process
+ checker nil nil nil
+ "--print-config" (or buffer-file-name "index.js"))))
+
+(defun flycheck--stylelint-get-major-version (checker)
+ "Return major version of stylelint CHECKER."
+ (let ((cb (current-buffer)))
+ (with-temp-buffer
+ (let ((temp-buffer (current-buffer)))
+ (with-current-buffer cb
+ (flycheck-call-checker-process
+ checker nil temp-buffer nil "--version"))
+ (string-to-number (car (split-string (buffer-string) "\\.")))))))
+
+(defun flycheck--stylelint-verify (checker)
+ "Verify stylelint setup for CHECKER."
+ (let ((have-config (flycheck--stylelint-config-exists-p checker)))
+ (list
+ (flycheck-verification-result-new
+ :label "configuration available"
+ :message (if have-config "yes" "no config file found")
+ :face (if have-config 'success '(bold error)))
+ (flycheck-verification-result-new
+ :label "stylecheck version"
+ :message (number-to-string (flycheck--stylelint-get-major-version
checker))
+ :face 'success))))
+
(flycheck-define-checker css-stylelint
"A CSS syntax and style checker using stylelint.
@@ -12022,35 +12051,6 @@ See URL `https://github.com/brigade/scss-lint'."
'(bold error)
'success)))))))
-(defun flycheck--stylelint-config-exists-p (checker)
- "Whether there is a valid stylelint config for the current buffer."
- (eql 0 (flycheck-call-checker-process
- checker nil nil nil
- "--print-config" (or buffer-file-name "index.js"))))
-
-(defun flycheck--stylelint-verify (checker)
- "Verify stylelint setup for CHECKER."
- (let ((have-config (flycheck--stylelint-config-exists-p checker)))
- (list
- (flycheck-verification-result-new
- :label "configuration available"
- :message (if have-config "yes" "no config file found")
- :face (if have-config 'success '(bold error)))
- (flycheck-verification-result-new
- :label "stylecheck version"
- :message (number-to-string (flycheck--stylelint-get-major-version
checker))
- :face 'success))))
-
-(defun flycheck--stylelint-get-major-version (checker)
- "Return major version of stylelint."
- (let ((cb (current-buffer)))
- (with-temp-buffer
- (let ((temp-buffer (current-buffer)))
- (with-current-buffer cb
- (flycheck-call-checker-process
- checker nil temp-buffer nil "--version"))
- (string-to-number (car (split-string (buffer-string) "\\.")))))))
-
(flycheck-define-checker scss-stylelint
"A SCSS syntax and style checker using stylelint.
- [nongnu] elpa/flycheck updated (79d20bf37a -> bf11b2a3eb), ELPA Syncer, 2024/03/17
- [nongnu] elpa/flycheck 0c8de6de03 5/6: Reorganize flycheck--stylelints to be above all stylelint checkers,
ELPA Syncer <=
- [nongnu] elpa/flycheck bf11b2a3eb 6/6: Add changelog entry, ELPA Syncer, 2024/03/17
- [nongnu] elpa/flycheck ab0c69d10e 1/6: fix(stylelint): stylelint v14 uses incompatible cli arguments, ELPA Syncer, 2024/03/17
- [nongnu] elpa/flycheck a0944f17d6 2/6: feat(stylelint): add verify setup for stylelint, ELPA Syncer, 2024/03/17
- [nongnu] elpa/flycheck 85a8cb133f 4/6: Switch new functions to use Emacs private function prefix, ELPA Syncer, 2024/03/17
- [nongnu] elpa/flycheck c51775592a 3/6: fix(stylelint): remove support for older versions of stylelint, ELPA Syncer, 2024/03/17