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

Fix issue 547 #549

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix issue 547 #549

wants to merge 1 commit into from

Conversation

Shinigami92
Copy link
Member

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@Shinigami92 Shinigami92 added type: bug Functionality that does not work as intended/expected framework: Vue Related to the framework Vue labels Feb 8, 2025
@Shinigami92 Shinigami92 self-assigned this Feb 8, 2025
@Shinigami92
Copy link
Member Author

@Ralac07 please review and tell me if you have other more complex test cases I can add

Copy link
Contributor

github-actions bot commented Feb 8, 2025

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 94.56% (🎯 90%)
⬆️ +0.01%
2625 / 2776
🟢 Statements 94.56% (🎯 90%)
⬆️ +0.01%
2625 / 2776
🟢 Functions 96.29% (🎯 90%)
🟰 ±0%
104 / 108
🟢 Branches 92.97% (🎯 90%)
⬆️ +0.04%
635 / 683
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/printer.ts 94.05%
🟰 ±0%
94.17%
⬆️ +0.05%
100%
🟰 ±0%
94.05%
🟰 ±0%
334-335, 371-372, 521-523, 535-544, 549-562, 610-646, 662-663, 703-704, 761-765, 1114-1115, 1208-1209, 1236, 1248-1249, 1549-1550, 1596-1597, 1920-1926, 1964-1969
Unchanged Files
src/doctype-shortcut-registry.ts 100% 100% 100% 100%
src/index.ts 93.18% 100% 71.42% 93.18% 79-81, 84-86
src/logger.ts 77.46% 90.9% 81.81% 77.46% 37-46, 93-94, 153-157
src/options/common.ts 100% 100% 100% 100%
src/options/constants.ts 100% 100% 100% 100%
src/options/converge.ts 100% 60% 100% 100%
src/options/index.ts 100% 100% 100% 100%
src/options/pug-attribute-separator.ts 89.74% 75% 100% 89.74% 52-55
src/options/pug-class-location.ts 100% 100% 100% 100%
src/options/pug-class-notation.ts 100% 100% 100% 100%
src/options/pug-closing-bracket-indent-depth.ts 100% 100% 100% 100%
src/options/pug-comment-preserve-spaces.ts 100% 100% 100% 100%
src/options/pug-explicit-div.ts 100% 100% 100% 100%
src/options/pug-framework.ts 100% 100% 100% 100%
src/options/pug-id-notation.ts 100% 100% 100% 100%
src/options/pug-preserve-attribute-brackets.ts 100% 100% 100% 100%
src/options/pug-single-file-component-indentation.ts 100% 100% 100% 100%
src/options/pug-wrap-attributes.ts 100% 100% 100% 100%
src/options/types.ts 100% 100% 100% 100%
src/options/attribute-sorting/index.ts 100% 100% 100% 100%
src/options/attribute-sorting/utils.ts 95.69% 94.44% 100% 95.69% 82-83, 94-95
src/options/empty-attributes/index.ts 100% 100% 100% 100%
src/options/empty-attributes/types.ts 100% 100% 100% 100%
src/options/empty-attributes/utils.ts 100% 100% 100% 100%
src/utils/angular.ts 100% 100% 100% 100%
src/utils/common.ts 89.67% 86.11% 100% 89.67% 19-20, 27-28, 56-57, 258-259, 262-263, 269-272, 331-332
src/utils/script-mime-types.ts 87.5% 83.33% 100% 87.5% 42-43, 49-50
src/utils/svelte.ts 100% 100% 100% 100%
src/utils/vue.ts 100% 100% 100% 100%
Generated in workflow #344 for commit cc7a0b6 by the Vitest Coverage Report Action

@Ralac07
Copy link

Ralac07 commented Feb 22, 2025

I just used the sample code on the pug website, tests should probably include those but I'm not really sure
https://pugjs.org/language/iteration.html
sorry for my delay in responding

@Shinigami92
Copy link
Member Author

I just used the sample code on the pug website, tests should probably include those but I'm not really sure pugjs.org/language/iteration.html sorry for my delay in responding

That's a really good one. But do you have any more cases from your real world? I'm asking because I would like to now if I only need to consider tag as a previous token, or if there is more.

this.previousToken?.type === 'tag' ? '' : this.computedIndent;

@Ralac07
Copy link

Ralac07 commented Feb 25, 2025

I don't use pug much, sorry.

@Shinigami92
Copy link
Member Author

So if I understood you correctly, you are not affected in production code by this?
If that's the case, I would set this right now to low prio on my task-list and await more feedback from other users and if they encounter this bug.
Because since the repo was started, this bug was never reported ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework: Vue Related to the framework Vue type: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: adds unwanted space if pugSingleFileComponentIndentation is true
2 participants