Comments (9)
Can you please tell me what happens when you change the background color here? https://github.com/pypa/hatch/blob/hatch-v1.10.0/src/hatch/cli/config/__init__.py#L36
from hatch.
Using "white"
text = app.config_file.read() if all_keys else app.config_file.read_scrubbed()
app.output(Syntax(text.rstrip(), 'toml', background_color='white'))
produces
Using '#ffffff'
text = app.config_file.read() if all_keys else app.config_file.read_scrubbed()
app.output(Syntax(text.rstrip(), 'toml', background_color='#ffffff'))
produces
Using None
app.output(Syntax(text.rstrip(), 'toml', background_color=None))
produces
That's readable. Not pretty, but the contrast works, so it's readable. 🙂
from hatch.
@willmcgugan What should I do here? I'm not sure what is recommended.
from hatch.
Syntax will use an Pygments theme by default. Pygments themes use RGB colors , which means that changing the background without changing the text colors is unlikely to look good.
You can also use ansi colors, which will render with the user's choice of terminal theme colors. Just set theme="ansi_light"
or theme="ansi_dark"
.
from hatch.
I would suggest to keep it simple, because programs like gcc, rustc, ls, rg etc output colorful text without trying to know which background color the terminal has.
Pick a syntax coloring with few classes (few different colors or styles) and use ansi colors, I guess?
from hatch.
I'm just going to remove the explicit background color for broader compatibility even though on light terminals it might not be as pretty like you mentioned. If you require configurability (and can provide example keyword arguments that look good) feel free to open a separate feature request!
from hatch.
Just as a heads up (mostly for Will) the background_color
option must be set to default
for tests because otherwise a bunch of spaces get written at the end of each line I think based on the terminal size. That may be in fact why I did that originally 😅
from hatch.
Ok, thanks for that. What do you think about a config option that turns off syntax highlight for this?
from hatch.
Sure I can do that.
from hatch.
Related Issues (20)
- Unclear "Bad Interpreter" error when (stupidly) trying to run hatch env within an existing project environment HOT 1
- Documentation: clarify docs for tasks which require manually editing pyproject.toml
- make `uv` as the default package manager HOT 3
- Documentation: update contributing section after implementing `hatch test` command
- Tests: running tests locally with slow internet prevents its completion
- Tests: internal tests require cargo to run
- Unable to build package with custom folder structure
- Missing timeout option for python install command HOT 3
- wheels are built with too strict file permissions HOT 3
- Installing `hatch` masks my globally installed `uv` HOT 6
- `hatch test -i` with multiple matrix variables results in Union instead of Intersection of environments HOT 5
- RFE: minimal dependency with just enough to run `hatch version` HOT 6
- Hatch Test System Python Option HOT 2
- GitHub action always uses the latest Python version even if other version was set up HOT 3
- Please document how to develop builder plugins by turning off build isolation. HOT 8
- build --target argument documentation does not reflect behavior HOT 1
- `hatch test` ignores `[tool.pytest.ini_options]` HOT 1
- The test environment should auto-install the test feature if present HOT 1
- Add feature to dynamically set environment variables in `envs.ENV.env-vars` HOT 2
- maybe wrong bumping strategy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hatch.