[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode fc64626 156/496: Merge pull request #56 from ap
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode fc64626 156/496: Merge pull request #56 from ap4y/fix_flycheck_issues |
Date: |
Sun, 29 Aug 2021 11:33:27 -0400 (EDT) |
branch: elpa/swift-mode
commit fc646261630aa23f2e81933fd7cb638771623b0a
Merge: 1753f23 9c716c1
Author: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Merge pull request #56 from ap4y/fix_flycheck_issues
Fix flycheck issues
---
README.md | 8 +++++++-
swift-mode.el | 28 ++++++++++++++--------------
2 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/README.md b/README.md
index d96c4fc..edec659 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ Major-mode for Apple's [Swift programming language][swift].
Provides:
- syntax highlighting
- indentation
- code navigation with [imenu][]
-- automatic syntax checking with [flycheck][]
+- automatic syntax checking with [flycheck][] (disabled by default)
This is currently at an early stage of development and there's plenty of work
to
do. Check the issue tracker.
@@ -62,6 +62,12 @@ If you'd like to get on-the-fly syntax checking you should
install
M-x package-install flycheck
```
+And enable `flycheck` checker for `swift`:
+
+```
+(add-to-list 'flycheck-checkers 'swift)
+```
+
### Manual
You will need `make` and [Cask][] to build the project.
diff --git a/swift-mode.el b/swift-mode.el
index 452ca75..e16cf43 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -480,8 +480,9 @@
'(progn
(flycheck-def-option-var flycheck-swift-sdk-path nil swift
"A path to the targeted SDK"
- :type '(repeat (directory :tag "iOS/MacOS SDK directory"))
- :safe #'flycheck-string-list-p)
+ :type '(choice (const :tag "Don't link against sdk" nil)
+ (string :tag "Targeted SDK path"))
+ :safe #'stringp)
(flycheck-def-option-var flycheck-swift-linked-sources nil swift
"Source files path to link against. Can be glob, i.e. *.swift"
@@ -493,30 +494,29 @@
"Flycheck plugin for for Apple's Swift programming language."
:command ("swift"
"-frontend" "-parse"
- (option-list "-sdk" flycheck-swift-sdk-path)
+ (option "-sdk" flycheck-swift-sdk-path)
;; Swift compiler will complain about redeclaration
;; if we will include original file along with
;; temporary source file created by flycheck.
;; We also don't want a hidden emacs interlock files.
(eval
(let (source file)
- (setq source (flycheck-substitute-argument 'source 'swift))
- (setq file (file-name-nondirectory source))
- (remove-if-not
- #'(lambda (path)
- (and
- (eq (string-match ".#" path) nil)
- (eq (string-match file path) nil)))
- (file-expand-wildcards flycheck-swift-linked-sources))))
+ (when flycheck-swift-linked-sources
+ (setq source (car (flycheck-substitute-argument 'source
'swift)))
+ (setq file (file-name-nondirectory source))
+ (cl-remove-if-not
+ #'(lambda (path)
+ (and
+ (eq (string-match ".#" path) nil)
+ (eq (string-match file path) nil)))
+ (file-expand-wildcards
flycheck-swift-linked-sources)))))
"-primary-file" source)
:error-patterns
((error line-start (file-name) ":" line ":" column ": "
"error: " (message) line-end)
(warning line-start (file-name) ":" line ":" column ": "
"warning: " (message) line-end))
- :modes swift-mode)
-
- (add-to-list 'flycheck-checkers 'swift)))
+ :modes swift-mode)))
;;; REPL
- [nongnu] elpa/swift-mode 7ea5f66 059/496: Fix markdown formatting typo, (continued)
- [nongnu] elpa/swift-mode 7ea5f66 059/496: Fix markdown formatting typo, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode cd0aa34 072/496: Adding flycheck plugin for syntax check with swift cli, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 14c6bdd 079/496: Add swift repl commands to mode map, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 1dfb1a5 110/496: Add indent rules for function declaration with attributes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 1a1d81c 125/496: Improve font-lock regex for string interpolation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 4059bc1 135/496: Add dot(.) to the allowed symbols inside string interpolation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 88a83ad 145/496: Apply DECSPEC token class only for functions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode fc009b5 069/496: Add font locking for indentation tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode ae32a8b 071/496: Add basic imenu support, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode d02e2dc 024/496: Update contributors, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode fc64626 156/496: Merge pull request #56 from ap4y/fix_flycheck_issues,
ELPA Syncer <=
- [nongnu] elpa/swift-mode 9cf667c 159/496: Start work on 0.4, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode cba4538 161/496: Merge pull request #61 from ckruse/fix_55, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 5611c0f 164/496: Updated syntax: a lot of attributes moved to keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 250e8e4 172/496: Merge pull request #67 from jmibanez/fix-flycheck-and-byte-compilation-bug, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode a6267eb 189/496: Improve indentation for the function definitions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 782378c 214/496: Correct regex in lexer for the "default" keyword, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode c38b721 216/496: Support default values for arguments in function declaration, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 2cb54c9 222/496: Make grammar for if statement a bit more precise, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b6bad10 225/496: Set minimum required version to 24.4, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 4a27477 230/496: Merge pull request #89 from uk-ar/fix-indent-in-trailing-closure, ELPA Syncer, 2021/08/29