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

Tool linter: check for leaf nodes with unstripped text content #17656

Merged
merged 9 commits into from
May 14, 2024

Conversation

bernt-matthias
Copy link
Contributor

another one from the microGalaxy hackaton. bio.tools often contain newlines which are removed by our parser, but it would be better if they would not be there at all (I think).

Created problems for instance in the galaxy_tool_metadata_extractor.

Also removes one test (test_xml_comments_are_ignored) which made no sense (to me).

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@bernt-matthias
Copy link
Contributor Author

ping @davelopez

@davelopez
Copy link
Contributor

Also removes one test (test_xml_comments_are_ignored) which made no sense (to me).

I see your point. I cannot remember right now why I added this test. From the #14845 PR description, it sounded like the position (line and character offsets in the text document) of the issues reported by the linter will not match the real document if we have XML comments or additional spaces on it because they get removed by the parser before linting. But it looks like this will not prevent the parser from removing them anyway.

@bernt-matthias bernt-matthias changed the title tool linter: check for lead nodes with unstripped text content tool linter: check for leaf nodes with unstripped text content Mar 11, 2024
@bernt-matthias bernt-matthias force-pushed the topic/lint-whitespace-text branch from 15d7025 to 02b1b4a Compare March 28, 2024 10:11
@bernt-matthias bernt-matthias force-pushed the topic/lint-whitespace-text branch from 02b1b4a to 4603168 Compare March 28, 2024 10:57
@mvdbeek mvdbeek merged commit 9ae9c94 into galaxyproject:dev May 14, 2024
53 checks passed
Copy link

This PR was merged without a "kind/" label, please correct.

@bernt-matthias bernt-matthias deleted the topic/lint-whitespace-text branch May 15, 2024 07:43
@jdavcs jdavcs changed the title tool linter: check for leaf nodes with unstripped text content Tool linter: check for leaf nodes with unstripped text content May 23, 2024
bernt-matthias added a commit to bernt-matthias/galaxy that referenced this pull request May 29, 2024
reverts galaxyproject#17656

we have to many xml nodes where this is allowed (e.g. command)
and limiting the linter to a statically defined list of node types
seemed difficult to maintain

replaced this with a change in the xsd that should lead to the
automatic removal of surplus white spaces (leading/trailing are removed,
multiple whitespaces are replaced by a single space) for some of the
node types that were the original motivation for the linter
(if this proves useful this could be used for more node types).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants