Skip to content

Fix formatter - #126

Merged
JPinkney merged 3 commits into
masterfrom
fixFormatter
Mar 20, 2019
Merged

JPinkney merged 3 commits into
masterfrom
fixFormatter

Conversation

@JPinkney

Copy link
Copy Markdown
Contributor

This PR fixes the formatter so that it respects the yaml.format.enable setting.

Comment thread src/server.ts Outdated
yamlFormatterSettings.bracketSpacing = false;
}
if (settings.yaml.format.enable) {
yamlFormatterSettings.enable = settings.yaml.format.enable || true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe I'm misunderstanding something here, but will this ever set yamlFormatterSettings.enable to false?

If settings.yaml.format.enable is false, won't this code block just be ignored?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

And won't the || true ensure that this would always be set to true anyway?

But I'm bad at Javascript so maybe this actually works.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

And at Typescript :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep! Good catch! I must not have had my coffee yet when I made the PR

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.008%) to 70.908% when pulling 767e655 on fixFormatter into 99f85cb on master.

@JPinkney
JPinkney merged commit 817a4a3 into master Mar 20, 2019
@evidolob
evidolob deleted the fixFormatter branch August 11, 2020 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants