Commit Graph
27 Commits
Author SHA1 Message Date
Martin Redington 7623f1e730 Enable more rules in SwiftLint's own .swiftlint.yml (#5532) 2024-04-27 18:43:08 +02:00
Danny Mösch efddde68ac Allow to configure more operators in identifier_name rule (#5362) 2023-11-19 15:59:54 +01:00
Danny Mösch 09d1ef9d1d Harmonize violation positions (#5360)
Marks the violating identifiers directly.
2023-11-19 13:51:53 +01:00
Danny Mösch eab0af851c Rewrite identifier_name rule with SwiftSyntax (#5354) 2023-11-19 12:47:41 +01:00
JP Simard 6e3bfc1a45 Fix more strict concurrency warnings (#5324)
These aren't enough to enable `-strict-concurrency=complete` for more
modules, but they address some warnings with that flag on and reduces
the scope of what remains to be migrated.
2023-11-01 12:41:54 -04:00
Danny Mösch f5ea2492dc Merge allowed symbols with alphanumerics where possible 2023-06-18 12:01:28 +02:00
JP Simard a7bc9e20c7 Move built-in rules to new SwiftLintBuiltInRules module (#4950) 2023-04-27 11:16:01 -04:00
JP Simard 4c04cdafa7 Introduce SwiftLintTestCase
To consistently set up rules before tests
2023-04-25 12:28:50 -04:00
kyounh12 5ec6112ba1 Interpret strings in excluded option of *_name rules as regex (#4655) 2023-01-10 23:29:04 +01:00
JP Simard 4bd7da32ea Reduce visibility of rules to be internal (#4533)
There's no reason to expose these publicly and this will make it nicer
to move to a new module outside of the core SwiftLint functionality.
2022-11-09 11:01:26 -05:00
Chris Brakebill 9db303e3a3 Respect 'validates_start_with_lowercase' for function names in identifier_name rule (#4188) 2022-09-09 23:36:55 +02:00
Danny Mösch c1b74cd752 Rename test classes (#4083) 2022-08-11 07:33:11 +02:00
Danny Mösch d730e0b3fa Let all example verification tests be generated by Sourcery (#4076) 2022-08-10 22:49:28 +02:00
JP Simard d628c41665 [IdentifierNameRule] Allow "allowed symbols" as first character (#3403)
This means that if `allowed_symbols` contains `_`, you can now write
identifiers like `let _myLet`.

Fixes https://github.com/realm/SwiftLint/issues/3306
2020-11-07 09:54:04 -08:00
Zev Eisenberg fcf848608e Add Inline test failure messages (#3040)
* Add Example wrapper in order to display test failures inline when running in Xcode.
* Stop using Swift 5.1-only features so we can compile on Xcode 10.2.
* Wrap strings in Example.
* Add Changelog entry.
* Wrap all examples in Example struct.
* Better and more complete capturing of line numbers.
* Fix broken test.
* Better test traceability.
* Address or disable linting warnings.
* Add documentation comments.
* Disable linter for a few cases.
* Limit mutability and add copy-and-mutate utility functions.
* Limit scope of mutability.
2020-02-02 10:35:37 +02:00
JP Simard 0e862ca9c4 Enable vertical whitespace rules in SwiftLint
and fix violations
2018-12-02 14:01:23 -08: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
Cyril Lashkevich 9983be7cfe Added unittest with surogate character 2018-03-11 13:30:51 +01:00
Marcelo Fabri 06f9d4c0f7 Fix false negatives when using allowed_symbols 2017-09-30 00:50:30 -03:00
Marcelo Fabri 63e95a22c5 Refactoring tests that create RuleDescriptions 2017-07-02 17:10:26 +02:00
Marcelo Fabri e86763739f Move kind to RuleDescription 2017-07-02 15:50:16 +02:00
Marcelo Fabri 102bca6155 Use validates_start_with_lowercase key on NameConfiguration
Fixes #1626
2017-06-18 20:13:31 +02:00
JP Simard 25a92c4e03 automatically generate LinuxMain.swift using Sourcery
This adds 6 tests that were accidentally not being run on Linux:

* LineLengthConfigurationTests.testLineLengthConfigurationInitialiserSetsIgnoresComments
* LineLengthConfigurationTests.testLineLengthConfigurationInitialiserSetsIgnoresFunctionDeclarations
* LineLengthConfigurationTests.testLineLengthConfigurationThrowsOnBadConfigValues
* LineLengthRuleTests.testLineLengthWithIgnoreCommentsEnabled
* LineLengthRuleTests.testLineLengthWithIgnoreFunctionDeclarationsEnabled
* RegionTests.testSeveralRegionsFromSeveralCommands
2017-06-02 14:28:37 -07:00
Javier Hernández d652cfe4ab Add options to generic_type_name and type_name rules 2017-05-10 21:02:30 +01:00
Javier Hernández 9d31eaccda Rename option to validates_start_lowercase 2017-05-10 20:53:44 +01:00
Javier Hernández fe916c121f Add option to allow names to start with uppercase 2017-05-10 20:53:44 +01:00
Javier Hernández 93583f3153 Add option to exclude non alphanumeric characters 2017-05-10 20:53:42 +01:00