---
# System prepended metadata

title: Consolidating quoting on devtools projects

---

## [WIP] Consolidating quoting on devtools projects?

In order to avoid confusiongs across our projects I would like to propose declaring **double quotes as preffered for most file formats**.

Keep in mind that that rule is bit nuanced as the lack of escaping takes precendence. It means that if you have a string with double quotes inside, the prefered way is to enclose it with single quotes. I do think that [prettier rationale for string quoting](https://prettier.io/docs/en/rationale.html#strings) does describe it very well and happens to also match black behavior.

Please note that we do not want to add any linters to our projects that would **tell** user to fix quotes. If we can have an auto-fixer that can correct them we can enforce them but if we fail to find one, we will likely prefer not to enforce it. The reasoning for this is to minimize annoying contributiors.

File formats targeted so far `python`, `javascript`, `typescript`, `yaml`. We will have to decide for others once we encounter them.

## Reasoning

* Black defaults to prefer double quotes and we already have multiple projects where we do enforce these, molecule and its plugins, ansible-compat and ansible-navigator.
* Prettier seems to also prefer double quotes by default.
* Microsoft own guidelines recommend [double quotes for contributions to TypeScript itself](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines) since 2015. That is also backed by another [comment](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines) explaining the reasoning: 

> All those languages either require double quotes for strings (e.g. C#, C++, F#) or at least allow double quotes for strings (e.g. Python, Ruby). It's easier not to ask people to shift their muscle memory when switching back and forth between languages.

## Identified impact

* We will have to remove prettier custom config that prefers single quotes from vscode-ansible and ansible-language-server projects.  Hopefully Tomasz will support this change as he said that the only reason why he did it was because Microsoft examples were using single quotes and he only wanted consistency inside the code base.
* Eventually remove the `skip-string-normalization` from black config on ansible-lint. I added it while adopting black in order to make transition easier more than an year ago.


