Skip to content

Latest commit

 

History

History

swayfmt

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

swayfmt

A tool for formatting Sway code according to style guidelines.

Quickstart

Configuration with swayfmt.toml

Swayfmt is meant to be configurable, however currently it only supports the default configuration options.

Note: Not all Config options are guaranteed to work and most are not implemented. Configuration options are subject to change between versions without notice. If you would like to see a feature implemented, or implement a feature please refer to the CONTRIBUTING guide.

The default swayfmt.toml:

max_width = 100
hard_tabs = false
tab_spaces = 4
newline_style = Auto
indent_style = Block
newline_threshold = 1
group_imports = Preserve
imports_granularity = Preserve
imports_indent = Block
reorder_imports = true
reorder_modules = true
reorder_impl_items = false
item_brace_style = SameLineWhere
blank_lines_upper_bound = 1
blank_lines_lower_bound = 0
empty_item_single_line = true
format_strings = false
hex_literal_case = Preserve
expr_brace_style = AlwaysSameLine
trailing_semicolon = true
space_before_colon = false
space_after_colon = false
type_combinator_layout = Wide
spaces_around_ranges = false
match_block_trailing_comma = false
match_arm_leading_pipe = Never
force_multiline_blocks = false
fn_args_layout = Tall
fn_single_line = false
heuristics_pref = Scaled
use_small_heuristics = true
field_alignment = Off
small_structures_single_line = true
wrap_comments = false
comment_width = 80
normalize_comments = false