Rule Request: Function signatures enforce consistent spacing.
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 19.7k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
Description
New Issue Checklist
- Updated SwiftLint to the latest version
- I searched for existing GitHub issues
New rule request
- Why should this rule be added?
-
Consistent function signatures.
-
Provide warnings when style is not met.
- 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()
-
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. -
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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