Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustfmt.toml in Windows cannot apply #4983

Closed
hungpham3112 opened this issue Sep 8, 2021 · 6 comments
Closed

rustfmt.toml in Windows cannot apply #4983

hungpham3112 opened this issue Sep 8, 2021 · 6 comments
Labels
needs-mcve needs a Minimal Complete and Verifiable Example

Comments

@hungpham3112
Copy link

Version: 1.4.37
OS: Window 10
IDE: Vim 8.2

I put my custom rustfmt.toml in my project, beside Cargo.toml but rustfmt still use the default.

I try to put it in %Appdata%/rustfmt but didn't work.

@calebcartwright calebcartwright added the needs-mcve needs a Minimal Complete and Verifiable Example label Sep 9, 2021
@calebcartwright
Copy link
Member

Thanks for reaching out, but there's not enough information here for this to be actionable. Could you please provide an example repo or some precise steps to reproduce?

@hungpham3112
Copy link
Author

The first step I put directly in my repo, didn't work.

image

Then I try to put it in C:\Users\MyPC\AppData\Roaming\rustfmt

bandicam 2021-09-10 08-20-46-021

@calebcartwright
Copy link
Member

I appreciate your follow up message, but that doesn't actually address my prior ask. We'll need you to be able to provide a reproducible example. You can do this by creating a minimal GitHub repo that contains the config file and at least one source file which contains code that would be reformatted based on that config, or at a minimum, you need to share the contents of your rustfmt config file and explain specifically what you mean by "not working"

@hungpham3112
Copy link
Author

Sorry about my answer. I will try to provide good information. Here is my rustfmt.toml:

max_width = 120                                                                                                           
hard_tabs = false
tab_spaces = 4
newline_style = "Auto"
indent_style = "Block"
use_small_heuristics = "Default"
fn_call_width = 60
attr_fn_like_width = 70
struct_lit_width = 18
struct_variant_width = 35
array_width = 60
chain_width = 80
single_line_if_else_max_width = 50
wrap_comments = true
format_code_in_doc_comments = true
comment_width = 80
normalize_comments = false
normalize_doc_attributes = false
license_template_path = ""
format_strings = true
format_macro_matchers = false
format_macro_bodies = true
empty_item_single_line = true
struct_lit_single_line = true
fn_single_line = true
where_single_line = false
imports_indent = "Block"
imports_layout = "HorizontalVertical"
imports_granularity = "Preserve"
group_imports = "StdExternalCrate"
reorder_imports = true
reorder_modules = true
reorder_impl_items = false
type_punctuation_density = "Wide"
space_before_colon = false
space_after_colon = true
spaces_around_ranges = false
binop_separator = "Front"
remove_nested_parens = true
combine_control_expr = false
overflow_delimited_expr = false
struct_field_align_threshold = 40
enum_discrim_align_threshold = 40
match_arm_blocks = true
match_arm_leading_pipes = "Never"
force_multiline_blocks = false
fn_args_layout = "Tall"
brace_style = "SameLineWhere"
control_brace_style = "AlwaysSameLine"
trailing_semicolon = true
trailing_comma = "Vertical"
match_block_trailing_comma = false
blank_lines_upper_bound = 1
blank_lines_lower_bound = 1
edition = "2021"
version = "One"
inline_attribute_width = 0
merge_derives = true
use_try_shorthand = false
use_field_init_shorthand = false
force_explicit_abi = true
condense_wildcard_suffixes = true
color = "Always"
required_version = "1.4.37"
unstable_features = false
disable_all_formatting = false
skip_children = false
hide_parse_errors = false
error_on_line_overflow = false
error_on_unformatted = false
report_todo = "Always"
report_fixme = "Always"
ignore = []
emit_mode = "Files"
make_backup = false
unstable_features = true

It didn't working, I mean you can see in here I have wrap_comments = true so that when I use rustfmt it would be wrap the long comment but it didn't do as I expected

@calebcartwright
Copy link
Member

Sorry about my answer. I will try to provide good information.

That's quite alright, no worries! The challenge is that there's not much we can help with if there's not enough information, and while your rustfmt config file is a good first step, we unfortunately still don't have enough information (notably, your actual Rust code) that can be used to test/reproduce the issue.

Whenever you get a chance, please provide a complete set of information that would allow me or someone else to try to reproduce the scenario you are describing. At the moment it is still too vague to be actionable, and we can't do anything about it until you provide a sufficient amount of information.

@calebcartwright
Copy link
Member

Going to close given insufficient data. If this is still something you're encountering feel free to re-open/comment with the complete steps to reproduce and we'll take a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-mcve needs a Minimal Complete and Verifiable Example
Projects
None yet
Development

No branches or pull requests

2 participants