Commit Graph

173 Commits

Author SHA1 Message Date
JP Simard 1f9a0017e6 Refactor a rule disable command 2018-08-06 14:26:17 -07:00
JP Simard 3961d6482b Organize rules by kind in Xcode project (#2341) 2018-08-05 18:54:05 -07:00
Marcelo Fabri 88f4c8be6f Minor changes after merging #2318 2018-07-30 00:12:02 -07:00
Marcelo Fabri f7f3f3dee5 Merge pull request #2318 from mattremmel/nef10_missing_docs
Added back 'missing_docs' (Nef10)
2018-07-30 00:05:05 -07:00
Cihat Gündüz b4f960bd48 Add config option allow_redundancy 2018-07-27 11:12:46 +02:00
Matthew Remmel 89adc4224c Patch created from Nef10 (https://github.com/Nef10/SwiftLint.git) missing_docs branch, to remove merge commits that were preventing merging the PR (https://github.com/realm/SwiftLint/pull/2172) 2018-07-25 11:34:53 -04:00
Keith Smiley 6eedf5d73c Add private_only to prefixed_toplevel_constant (#2315)
* Add private_only to prefixed_toplevel_constant

This allows users to opt in to only validate top level constants have
the given prefix if the constant is private or fileprivate.
2018-07-24 12:38:01 -07:00
Marcelo Fabri 8a686dac2a Merge pull request #2310 from Dschee/file-name
Add options `prefix_pattern` and `suffix_pattern` to `file_name` rule
2018-07-24 09:46:28 -07:00
Cihat Gündüz bacc3ddaca Add default suffixPattern value directly in configuration initalizer 2018-07-24 17:34:17 +02:00
Cihat Gündüz c02dd17155 Add prefix_pattern and suffix_pattern options to file_name rule 2018-07-24 16:35:38 +02:00
Cihat Gündüz 51a9a62159 Add if_only option to rule conditional_returns_on_newline 2018-07-23 10:22:28 +02:00
Anders Hasselqvist 1efb78ef25 Fix unnecessary oss-check diff reports
Other minor improvements based on review feedback.
2018-06-14 00:48:14 +09:00
Anders Hasselqvist 2fee6db032 Support file placeholder with required/forbidden_string 2018-06-13 20:05:02 +09:00
Anders Hasselqvist 58202772d3 Support placeholder for forbidden_pattern
- Move regex creation for *_pattern to FileHeaderConfiguration
- Switch to using test fixures for the tests
2018-06-13 19:55:27 +09:00
Anders Hasselqvist 15af1a778f Add file name matching to file_header rule
Add support of inserting a SWIFTLINT_CURRENT_FILENAME placeholder in the required_pattern.
The placeholder will be replaced by the lastPathComponent of the file's path.
2018-06-13 19:55:27 +09:00
JP Simard ed04e75c8a Fix indentation 2018-05-11 23:01:16 -07:00
JP Simard 84bfdca774 Enable File Name rule for SwiftLint & fix violations 2018-05-11 22:17:40 -07:00
JP Simard 24ec44d288 Add file_name opt-in rule
validating that file names contain the name of a
type or extension declared in the file (if any).
2018-05-11 22:17:39 -07:00
Varun P M 794160a8d2 Added ignores_default_parameters when calculating parameter count 2018-05-10 17:40:30 +05:30
Eric Horacek d21b787980 Make closure end indentation rule correctable 2018-05-08 21:00:19 -07:00
freak4pc 4d3a1173b6 Apply correct severity form configuration 2018-05-06 23:34:14 +03:00
freak4pc d429ad4358 Get rid of duplicated RuleConfiguration and use reason instead 2018-05-06 23:34:14 +03:00
freak4pc 62d0dd14ca Remove headers 2018-05-06 23:34:14 +03:00
freak4pc 7809ac731a Add specific violation reason for switch_case_alignment based on configuration. 2018-05-06 23:34:14 +03:00
freak4pc 8e0202cfc8 Added violation marker and fixed tests 2018-05-06 23:34:14 +03:00
freak4pc 9cc41ac9cf Switched to indented_cases bool style 2018-05-06 23:34:14 +03:00
freak4pc e8b64b4a72 Add indentation to SwitchCaseAlignmentRule 2018-05-06 23:34:13 +03:00
JP Simard c5de0f481f Refactor LineLengthConfiguration.apply(configuration:)
to avoid high cyclomatic complexity
2018-05-06 10:54:46 -07:00
Michael Gray ac9b5348e1 Added "ignores_interpolated_strings" option to line_length (default value is false) 2018-05-06 10:41:15 -07:00
JP Simard 6ff33e675b Refactor 2018-05-05 16:24:54 -07:00
JP Simard 22a6187553 Merge branch 'master' into attibute_and_modifier_order
* master:
  Remove all file headers
  Make fallthrough rule opt-in
  Update the swift file and run the unit tests
  Fix a typo
2018-05-05 15:25:43 -07:00
JP Simard b83e0991b9 Remove all file headers
The MIT license doesn't require that all files be prepended with this
licensing or copyright information. Realm confirmed that they're ok with this
change. This will enable some companies to contribute to SwiftLint and the
date & authorship information will remain accessible via git source control.
2018-05-04 13:42:02 -07:00
Daniel Metzing 61259692ed Removing s from rule name 2018-04-27 08:59:02 +02:00
Daniel Metzing 9a7005912a Add modifiers_order rule 2018-04-26 20:25:58 +02:00
Daniel Metzing 1ec1fef998 Fixing project file after merge 2018-04-10 23:18:46 +02:00
Daniel Metzing cf64c0873b Merge branch 'attibute_and_modifier_order' into upstream_master
# Conflicts:
#	Cartfile
#	Cartfile.private
#	Cartfile.resolved
#	Carthage/Checkouts/SourceKitten
#	Package.resolved
#	Package.swift
#	Rules.md
#	Source/SwiftLintFramework/Extensions/Configuration+LintableFiles.swift
#	Source/SwiftLintFramework/Extensions/Dictionary+SwiftLint.swift
#	Source/SwiftLintFramework/Models/SwiftVersion.swift
#	Source/SwiftLintFramework/Rules/ModifiersOrderRule.swift
#	Source/SwiftLintFramework/Rules/RuleConfigurations/ModifiersOrderConfiguration.swift
#	SwiftLint.xcodeproj/project.pbxproj
#	Tests/SwiftLintFrameworkTests/LinterCacheTests.swift
#	Tests/SwiftLintFrameworkTests/ModifiersOrderTests.swift
#	circle.yml
2018-04-10 23:04:11 +02:00
Daniel Metzing c68a28dba5 Adding rule 2018-04-10 22:52:16 +02:00
Norio Nomura 2a0ac455bc 'flatMap' is deprecated: renamed to 'compactMap(_:)' 2018-04-08 13:28:09 +09:00
Cyril Lashkevich 10ba712748 Fix for crash on Linux on sources with surrogate characters
Because of the bug https://bugs.swift.org/browse/SR-5971 SwiftLint
crashes when linting on Linux files like https://github.com/xmartlabs/Eureka/blob/master/Example/Example/ViewController.swift
2018-03-17 19:51:24 +01:00
Daniel Metzing d02a650786 Fixing tests after rebase 2018-03-05 22:11:10 +01:00
J Cheyo Jimenez 55bd3beeff modifierOrderRule added
```
opt_in_rules:
  - modifiers_order

modifiers_order:
  before_acl: ["override"]
  after_acl: ["class"]
```
2018-03-05 22:01:46 +01:00
rounak 639522163f Improve console description for ExplicitTypeInterfaceConfiguration
Add more tests for ExplicitTypeInterface
2018-02-25 19:18:38 -08:00
rounak e515f43424 Add separate test files for ExplicitTypeInterfaceRule & Config
Respond to PR comments
2018-02-25 19:18:38 -08:00
Rounak 975bd7b86e Fix linter warnings 2018-02-25 19:18:38 -08:00
Rounak 2a7abcf542 Add new configuration for Explicit Type Interface Rule to allow exempting certain types of variables
Signed-off-by: Rounak <rounak91@gmail.com>
2018-02-25 19:18:38 -08:00
Norio Nomura 49f3d00e7b Changed incorrectly used flatMap to map 2018-02-14 19:04:55 +09:00
Norio Nomura 059ee7be94 'flatMap' is deprecated: renamed to 'compactMap(_:)' 2018-02-14 19:04:53 +09:00
Donald Ritter 1deddf2334 Adds a new rule which allows for enums that conform to protocol to
require cases.
2017-12-22 13:08:51 -05:00
JP Simard 34f429b0a3 Fix caching on Linux
This has never worked for two reasons:

1. We've used dictionaries to represent cache descriptions, which
   don't guarantee stable ordering of keys across invocations.
   This is true both on Darwin and Linux, but in practice ordering
   varies significantly more on Linux.
2. Storing a `TimeInterval` value in a `[String: Any]` dictionary
   and retrieving it again will not be dynamically castable to
   `Double` or `TimeInterval` but will be castable to `Int`.
2017-10-26 12:23:13 -07:00
Marcelo Fabri 0be8c855d2 Move functions to properties and Sets instead of Arrays 2017-10-04 14:34:00 -07:00