1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-12-12 22:17:47 +00:00
Commit Graph

714 Commits

Author SHA1 Message Date
Chiffa
639c7c6285
test(username): Default to false for is_root_user() regardless of the OS (#6358)
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
2024-11-09 14:06:58 +01:00
David Knaack
a5631a17dd
refactor: bump msrv to remove once-cell, improve logger test & handle clippy warnings (#6315)
* refactor: replace `once_cell`-crate with stdlib

* test(logger): make log cleanup-test cross-platform

* chore: handle clippy warnings

* build(deps): update dependency dprint/dprint-plugin-toml to v0.6.3

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-17 16:03:22 +02:00
Daniel Waltz
22c6c5201d
feat(deno): add deno.lock file to default detect_files list (#6310)
* 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
2024-10-14 22:05:23 +02:00
Ben Fritsch
14babde435
fix(docker_context): Ignore Docker Desktop "desktop-linux" context. (#6314)
* 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
2024-10-14 22:02:52 +02:00
David Knaack
77f08832d5
fix: use whoami for user/hostname queries again (#6311) 2024-10-14 20:46:04 +02:00
David Knaack
25f356e3b5
chore: fix minor ci failures (#6293)
* chore: add trailing newline to config schema

* chore: fix typo

closes #6291
2024-10-07 21:18:44 +02:00
David Knaack
8419c677f1
chore: fix hindi truncation tests and bump deps (#6271)
* chore: fix hindi trunc test

* chore: bump deps
2024-09-28 13:41:35 +02:00
Baku Kim
36134d896b
feat(python): detect pixi and ipynb files (#6228) 2024-09-26 10:53:18 +02:00
Thorsten Hans
b0669daf6d
chore: fix typo in comment to make spell-check pass (#6239)
Signed-off-by: Thorsten Hans <thorsten.hans@fermyon.com>
2024-09-06 21:30:56 +02:00
Daniel Kneipp
171746a584
feat(mojo): add module for Mojo language (#6108)
* feat: add support to mojo lang

* docs: fix mojo formatting

* Update src/modules/mojo.rs

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

* feat(mojo): parse hash as an independent variable

* chore(mojo): fix formatting

* chore(mojo): update schema and docs

* feat(mojo): use lazy cmd evaluation

---------

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2024-08-18 18:12:39 +02:00
Thomas O'Donnell
8a2d944bc8
feat(python): Add detect env vars option (#4486)
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.
2024-08-18 18:11:13 +02:00
Eduard Korchmar
68a8fc9563
feat(hostname): add option to replace hostnames with aliases (#6097)
---------

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2024-08-12 18:26:35 +02:00
苏向夜
7b65ad5163
fix(python): improve parsing of pyvenv.cfg files (#6145) 2024-08-12 18:25:04 +02:00
Leon Strauss
4abea6b601
fix(cmd_duration): Make render_time format more consistent (#5825)
* fix(cmd_duration): Make render_time format consistent

* Cleanup render_time comments

* Fix AWS test for new render_time format
2024-07-29 22:22:55 +02:00
JKatzwinkel
a62012e328
fix(package): support alternative gradle module version syntax (#6080)
feat(package): support alternative gradle module version syntax (#6079)
2024-07-29 22:19:56 +02:00
David Knaack
cfc58161e0
Merge commit from fork
addresses GHSA-vx24-x4mv-vwr5
2024-07-26 19:31:41 +02:00
David Knaack
d0cfa1756c
chore: cargo fmt (#6124) 2024-07-26 08:42:45 +02:00
David Knaack
6806f56c90
chore: bump deps and address clippy warnings (#6116) 2024-07-25 22:17:06 +02:00
larswirzenius
6000231d12
chore: Minor changes to use more idiomatic Rust (integer max values; complicates nested expressions) (#6090)
* 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>
2024-07-24 21:06:40 +02:00
Alvaro Aleman
fae92b2964
perf(k8s): Improve performance of kubeconfig module (#6032)
* 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
2024-07-16 22:26:03 +02:00
David Knaack
52a89a515e
fix(dotnet): Remove duplicate v in dotnet version (#6060)
* 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>
2024-07-07 16:15:56 +02:00
Iuliia Gracheva
4d36d463b9
feat(gcloud): Disabled gcloud module when active config hasn't been set (#6039)
* disabled gcloud module when active config hasn't been set

* added test case

* updated config-schema
2024-06-29 23:00:07 +02:00
Evan Mattiza
e0281868c9
feat(purescript): add support for spago-next configuration files (#6036)
* 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
2024-06-28 23:39:40 +02:00
David Knaack
aa05a1e5ab
chore: fix rust 1.79 lint warnings (#6034)
* chore: fix rust 1.79 lint warnings

* chore: update config-schema
2024-06-22 09:52:46 +02:00
David Knaack
8c75822d43
fix(k8s): don't trigger if scan config is set but env vars are not (#5979) 2024-06-09 09:55:13 +02:00
DerRockWolf
478d5cccb6
fix(direnv): replace nonexistent "orange" color with "bright-yellow" (#5969)
* Fix direnv config: change style from nonexistent "bold orange" to "bold bright-yellow"

* generate config-schema.json

* fix tests
2024-06-02 15:24:12 +02:00
John Hooks
5facd85da5
feat(nats): Add NATS Context (#5900)
---------

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2024-05-15 18:46:14 +02:00
William Veal Phan
2221a88f5a
perf(scala): use scala-cli first to avoid timeout (#5952)
fix(scala): use scala-cli first to avoid timeout
2024-05-12 20:32:08 +02:00
Thomas O'Donnell
e3b5dff352
feat(k8s): Add detect env vars option (#4488)
* feat(k8s): Add detect env vars option

Have added the option to trigger the k8s module based on what env vars
are set, this has been done in a backwards compatible way so if nothing
is changed from the defaults the module will still behave the same way
as before. This is similar to what I did in #4486 for the python module
and if goes well I'd like to rollout to other modules.

* Update src/modules/kubernetes.rs

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

* Update src/modules/kubernetes.rs

---------

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2024-04-06 15:30:19 +02:00
cgzones
3e3f18ef27
feat(container): show name if available (#5195)
Podman exports the name of the container in /run/.containerenv, which is
especially useful for distrobox environments.
2024-04-06 15:29:24 +02:00
Alper Cugun
9c1eaddae1
feat(username): add aliases option (#5855)
* Create place to put it in the config

* Initial functional version

* Fix grammar

* Add option documentation to README

* Add test for two aliases and emoji translation

* Remove println

* Rewrite match as iflet

* Improve converting the reference

* Format file

* Try to restore autoformat of markdown

* Replace toml:Map with concrete IndexMap

* Update schema

* Add option that got lost
2024-04-05 23:57:13 +02:00
[Error_27]
335c514e9e
feat(odin): Add Odin Lang module (#5873)
* Add Odin lang module

* add utils string and remove commit number from output

* switch to new symbol because ZWJ support is rare

* add config docs

* add option to show the commit number

* fix lack of trimming

* fix formatting to comply with checks

* Add trailing newline to comply with cargo fmt

* Add new Odin test and add newline in cmd output
2024-04-05 23:56:49 +02:00
boreinhardt
34a8f7e628
feat(gleam): Add Gleam module (#5886)
Co-authored-by: benno.reinhardt <benno.reinhardt@silbury.com>
2024-04-05 23:56:15 +02:00
Ramy
be4e97c2d9
fix(bun): change default icon (#5880)
* feat: change bun icon #5871

* fix: reverts docs
2024-03-30 09:38:19 +01:00
David Knaack
796a411602
fix: replace unmaintained crates yaml-rust, dirs-next (#5887) 2024-03-29 12:14:57 +01:00
David Knaack
d5861f9f97
fix: replace all remaining paths referring to vuepress (#5859) 2024-03-24 08:03:55 +01:00
David Knaack
df65b2155f
feat(os): add new os symbols (#5849) 2024-03-21 12:39:28 +01:00
David Knaack
ab840439e3
fix(status): fix pipestatus width calculation (#5036)
closes #3162

Co-authored-by: flw <flw@cpan.org>
2024-03-20 22:58:33 +01:00
marcybell
938ea3c401
feat: $gemset variable for Ruby module (#5429)
* $gemset variable for Ruby module

* typo

* Added test for no GEM_HOME env set

* Formatting

* Uses `rvm current` for gemset, no more version num
2024-03-20 22:57:26 +01:00
Virgile Andreani
0e49f04a6b
feat(quarto): Add Quarto module (#5820)
Add Quarto module

* Adapted from the Typst module
2024-03-20 22:50:12 +01:00
Mick Hohmann
b8a812b932
feat(username): add detect_env_vars as option (#5833)
* Added the option "detect_env_vars" to the `username` module

with the same functionality as in the `hostname` module.

* Fixed logic error and added test to catch it

* build(deps): update dependency vitepress to ^1.0.0-rc.45

* build(deps): update rust crate shadow-rs to 0.27.1

* Added the option "detect_env_vars" to the `username` module

with the same functionality as in the `hostname` module.

* Fixed logic error and added test to catch it

* Removed unused gix import

* Removed unused gix import, again

* Removed unused gix import. Next try

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-20 22:47:32 +01:00
David Knaack
0e334e3e6c
chore: fix upcoming rust 1.77 clippy issues and chrono deprecations (#5850) 2024-03-20 18:57:14 +09:00
David Knaack
7290c5e368
chore: apply clippy for rust 1.76 & bump msrv (#5763) 2024-03-03 17:57:39 +01:00
Fraser Li
6a96e84a15
fix(git_branch): fall back to "HEAD" when there is no current branch (#5768)
* fix(git_branch): fall back to "HEAD" when there is no current branch

* test(git_branch): add test for branch fallback on detached HEAD
2024-02-26 12:21:00 +01:00
Gilbert Sanchez
0891ec27a4
fix(character): also handle vi edit mode in pwsh (#5775)
* Add missing vi for char for Shell::Pwsh

https://github.com/starship/starship/pull/5478#issuecomment-1886829331
2024-02-19 17:01:51 +01:00
David Knaack
428d840bce
build(deps): update rust crate windows to 0.52.0 (#5379) 2024-02-04 16:01:32 +01:00
Andrew Pantuso
482c7b719f
feat(direnv): use JSON status with direnv >= 2.33.0 (#5692) 2024-01-21 13:56:57 +01:00
Xiaohan Ni
ef7b773557
test(aws): fix flaky tests expiration_date_set expiration_date_set_from_file (#5685)
* fix(aws): fix flaky test `expiration_date_set`

* fix(aws): fix flaky test `expiration_date_set_from_file`
2024-01-06 22:49:27 +01:00
Camron Flanders
cec111affd
fix(direnv): update to work with direnv v2.33 (#5657)
* update AllowStatus to work with direnv 2.33

direnv now returns int enum instead of boolean, https://github.com/direnv/direnv/pull/1158

* update schema

* maybe fixed the schema now

* Whoops, I inverted the flags somehow

* have coffee, fix mistaken understanding

* undo changes to tranlations

* Update docs/config/README.md

* Update src/modules/direnv.rs

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

* update test output

---------

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2024-01-06 11:46:25 +01:00
David Knaack
a83e10776b
revert: refactor(modules): use whoami crate to get username (#5669)
Revert "refactor(modules): use whoami crate to get username"
2024-01-02 15:45:06 +01:00