0.4.0: indentation issues
See original GitHub issueUsing 0.4.0 I tested one of our XML files.
Settings:
tabWidth: 4
printWidth: 120
Before:
<core:FragmentDefinition
xmlns:core="sap.ui.core"
xmlns:m="sap.m"
xmlns:dev="sap.ead.c4s.ui.view.control"
xmlns:devEl="sap.ead.c4s.ui.view.element"
xmlns="http://www.w3.org/1999/xhtml">
<m:VBox
renderType="Bare"
items="{
path: 'contextMenu>/Info/Context',
templateShareable: false
}">
<dev:SmallBreadcrumbs
items="{
path: 'contextMenu>',
templateShareable: false
}">
<dev:items>
<devEl:SmallBreadcrumbItem depth="{contextMenu>depth}">
<m:HBox renderType="Bare">
<m:HBox renderType="Bare">
<dev:DataExplorerIcon
explorerType="{contextMenu>DataExplorerType}"
explorerSubType="{contextMenu>DataExplorerSubType}"/>
<m:Label
text="{
path: 'contextMenu>',
formatter: '._navigationPathTitleFormatter'
}"
class="c4sSmallTileHeaderTitle"/>
</m:HBox>
</m:HBox>
</devEl:SmallBreadcrumbItem>
</dev:items>
</dev:SmallBreadcrumbs>
</m:VBox>
</core:FragmentDefinition>
After:
<core:FragmentDefinition
xmlns:core="sap.ui.core"
xmlns:m="sap.m"
xmlns:dev="sap.ead.c4s.ui.view.control"
xmlns:devEl="sap.ead.c4s.ui.view.element"
xmlns="http://www.w3.org/1999/xhtml"
>
<m:VBox renderType="Bare" items="{
path: 'contextMenu>/Info/Context',
templateShareable: false
}">
<dev:SmallBreadcrumbs items="{
path: 'contextMenu>',
templateShareable: false
}">
<dev:items>
<devEl:SmallBreadcrumbItem depth="{contextMenu>depth}">
<m:HBox renderType="Bare">
<m:HBox renderType="Bare">
<dev:DataExplorerIcon
explorerType="{contextMenu>DataExplorerType}"
explorerSubType="{contextMenu>DataExplorerSubType}"
/>
<m:Label
text="{
path: 'contextMenu>',
formatter: '._navigationPathTitleFormatter'
}"
class="c4sSmallTileHeaderTitle"
/>
</m:HBox>
</m:HBox>
</devEl:SmallBreadcrumbItem>
</dev:items>
</dev:SmallBreadcrumbs>
</m:VBox>
</core:FragmentDefinition>
Perceived issues:
- Starting in line 8, a
tabWidth
of 2 seems to be used. - Surprisingly high indentations in lines 21 - 23, 25, 29, 30.
Issue Analytics
- State:
- Created 4 years ago
- Comments:22 (14 by maintainers)
Top Results From Across the Web
python 3.x - Confusing indentation issue - Stack Overflow
As the error says, your file is inconsistently uses tabs and spaces. The whole file has to consistently use the same one. –...
Read more >Indent the first line of a paragraph - Microsoft Support
Select Format, and then choose Paragraph. On the Indents and Spacing tab, under Indentation, select First line. Select OK. Select OK again.
Read more >Optional Braces - Scala 3 - EPFL
It is an error if the indentation width of some line is incomparable with the indentation width of the region that's current at...
Read more >How to fix indentation Error in Python - Numpy Ninja
The indentation error can occur when the spaces or tabs are not placed properly. There will not be an issue if the interpreter...
Read more >indent-checker - npm Package Health Analysis - Snyk
Learn more about indent-checker: package health score, popularity, security, maintenance, versions and more. ... No known security issues ... 0.4.0.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Okay, I think what I’d like to go with is creating an
--xml-whitespace-sensitivity
option that hasignore
,strict
, andsmart
(or something like that. The first two are obviously far easier to implement (the last one requires a lot of knowledge about the schema and elements, I’m very interested in implementing it, but not as a first pass).@thorn0 I don’t think there is anything wrong with the HTML parser. To quickly show what I meant see here.
It is XML with a given default namespace and a
Title
tag inside that namespace. The HTML parser throws an error because it assumes this is theTitle
of HTML (that’s my guess at least). From my point of view that is okay because my content is not HTML but XML.I liked your comment because it showed the effect that a whitespace option could have for our XML.