-
Notifications
You must be signed in to change notification settings - Fork 1
SwiftLint 0.45.1 adaptation #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,12 +107,15 @@ enum_case_associated_values_count: | |
identifier_name: | ||
excluded: | ||
- id | ||
- to | ||
- ok | ||
- URL | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SwiftLint и так не агрится на такое название, можно удалить |
||
- x | ||
- y | ||
- z | ||
|
||
opening_brace: | ||
allow_multiline_func: true | ||
Comment on lines
+116
to
+117
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ну, единственное что я могу заметить, у нас единственная ссылка на свифт код стайл гайд лежащая вот тут https://github.com/TouchInstinct/Styleguide/blob/90dfb56c398440926c60b619f83be06d5ed2337c/IOS/OnboardingGuide.md#ios-developer-onboarding-letter ведет на гайд от raywenderlich в котором сказано:
Поэтому лично мне в целом не критично конечно, но получается некоторое противоречие между линтером и предложеным кодстайлом) Так что этот момент можно было бы обсудить) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. При этом замечал, что люди часто нарушают пункт оттуда же:
Пишут так, чтобы разграничить визуально тело функции от заголовка: func foo(bar: ParameterClosure<WibbleWobbleWubble>,
baz: @escaping VoidClosure,
qux: @escaping ParameterClosure<WibbleWobbleWubble>) {
let keke = 123
let lele = 123
} Хотя это куда нагляднее выглядит: func foo(bar: ParameterClosure<WibbleWobbleWubble>,
baz: @escaping VoidClosure,
qux: @escaping ParameterClosure<WibbleWobbleWubble>)
{
let keke = 123
let lele = 123
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ещё отмечу, что правило срабатывает только в случае многострочных параметров, в остальных случаях линтер перенос убирает, т.е. такого не будет: func foo(bar: ParameterClosure<WibbleWobbleWubble>)
{
// code
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ну, вообще есть 2 путя в таком случае:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Но опять же, отмечу, стоит это обсудить, прежде чем рубить с плеча) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ну кстати, если уж си шарп стайл не зайдет, может быть есть правило, которое запретит пустую строку после открывающей скобки? |
||
|
||
warning_threshold: 1 | ||
|
||
allow_zero_lintable_files: true | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не соглашусь, с этим исключением. from и to как названия переменных не отражают типа своего содержимого.
В случае с примером
на мой взгляд лучше сделать так:
Получается понятно что за переменные и что в себе содержат.