Returns the indentation's visual width in columns/spaces. For docstring indentation, black counts spaces as 1 and tabs by increasing the indentation up to the next multiple of 8. This is effectively a port of [`str.expandtabs`](https://docs.python.org/3/library/stdtypes.html#str.expandtabs), which black [calls with the default tab width of 8](https://github.com/psf/black/blob/c36e468794f9256d5e92
(self)
| 1714 | /// [`str.expandtabs`](https://docs.python.org/3/library/stdtypes.html#str.expandtabs), |
| 1715 | /// which black [calls with the default tab width of 8](https://github.com/psf/black/blob/c36e468794f9256d5e922c399240d49782ba04f1/src/black/strings.py#L61). |
| 1716 | const fn columns(self) -> usize { |
| 1717 | match self { |
| 1718 | Self::Spaces(count) => count, |
| 1719 | Self::Tabs(count) => count * Self::TAB_INDENT_WIDTH, |
| 1720 | Self::TabSpaces { tabs, spaces } => tabs * Self::TAB_INDENT_WIDTH + spaces, |
| 1721 | Self::SpacesTabs { spaces, tabs } => { |
| 1722 | let mut indent = spaces; |
| 1723 | indent += Self::TAB_INDENT_WIDTH - indent.rem_euclid(Self::TAB_INDENT_WIDTH); |
| 1724 | indent + (tabs - 1) * Self::TAB_INDENT_WIDTH |
| 1725 | } |
| 1726 | Self::Mixed { width, .. } => width, |
| 1727 | } |
| 1728 | } |
| 1729 | |
| 1730 | /// Returns the length of the indentation in bytes. |
| 1731 | /// |
no outgoing calls
no test coverage detected