realm / realm/SwiftLint

Rule Request: Function signatures enforce consistent spacing.

Open
#2,772 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

rule-request
Dominant language
Swift
Stars
19.7k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
11

Description

New Issue Checklist
New rule request
  1. Why should this rule be added?
  • Consistent function signatures.

  • Provide warnings when style is not met.

  1. Provide several examples of what would and wouldn't trigger violations.
    wouldn't trigger:
    override func viewDidLoad()

would
(whitespace)override func viewDidLoad()
override (whitespace)func viewDidLoad()
override func (whitespace)viewDidLoad()
override func viewDidLoad(whitespace)()
override(newLine) func viewDidLoad()
override func (newLine) viewDidLoad()

  1. Should the rule be configurable, if so what parameters should be configurable?
    There could be configuration to enforce number of spaces where wanted or forcing a new line return if wanted.

  2. Should the rule be opt-in or enabled by default? Why?
    See README.md for guidelines on when to mark a rule as opt-in.
    I would like it to be enabled by default. This enforces consistent function signatures and at the very least warns the developer when they may have entered an unintended space. Most developers won't see this warning unless they make a mistake.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README.md opt-in-rules guidance and review existing SwiftLint rule conventions. Resolve the open configuration and default-versus-opt-in questions, then define behavior for the listed spacing and newline examples. Done means the rule's scope, configuration, and warning behavior are agreed and implemented with coverage for those examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.