* Support bun text-format lockfile
Bun version 1.1.39 introduced a new plaintext lockfile. Currently it is opt-in only, but it will become the default in bun version 1.2.
* update docs
* update config schema
* update tests
Previously the selection code simply filtered for the first style found
within the config with a threshold larger than the current battery
percentage. If the config defined multiple display thresholds that were
above the battery percentage it would only select the first one that was
encountered rather than the one that was closest to the current battery
percentage.
This commit also adds a test to ensure this property is held true. The
test accomplishes this by comparing the parsing of a config with two
`battery.display` entries, one with a threshold at 100% & the other at
60%, with a mock battery set at 50% charge. This config is parsed with
the 100% threshold defined above the 60% threshold, and then again with
the 60% threshold defined above the 100% threshold. To ensure the
entries are parsed parsed correctly each entry is given a different
style, so the expected value that is compared against has the same style
as the 60% threshold entry for both test cases.
* Update src/modules/battery.rs
Use more concise chain of functions from Iterator
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
---------
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Combine ViModeChangeHandler
If a user has defined a ViModeChangeHandler setting this would respect that as well as redraw the prompt (to allow rendering things like the character change).
* Add newline
* Use call operator to limit new closure scope
* Pass any args to original handler
Default to false for tests regardless of the OS
Checking for username along with cfg!(test) seems redundant, especially because of one edge case - root user can be renamed
* feat(deno): add `deno.lock` file to default `detect_files` list
* feat(deno): add `deno.lock` to default detect files in schema
* test: add test for `deno.lock` file presense
* docs: add `deno.lock` to list of default files
* chore: formatting
* Revert "docs: add `deno.lock` to list of default files"
This reverts commit 6d0dc577d5bf5d04f1b4f00b4be0f3a398b30c5d.
* docs: add `deno.lock` to default detect files in primary readme
* chore: revert formatting from latest version of dprint
* docs: add `deno.lock` to default detect files list and format
* Docker Desktop uses "desktop-linux" instead of "default" as the default context since version 3.5.
This filters "desktop-linux" in the same way as "default".
https://github.com/starship/starship/issues/6170
* update docs/config/README.md
feat(python): Configure different detect env vars
Allow the env vars that trigger the python module to be configured, if
an empty list is passed then the module will fall back to just
triggering based on the configured files, folders and extensions.
* fix(bash): quote array expansions to work around custom IFS
* fix(bash): locally set standard IFS for $(jobs -p)
* fix(bash): localize the leaked variable "job"
* chore: use current way to get max value of an integer type
The std::usize::MAX way has been obsolete for quite some time now.
Found by clippy (clippy::legacy_numeric_constants).
Signed-off-by: Lars Wirzenius <liw@liw.fi>
* chore: use helper variable for a more idiomatic pattern matching
A nested expression can be harder to understand than two simpler
expressions. (Found by clippy lint clippy::blocks_in_conditions.)
Signed-off-by: Lars Wirzenius <liw@liw.fi>
---------
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Co-authored-by: Lars Wirzenius <liw@liw.fi>
* Fix config schema
* Improve performance of kubeconfig module
This module currently takes about 200 ms when using our ~10MiB
kubeconfig. This change improves its performance by:
* Only parsing the file once
* (Naively) checking if the content is yaml or json and potentially
parse as the latter, as that seems to be much faster
* Remove duplicate `v` in dotnet version
Every language version provider returns the version without a leading 'v', and the shared code then prepends the 'v'. Take a look at Python for example.
The Dotnet provider prepends a 'v' however, causing the version to be printed like 'vv8.0.203'.
* Update src/modules/dotnet.rs
* tests(dotnet): add test for obtaining version from cli
---------
Co-authored-by: Bernd Verst <github@bernd.dev>
feat(color): add prevfg,prevbg as color specifiers based on the previous foreground/background colors respectively
Co-authored-by: Vladimir Lushnikov <vladimir@solidninja.is>
* update: add purescript spago-next configuration files
in upcoming spago projects, the configuration file is changing from
spago.dhall -> spago.yaml and spago.lock. This will detect both styles
for the time being
* fix typo
did not update test. spago.yaml -> spago.lock in the spago lock file
test case