Class: CodeFormatter::SwiftFormatFormatter
- Inherits:
-
Formatter
- Object
- Formatter
- CodeFormatter::SwiftFormatFormatter
show all
- Defined in:
- lib/code_formatter/formatters/swift_format_formatter.rb
Instance Attribute Summary
Attributes inherited from Formatter
#config, #path
Instance Method Summary
collapse
Methods inherited from Formatter
#all_files, #commands_exist?, #excluded_file?, #files_to_format, #format, #format_file?, #included_file?, #initialize, #modified_and_staged_files
Instance Method Details
#files_filter ⇒ Object
18
19
20
|
# File 'lib/code_formatter/formatters/swift_format_formatter.rb', line 18
def files_filter
"'*.swift'"
end
|
8
9
10
11
12
|
# File 'lib/code_formatter/formatters/swift_format_formatter.rb', line 8
def format_files(files)
disabled = disabled_rules.join(',')
enabled = enabled_rules.join(',')
`swiftformat #{files.join(' ')} --disable #{disabled} --enable #{enabled}`
end
|
#shell_command ⇒ Object
14
15
16
|
# File 'lib/code_formatter/formatters/swift_format_formatter.rb', line 14
def shell_command
'swiftformat'
end
|