bhartsfield
06/12/2023, 6:16 PMEvil Ware
06/12/2023, 6:28 PMbhartsfield
06/12/2023, 6:30 PMbhartsfield
06/12/2023, 6:30 PMEvil Ware
06/12/2023, 6:30 PMbhartsfield
06/12/2023, 6:32 PMbhartsfield
06/12/2023, 6:32 PMEvil Ware
06/12/2023, 6:33 PMbhartsfield
06/12/2023, 6:34 PMEvil Ware
06/12/2023, 6:40 PMbhartsfield
06/12/2023, 6:42 PMbhartsfield
06/12/2023, 6:44 PMbhartsfield
06/12/2023, 6:45 PMEvil Ware
06/12/2023, 6:47 PMbhartsfield
06/12/2023, 6:49 PMbhartsfield
06/12/2023, 6:52 PMEvil Ware
06/12/2023, 6:52 PMbhartsfield
06/12/2023, 6:53 PMbhartsfield
06/12/2023, 6:56 PMEvil Ware
06/12/2023, 6:57 PMbhartsfield
06/12/2023, 6:59 PMEvil Ware
06/12/2023, 7:09 PMjcberquist
06/12/2023, 8:06 PMtab_indent setting gets everything to work? I would not expect that setting to cause differences between Windows and Linux. My first thought would definitely be line endings, so I would start by checking that. The newline setting in .cfformat.json is set to os by default which means it uses \n on linux and mac, and \r\n on windows. Depending on how you have set up your git repository, this can cause issues when comparing formatting.bhartsfield
06/12/2023, 8:12 PMbhartsfield
06/12/2023, 8:15 PMbhartsfield
06/12/2023, 8:37 PMbhartsfield
06/12/2023, 8:38 PMbhartsfield
06/12/2023, 8:43 PMfmt --check ./component spits out. It thinks the the tab should be 8 spaces.jcberquist
06/12/2023, 8:45 PMjcberquist
06/12/2023, 8:47 PMtab_indent set to true so I am not sure what would be causing that.bhartsfield
06/12/2023, 8:48 PMbhartsfield
06/12/2023, 8:48 PMjcberquist
06/12/2023, 8:50 PM--verbose?bhartsfield
06/12/2023, 8:52 PMbhartsfield
06/12/2023, 8:53 PMjcberquist
06/12/2023, 8:56 PM.cfformat.json file relative to the component? Possibly it isn't picking up that file and is using the cfformat defaults?bhartsfield
06/12/2023, 10:52 PMjcberquist
06/12/2023, 11:29 PMtestformat directory, I would expect the newlines to be set to \n as you haven't (in that simple example) overwritten the newline setting in .cfformat.json. Is there any other .cfformat.json file at play when you ran that? You can verify the actual settings used by running cfformat settings show in that directory, and it should show you the full set of settings used, and the setting files it used.bhartsfield
06/13/2023, 12:30 PM/github/workspace/app/.cfformat.json
{
"alignment.consecutive.assignments":true,
"alignment.consecutive.params":true,
"alignment.consecutive.properties":true,
"alignment.doc_comments":false,
"array.empty_padding":false,
"array.multiline.comma_dangle":false,
"array.multiline.element_count":2,
"array.multiline.leading_comma":false,
"array.multiline.leading_comma.padding":true,
"array.multiline.min_length":50,
"array.padding":true,
"binary_operators.newline_indent":false,
"binary_operators.padding":true,
"brackets.padding":false,
"comment.asterisks":"align",
"for_loop_semicolons.padding":true,
"function_anonymous.empty_padding":false,
"function_anonymous.group_to_block_spacing":"compact",
"function_anonymous.multiline.comma_dangle":false,
"function_anonymous.multiline.element_count":3,
"function_anonymous.multiline.leading_comma":false,
"function_anonymous.multiline.leading_comma.padding":true,
"function_anonymous.multiline.min_length":50,
"function_anonymous.padding":true,
"function_anonymous.spacing_to_group":false,
"function_call.casing.builtin":"cfdocs",
"function_call.casing.userdefined":"camel",
"function_call.empty_padding":false,
"function_call.multiline.comma_dangle":false,
"function_call.multiline.element_count":4,
"function_call.multiline.leading_comma":false,
"function_call.multiline.leading_comma.padding":true,
"function_call.multiline.min_length":150,
"function_call.padding":true,
"function_declaration.empty_padding":false,
"function_declaration.group_to_block_spacing":"compact",
"function_declaration.multiline.comma_dangle":false,
"function_declaration.multiline.element_count":3,
"function_declaration.multiline.leading_comma":false,
"function_declaration.multiline.leading_comma.padding":true,
"function_declaration.multiline.min_length":50,
"function_declaration.padding":true,
"function_declaration.spacing_to_group":false,
"indent_size":4,
"keywords.block_to_keyword_spacing":"spaced",
"keywords.empty_group_spacing":false,
"keywords.group_to_block_spacing":"spaced",
"keywords.padding_inside_group":true,
"keywords.spacing_to_block":"spaced",
"keywords.spacing_to_group":true,
"max_columns":150,
"metadata.key_value.padding":false,
"metadata.multiline.element_count":5,
"metadata.multiline.min_length":50,
"method_call.chain.multiline":4,
"newline":"\r\n",
"param.key_value.padding":false,
"param.multiline.element_count":4,
"param.multiline.min_length":40,
"parentheses.padding":true,
"property.key_value.padding":false,
"property.multiline.element_count":5,
"property.multiline.min_length":30,
"strings.attributes.quote":"double",
"strings.convertNestedQuotes":true,
"strings.quote":"double",
"struct.empty_padding":false,
"struct.multiline.comma_dangle":false,
"struct.multiline.element_count":5,
"struct.multiline.leading_comma":false,
"struct.multiline.leading_comma.padding":true,
"struct.multiline.min_length":60,
"struct.padding":true,
"struct.quote_keys":true,
"struct.separator":": ",
"tab_indent":true,
"tags.lowercase":true
}bhartsfield
06/13/2023, 12:30 PMbhartsfield
06/13/2023, 12:37 PMbhartsfield
06/13/2023, 12:38 PMbhartsfield
06/13/2023, 12:39 PMbhartsfield
06/13/2023, 12:57 PMjcberquist
06/13/2023, 6:29 PMbhartsfield
06/13/2023, 8:13 PMbhartsfield
06/13/2023, 8:13 PMjcberquist
06/13/2023, 8:37 PM.cfformat.json file that only changes the tab_indent setting. Then you are cfformat check ing that via WSL, and via PowerShell on Windows. Am I misunderstanding your simplified test? If my understanding is correct, then the default newline setting of os is active, and so I would expect either the WSL or the Windows check to fail, depending on which line endings the file actually has.
Setting the newline to "os" and formatting lets WSL verify all files but powershell fails them all. Setting it to \n lets both validate all files. Starting to look like that's what I'm, going to have to doIf you set the newline to "os" you aren't actually changing things from the default - formatting the file via WSL will change the file endings to
\n at which point a subsequent check will of course pass on linux and fail on windows. If you change the newline setting to \n at this point, the check will pass on windows as that would be the line ending actually in use in the file after a cfformat run via WSL.
Is there something in your simplified test scenario that I have wrong in the above?bhartsfield
06/14/2023, 1:22 PM