Class: CodeFormatter::SwiftLintFormatter
- Inherits:
-
Formatter
- Object
- Formatter
- CodeFormatter::SwiftLintFormatter
show all
- Defined in:
- lib/code_formatter/formatters/swift_lint_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
20
21
22
|
# File 'lib/code_formatter/formatters/swift_lint_formatter.rb', line 20
def files_filter
"'*.swift'"
end
|
9
10
11
12
13
14
|
# File 'lib/code_formatter/formatters/swift_lint_formatter.rb', line 9
def format_files(_)
create_config do |file|
system("swiftlint autocorrect --path #{path} --config #{file.path}")
system("swiftlint --path #{path} --config #{file.path}")
end
end
|
#shell_command ⇒ Object
16
17
18
|
# File 'lib/code_formatter/formatters/swift_lint_formatter.rb', line 16
def shell_command
'swiftlint'
end
|