Skip to content

fix: xml formatting matches the pretty-print lxml setting #219

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

Draft
wants to merge 1 commit into
base: v7.7
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,10 @@ repos:
types: ["dockerfile"]
entry: hadolint/hadolint:2.11.0 hadolint

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
- repo: https://github.com/GlodoUK/pre-commit-xmllint
rev: b9281d1cf34246ed43f2dd2634b855d04d06cb80
hooks:
# Use Prettier to lint XML files because, well.. its rules are prettier than most linters, as the name implies.
# Also we use it in the UI, so it's familiar.
Comment on lines 84 to 85
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outdated comment

- id: prettier
additional_dependencies:
- "[email protected]"
- "@prettier/[email protected]"
- id: lxml-format
files: \.(xml)$
2 changes: 1 addition & 1 deletion src/example_behaviors/config/tree_nodes_model.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version='1.0' encoding='utf-8'?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An inconsistency is being introduced in quote style, specifically in XML prologues. Let's hunt this down

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like https://github.com/efrecon/pre-commit-hook-lxml?tab=readme-ov-file#cli-options can configure the declaration to use double quotes.

<root>
<TreeNodesModel>
<!-- Include additional SubTree metadata in this file. -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version='1.0' encoding='utf-8'?>
<library path="example_behaviors">
<class
type="example_behaviors::ExampleBehaviorsLoader"
base_class_type="moveit_studio::behaviors::SharedResourcesNodeLoaderBase"
/>
<class type="example_behaviors::ExampleBehaviorsLoader" base_class_type="moveit_studio::behaviors::SharedResourcesNodeLoaderBase"/>
</library>
2 changes: 1 addition & 1 deletion src/example_behaviors/package.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version='1.0' encoding='utf-8'?>
<package format="3">
<name>example_behaviors</name>
<version>6.5.0</version>
Expand Down
Loading