Class: CodeFormatter::ClangFormatFormatter
- Inherits:
-
Formatter
- Object
- Formatter
- CodeFormatter::ClangFormatFormatter
show all
- Defined in:
- lib/code_formatter/formatters/clang_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
16
17
18
|
# File 'lib/code_formatter/formatters/clang_format_formatter.rb', line 16
def files_filter
"'*.h' '*.m' '*.mm' '*.c' '*.cpp'"
end
|
8
9
10
|
# File 'lib/code_formatter/formatters/clang_format_formatter.rb', line 8
def format_files(files)
`clang-format -i -style="#{style_dump}" #{files.join(' ')}`
end
|
#shell_command ⇒ Object
12
13
14
|
# File 'lib/code_formatter/formatters/clang_format_formatter.rb', line 12
def shell_command
'clang-format'
end
|