Open Paebbels opened 2 years ago
Added research about CSS for tabs.
I'd like to handle this by reading .editorconfig files, but that will require some refactoring, and using an optional third-party library.
The .editorconfig
sounds also good.
But shouldn't there be a fallback to the pyproject.toml
or similar?
I would rather not invent a coverage.py-only setting for this. editorconfig files are good, and more people should use them.
I also would prefer the .editorconfig
.
What do you mean by "coverage.py-only"?
Coverage.py is already reading from pyproject.toml
.
[tool.pytest.ini_options]
# Don't set 'python_classes = *' otherwise, pytest doesn't search for classes
# derived from unittest.Testcase
python_files = "*"
python_functions = "test_*"
[tool.coverage.run]
branch = true
omit = [
"*site-packages*",
"setup.py"
]
[tool.coverage.report]
skip_covered = true
skip_empty = true
exclude_lines = [
"raise NotImplementedError"
]
[tool.coverage.html]
directory = "report/coverage/html"
[tool.coverage.xml]
output = "report/coverage/coverage.xml"
What do you mean by "coverage.py-only"?
I meant that a setting like [tool.coverage.html] tab_size=2
would only be read by coverage.py. It would be duplicating information that's already in the editorconfig file.
@nedbat any progress on this topic?
I have not put any work into this. BTW: one of the reasons people prefer spaces to tabs is because it avoids having to add a tab-size feature to everything that displays code.
Is your feature request related to a problem? Please describe. In #6, it was reported that
\t
get handled in HTML reports.When checking
html.py
this mentioned code seams to be gone.When using tab characters for indentation in Python files, coverage.py converts all tabs to 8 spaces (checked in Chrome browser).
When checking the HTML source code, then 8 spaces can be found:
Describe the solution you'd like Offer an option in the configuration file, so the conversion of tab characters to spaces can be specified.
Or this
This would allow CSS to specify the representation with a default of
2
.Describe alternatives you've considered
I think modifying CSS is not possible, because the HTML code contains already 8 spaces.
So the representation of tab characters can't be modified.
Additional context
tab-size: 2;
/cc @umarcor