Skip to content
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

Rule Request: Vertical Parameter Alignment #1033

Closed
jpsim opened this issue Dec 22, 2016 · 4 comments
Closed

Rule Request: Vertical Parameter Alignment #1033

jpsim opened this issue Dec 22, 2016 · 4 comments
Labels
rule-request Requests for a new rules.

Comments

@jpsim
Copy link
Collaborator

jpsim commented Dec 22, 2016

When refactoring, it's often very easy to mess up the vertical alignment of parameters in function declarations and calls:

func validateFunction(_ file: File, kind: SwiftDeclarationKind,
                    dictionary: [String: SourceKitRepresentable]) -> [StyleViolation] {

We could (easily?) have a correctable rule for this.

@shoumikhin
Copy link

Does this rule apply to closure argument args? Eg:

func openConversations(completion: @escaping (_ records: [Conversation]?,
                                              _ error: NSError?) -> Void) {

Produces:
warning: Vertical Parameter Alignment Violation: Function parameters should be aligned vertically if they're in multiple lines in a declaration. (vertical_parameter_alignment)

@nicolasmiari-unext
Copy link

I'm not able to ignore this rule somehow. My config file is working (other rules like line_length: are observed); however this has no effect:

disabled_rules:
  - vertical_parameter_alignment

Also, class_delegate_protocol and weak_delegate can't be disabled either?

@jpsim
Copy link
Collaborator Author

jpsim commented Apr 11, 2017

@shoumikhin no.

@nicolasmiari-unext can you please file a new issue with specific steps to reproduce? Something along the lines of #368 (comment)

@nicolasmiari-unext
Copy link

nicolasmiari-unext commented Apr 11, 2017

There must be something wrong with my project; I created a new one (from single iOS/View Application) and can't reproduce... Will report back if I find something.


My project's source files are divided into an app target and a framework target that the app depends on. The directory structure is:

  - AppName/
    - AppName.xcodeproj
    - AppName/ 
        (app target sources)
    - FrameworkName/ 
        (framework target sources)
    - .swiftlint.yml

(No workspace file)

Somehow, the config file does not work with the sources under the FrameworkName/ directory...?
Even though both AppName/ and FrameworkName/ are "on the same footing", tree-wise, from where .swiftlint.yml is located...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule-request Requests for a new rules.
Projects
None yet
Development

No branches or pull requests

3 participants