Commit Graph

943 Commits

Author SHA1 Message Date
accidentaldevelopment 9ac924eb3f
fix(fish): enable transient prompt when in vi mode (#4826) 2023-01-30 23:13:16 +01:00
David Knaack 645a439c0b
build(deps): update toml crates (#4853)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-30 23:12:27 +01:00
David Knaack 5e123fcbce
chore: fix clippy warnings for rust 1.67 (#4855) 2023-01-27 18:33:24 +09:00
Benjamin Sherman 85d683daf2
fix(container): reduce docker, podman and systemd confusion (#4832)
* Fixes #3821 to provide an improved experience for display of container

Details:
- podman containerenv processing is now happens before systemd
- if systemd/container contains "docker", now shows "Docker"
- maintains fix from #4593 to prevent 'Systemd" display on WSL
- refactors tests for systemd detection

* only compile function for linux

* correct 'default' systemd test use use None, codecov caught this mistake

* refactor my change to systemd/container detection so that it has one stage instead of multiple
2023-01-22 23:36:42 +01:00
Florent Vilmart 10433e31ef
feat(config): Adds support for --profile <custom profile name> (#3467)
Co-authored-by: Kevin Song <chips@ksong.dev>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2023-01-11 21:25:36 -06:00
かわえもん 64e0208708
chore(aws): fix unintended test failure of `aws::missing_any_credentials` (#4805)
chore(aws): fix unintended test failure of `aws::missing_any_credentials` 

Because its mocking is not enough, The test may unintentionally fail
if `~/.aws/credentials` exists.
This commit fixes this issue by mocking `credentials` file as well.
2023-01-11 10:51:39 +01:00
Andre Ribeiro e88484d567
fix(nodejs): apply `style` even if node version is unavailable (#4713)
* correct nodejs color

* Update src/modules/nodejs.rs

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

* Update src/modules/nodejs.rs

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

* fix: removed unecessary unwraps

* test: no node installed

* test: no node installed

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2023-01-10 23:00:09 +01:00
Takuya Uehara fcdf2a0fb6
chore: remove version check for unsupported nushell version (#4791) 2023-01-06 12:13:04 -06:00
David Knaack e47ea57db2
feat(logger): delete old logs & avoid more dup logs (#4348)
* feat(logger): delete old logs & avoid more dup logs

* `match` -> `let else` where possible
2023-01-04 09:22:02 +01:00
Lyle Mantooth 67b6376e2e
feat: add pijul_channel module (#4765)
* feat: Pijul VCS support

* Extra bits needed for new module.

* Format Markdown table.

* Fix lint.

* Don't test Pijul module so thoroughly.

Installing from source is too expensive, and compiled binaries are only
available for Windows (and unofficially as well). Perhaps once Pijul
1.0.0 comes out of beta there will be more binaries available in package
  repos.

* Format!

* Bad rebase, remove Pijul install from workflow.

* Mock Pijul commands for code coverage.

* Make fake .pijul directory in fixture.

* Truly mock `pijul` command.

* Rename module from `pijul` to `pijul_channel`.

* Format!

* Fix config-schema.json.

* Missed changing module name in docs/ folder.
2022-12-31 15:55:23 +01:00
Nicolas Évrard 8d2256ab1d
feat(hg_branch): Add support for mercurial topics and find hg root dir (#4771)
* feat(hg_branch): Add support for mercurial topics and find hg root dir

* Fix clippy errors

* Use crate::utils::read_file

* Update config-schema.json

* Extend PathExt to retrieve device ID of Path

* Break hg root search when switching to another device

* Fix clippy and formatting errors

* Update docs/config/README.md

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

* Update src/modules/utils/path.rs

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

* Update src/configs/hg_branch.rs

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

* Update hg_branch description

* Revert to lazy loading, use truncate_text from utils and use fake topic

* Format code and fix clippy error

* Revert to previous test string as topic is optional in the config

* Fix doc formatting

* Stub device_id for windows

* Update config-schema.json

* Update src/modules/hg_branch.rs

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

* Do not use unwrap in device_id

* Fix formatter error

* Use dev under non linux unixes

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2022-12-31 15:53:55 +01:00
John Slowik 8a8e09dd50
docs(preset): Plaintext status added (#4775)
* Plaintext status added

* One test case
2022-12-31 12:35:28 +01:00
David Knaack 5d4cb6ff8f
feat(env_var): Add support for env_var.VAR in format (#4497)
Co-Authored-By: Segev Finer <24731903+segevfiner@users.noreply.github.com>

Co-authored-by: Segev Finer <24731903+segevfiner@users.noreply.github.com>
2022-12-28 21:00:49 +01:00
Julian Antonielli 19fdf9bba5
feat(nix): support new `nix shell` command (#4724)
* Support `nix shell`

* Remove unnecessary `Debug` implementation

* Add test to detect false positive

* Improve detection of `/nix/store` in $PATH

* Add docs about unknown state

* Gate under `heuristic` flag

* Regenerate config schema
2022-12-27 14:59:40 +01:00
Scott Palmer 9093891acb
fix(package): Improve regex for extracting gradle version from gradle.properties (#4760)
fix: Improve regex for extracting gradle package version from gradle.properties (#4759)
2022-12-27 13:40:56 +01:00
David Knaack 784c935169
build(deps): update gitoxide crates (#4748)
* build(deps): update gitoxide crates

* remove call to removed function (env is loaded automatically now)

* bump git-repository to v0.30.1

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-24 11:08:14 -06:00
fold-squirrel e93dbf8630
feat(fennel): add fennel module (#4717) 2022-12-21 10:53:53 -06:00
Kevin Song addd11e300
refactor(kubernetes): Remove nested Options (#4743)
Kubernetes module was previously a bit messy, with lots of
unnecessarily nested options. Clean this up using filter_map and
find_map, with two major results:

1. `ctx_components` is now a Vec<KubeCtxComponent> instead of a
   Vec<Option<KubeCtxComponent>>. This greatly simplified downstream
   processing of these context components.

2. Instead of storing a partial computation of the namespace in
   variables `kube_ns`, etc, compute them directly in the formatter
   mapping. This is made simpler (read: actually doable) by change 1.
2022-12-20 19:04:40 -06:00
Foster Z 27d167b7a2
fix(git_commit): fix potential test failure (#4734)
Changes git command used in tests to avoid potential failures 
with lightweight tags.
2022-12-18 12:33:01 -06:00
David Knaack 14de3b34c1
chore: fix clippy warnings in gradle module (#4736) 2022-12-18 14:18:37 +01:00
David Knaack aa6c2dd588
chore: fix clippy warnings for rust 1.66 (#4715)
chore: fix new clippy lints
2022-12-17 18:01:27 +01:00
Marie 220844daa0
feat(gradle): add gradle module (#4423)
* docs: document gradle module

* implement gradle module

* gradle-module: add test for wrapper properties case

* docs: improve gradle module documentation

* fix: fix gradle module wrapper properties test

* drop gradle executable strategy

* apply suggested stuff

* Fix config schema
2022-12-17 13:32:40 +01:00
Dennis Waitong Lam 7341607c29
fix(buf): broken icon on windows 10 (#4689)
Closes https://github.com/starship/starship/issues/4608
2022-12-09 18:41:59 +09:00
AlexHaxe 2766c78749
feat: add Haxe support (#4395)
* Add Haxe support

* avoid unwrap

* fix doc formatting

* removed extra newline

* fixed formatter and linter issues

* fixed config file

* better version of detecting contents of .haxerc

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

* removed openfl related defaults from detect_files

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

* fixed formatting

* reworked reading .haxerc with fallback to haxe --version

* fixed formatting

* added fallback to executable for dev paths in .haxerc

* fixed linter issue

* added support for Windows paths

* use or_else

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

* use shorter version with `?`

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

* simplified regex check

removed check for "null" string

* fixed format

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2022-12-04 18:28:49 +01:00
David Knaack ef83e7a092
fix(pwsh): fix error log display on older versions of pwsh (#4650) 2022-12-02 14:17:57 -06:00
nibon7 a7abc0f450
feat(nu): enable right prompt (#4490)
Closes #3982
2022-12-02 12:40:36 +01:00
cgzones ea6249b524
feat(directory): add before_repo_root_style (#4595) 2022-12-01 23:09:11 +01:00
cgzones ddd54e9b20
feat(localip): use reserved remote address (#4648)
Instead of the remote address of 8.8.8.8 (Google DNS) in the crate
local_ipaddress use a reserved IPv4 address, that should never be
assigned.
Also forward the underlying error on failure.

Supersedes: #4614
2022-12-01 19:51:04 +01:00
Gabriel Victor 0427863168
fix: don't attempt to display cmd_duration notification if in TTY (#4535)
Disables the display of notifications from cmd_duration on Linux if
none of DISPLAY, WAYLAND_DISPLAY, or MIR_SOCKET are set.
This prevents starship from attempting to create notifications in tty 
environments, which was previously causing hangs.
2022-11-28 07:23:03 -06:00
Chris Rose c8ac8777a5
fix(aws): enable when using .aws/credentials (#4604) 2022-11-27 15:06:05 +01:00
Ryan Sabatini 6e15c00238
feat(azure): add username to azure module config (#4323)
* add username to azure module config

* add username to azure module config

* formatting with cargo fmt

* Handle parse failure on azureProfile.json

allow program to procede if unable to parse azure profile due to missing
keys from the JSON structure.
remove unused keys from struct

Code cleanup with suggestions from PR maintainer

Cargo clippy fixes
2022-11-27 15:02:23 +01:00
David Knaack 8bb9038431
feat(bug-report): ask for confirmation before opening issue (#4543)
* feat(bug-report): ask for confirmation before opening issue

* Apply suggestions from code review

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2022-11-25 17:44:25 +01:00
David Knaack ac37792c19
feat(git_commit): support showing lightweight tags (#4632) 2022-11-22 10:15:31 +01:00
Scott Palmer a9eb65ef35
fix(java): Improved regex for Java version (starship#4610) (#4616)
* fix(java): Improved regex for Java version (starship#4610)

* fix(java): Fixed tests and tweaked regex to accomodate Eclipse OpenJ9 (starship#4610)
2022-11-20 18:28:39 +01:00
Brahm Lower 1b03ef21f3
fix(config): unrecognized config properties don't cause config error (#4547)
* Fix #4481, config does not error when unrecognized properties are present

* cleanup: use stuct update syntax to improve readability

from review feedback

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

* cleanup: renamed ValueDeserializer func w/ better name

* cleanup: added test to cover unknown key retry condition

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2022-11-20 18:27:48 +01:00
David Knaack b47a4fe514
fix(container): avoid detecting WSL as a systemd-container (#4593) 2022-11-15 11:14:52 +01:00
Kevin Menard cc2c8c4a54
feat(init): Use which-rs to resolve starship path
This patch uses the which crate to resolve the starship path, replacing the
current_exe() mechanism.

Co-authored-by: Kevin Song <chips@ksong.dev>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>
2022-11-13 21:28:29 -06:00
David Knaack d86e1c1d1c
build(deps): update rust crate chrono to 0.4.23 (#4599)
* build(deps): update rust crate chrono to 0.4.23

* chore: remove chrono deprecations

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-13 21:23:30 -06:00
Sebastian Thiel a53f681e3c
build(deps): upgrade to git-repository v0.27 (#4588)
* upgrade to git-repository v0.27

* thanks clippy
2022-11-12 17:07:49 +01:00
Loong Wang fd165b96cc
fix(git): check `tag_disabled` option (#4527)
* fix(git): check `tag_disabled` option

* Check in `map` and test fixes
2022-11-06 22:43:50 +01:00
exincore 3109943822
feat: Add operating system module (#4109)
* docs(os): Add os module documentation

* docs(os): Add os to Default Prompt Format

* chore(os): Update config file schema

* feat(os): Add os entries and declarations

* feat(os): Add os module and config

* fix(os): Obey config.disabled

* feat(os): make variables 'Unknown'-aware

refactor(os): calculate variables in dedicated functions

* test(os): Add os module tests

* feat(os): make 'name' variable less 'Unknown'-aware

* docs(os): Add Preset configurations

docs(os): Use emoji as default

* feat(os): Use emoji as default

test(os): Use emoji as default

* fix(os): Add spaces after emoji symbols

* chore(os): Update config schema

* feat(os): Remove `bitness` variable

docs(os): Remove `bitness` variable

test(os): Remove `bitness` test

* feat(os): Add Cargo.toml upgrade caution for os_info

* refactor(os): Clarify get_symbol function

* docs(os): Mention supported operating systems and feature requests

* docs(os): Mention os_info inacurracy

* test(os): Remove `bitness` leftovers

* refactor(os): use nu_ansi_term

* refactor(os): add cfg_attr(schemars(deny_unknown_fields))

* chore(os): update config schema

* docs(os): expose details block

* feat(os): add garuda linux

* chore(os): update config schema

* feat(os): add case insensitivity

* feat(os): add symbols `IndexMap` use `os_info::Type` instead of `String`

* test(os): add clippy warn on new os_info::Type case

* leave missing case to test github tests

* test(os): re-add missing test case

* style(os): fix formatting

* docs(os): update to match os_info::Type serialization

- docs(os): add missing garuda to config

- test(os): mention docs updates in warn_on_os_info_update
2022-11-06 22:37:58 +01:00
David Knaack 6e38683c89
chore: fix new clippy lints (#4557) 2022-11-05 12:40:46 +01:00
Felix H 14ee81b9c3
feat(package): added showing gradle version based on the gradle.properties file (#4432)
* feat: added showing gradle version based on the gradle.properties file

* fix: wouldn't return version

* fix: forgot to remove "version=" from returned version"

* fix: ran rustfmt

* fix: test now actually tests for something

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

* fix: the regex actually makes sense now

* fix: complete refactor of control flow

* Delete flake.nix

* changed order in which files are processed

Co-authored-by: BattleCh1cken <BattleCh1cken@Larkov.de>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2022-10-30 16:43:32 +01:00
David Knaack d1bc982a37
chore: bump msrv to 1.64 (#4542)
* chore: bump msrv to 1.64

* clippy fix
2022-10-30 11:17:54 +01:00
Thierry Delafontaine d4bcc519e6
feat(guix_shell): Initial implementation (#4397)
* feat(guix_shell): Initial implementation (#3999)

* fix(guix_shell): Change guix nerd font icon to water buffalo emoji

* fix(guix_shell): Added guix_shell entries in preset files

* fix(guix_shell): Moved guix_shell config docs in to the correct place (alphabetically)
2022-10-25 07:44:04 +02:00
Verdayne Graham cdf0d12937
refactor(nu): simplify getting term width (#4503)
refactor(init,nu): simplify getting term width
2022-10-22 14:17:33 +02:00
Liang Yun Gong 5a2c85d078
feat(aws): add a fallback for `expiration` key (#4455)
* feat(aws): add a fallback for `expiration`

* fix(aws): intermittent test failures

- extend the time range from `-2s,0s` to `-5s,+2s`

* fix: `docs/config/README.md` readability

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

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2022-10-15 18:16:07 +02:00
AppleTheGolden 865e68da3a
feat: Open Policy Agent module (#1740) (#4441)
* feat: Open Policy Agent module (#1740)

* Format documentation

* Fix typo, `ropa` -> `rego`

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

* Update presets for OPA module

* Add extra space to OPA module symbol

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2022-10-15 18:15:33 +02:00
David Knaack 186d99e623
fix(status): replace multiply with cross mark emoji (#4461) 2022-10-15 14:16:39 +02:00
nibon7 49995301ce
fix(nu): remove -c parameter from `term size` (#4477)
The -c parameter has been removed through nushell/nushell#6651
2022-10-15 14:16:14 +02:00
Jamie 355800f814
feat(module): Add a meson devenv indicator (#4389)
* feat(module): Add a meson devenv indicator

Adds a Meson Developer Environment indicator, if the MESON_DEVENV
variable is set. Inside a `meson devenv`, the prompt will include the
current Meson project name

This also contains a new Truncate utility function, which may be adapted for other modules in the future

* docs: Add Meson to presets
2022-10-11 18:02:46 +02:00
wilhelm 3d452367bd
fix(buf): fix spacing & harmonize docs with actual configuration (#4450)
* fix(buf): add whitespace after version string

* fix: update config schema

* fix: config version and bison emoji

* fix: update documentation format

* fix: dprint

* fix: config schema
2022-10-07 22:07:30 +02:00
Aaron Kollasch 6e35dfa85a
feat(status): Support formatting of pipestatus separator (#4264)
* Support formatting of pipestatus separator

* Format pipestatus separator with each pipestatus

* Add third exit code to pipestatus test

* Clean up pipestatus mapping

* Add comment that was removed
2022-10-07 11:44:14 +02:00
Robert Edwards 227ec32d9d
perf(directory): Skip repo resolution if unused by directory config (#4401)
Skip repo resolution if its not used by directory config
2022-10-06 09:33:31 +02:00
David Knaack f3fc5efa15
build: bump windows from 0.39.0 to 0.42.0 (#4388)
* build: bump windows from 0.39.0 to 0.41.0

Bumps [windows](https://github.com/microsoft/windows-rs) from 0.39.0 to 0.41.0.
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Commits](https://github.com/microsoft/windows-rs/compare/0.39.0...0.41.0)

---
updated-dependencies:
- dependency-name: windows
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix `AccessCheck` call

* build(dep): bump windows to 0.42.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 12:01:40 +02:00
ccQpein 801fbab720
fix(directory): don't strip duplicate directory names twice (#4295)
* Fix directory issue in a special case

* add None test
2022-09-30 11:03:33 +02:00
David Knaack c5bffb5620
build: bump clap from v3 to v4 (#4413)
* build: bump clap from v3 to v4

* bump
2022-09-29 16:51:56 -05:00
Anomalocaridid d93074d056
feat: add user-defined color palette (#4209)
* docs(config): add color palette to docs

* feat: add user-defined color palette

* fix: update config schema

* refactor: apply suggestions from code review

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

* fix: update new test

* feat: add support for multiple palettes

* docs(config): update docs for multiple color palettes

* docs(config): fix formatting

* test: test overriding a predefined color with itself

* docs: mention palettes cannot reference themselves

* refactor: warn when using a nonexistent palette

* test: test retrieving a nonexistent color palette

* fix: fix issues with palette log messages

* fix: update config schema

* fix: skip serializing palette if none

* refactor: change nonexistent palette message to warning

* fix: update config schema

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2022-09-27 23:08:52 +02:00
David Knaack c69fe4a644
build: bump git-repository from 0.23.1 to 0.24.0 (#4393)
* build: bump git-repository from 0.23.1 to 0.24.0

Bumps [git-repository](https://github.com/Byron/gitoxide) from 0.23.1 to 0.24.0.
- [Release notes](https://github.com/Byron/gitoxide/releases)
- [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Byron/gitoxide/compare/git-repository-v0.23.1...git-repository-v0.24.0)

---
updated-dependencies:
- dependency-name: git-repository
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* add new member to `git::permissions::Config`

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-22 16:34:50 +02:00
David Knaack b5d3d8fcf3
feat(schema): deny unknown keys (#4270) 2022-09-09 14:59:38 +02:00
Rashil Gandhi 06281c268d
feat(fish): Enable left and right transience (#4204)
* feat(fish): Enable left and right transience

* Update README.md

* Mention limitation
2022-09-09 14:56:33 +02:00
David Knaack fd5539796f
fix(pwsh): avoid potential deadlock in init (#4335) 2022-09-08 23:18:50 +02:00
David Knaack 6ac5df904b
refactor: replace `ansi_term` with `nu_ansi_term` (#4339) 2022-09-04 18:44:54 +02:00
David Knaack c40f0e7722
build: bump quick-xml from 0.23.0 to 0.24.0 (#4322)
* build: bump quick-xml from 0.23.0 to 0.24.0

Bumps [quick-xml](https://github.com/tafia/quick-xml) from 0.23.0 to 0.24.0.
- [Release notes](https://github.com/tafia/quick-xml/releases)
- [Changelog](https://github.com/tafia/quick-xml/blob/master/Changelog.md)
- [Commits](https://github.com/tafia/quick-xml/compare/v0.23.0...v0.24.0)

---
updated-dependencies:
- dependency-name: quick-xml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* switch to updated apis

* run cargo update

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-30 22:36:44 +02:00
Sebastian Thiel dd918296e4
build: gitoxide upgrade (#4319)
adjustments to upgrade to gitoxide v0.22.1
2022-08-27 14:24:18 +02:00
David Knaack 5984f0829e
perf(git_commit): only use exact match for tag by default (#4281) 2022-08-19 08:27:41 +02:00
David Knaack 98089bf005
chore(git): improve logging (#4273) 2022-08-18 07:25:11 +01:00
Sebastian Thiel f52ae552d3
fix(git): upgrade `gitoxide` to v0.21 (#4277)
* upgrade `gitoxide` to v0.21

This release comes with lenient configuration handling by default,
allowing to open repositories even their configuration values are
invalid (even for git), as long as there are viable defaults.

Furthermore this release adds the ability to open submodule repsitories.

Fixes https://github.com/starship/starship/issues/4266 and
fixes https://github.com/starship/starship/issues/4272

* Assure an object cache is set to speed up `commit.describe()`

Related to https://github.com/starship/starship/issues/4275 bringing
performance to spitting distance compared to git.
2022-08-18 07:22:51 +01:00
David Knaack 1390036882
fix(aws): support official `AWS_SHARED_CREDENTIALS_FILE` variable (#4242)
* fix(aws): use AWS_SHARED_CREDENTIALS_FILE instead

Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>

* fix tests & keep support for older variant

Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>
Co-authored-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>
2022-08-11 07:48:22 +02:00
David Knaack ac55a01d0f
feat(git): replace `git2` with `git-repository` (#3883) 2022-08-08 22:33:00 -04:00
Artyom Belousov c8a5adb412
feat: Add starship preset command (#4112)
* Add starship preset command

* Use ValueEnum for preset command

* Generate ValueEnum struct in build.rs

* Use absolute paths and refactor codegen

* Use dunce to canonicalize path

* Use raw string literal in include_bytes!

* Use .cloned()

* Apply fixes

* Fix path escaping

* Removed error message if stdout is unavailable

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

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2022-08-02 11:51:15 +02:00
David Knaack 85692d1bf6
feat: add bun module (#4187) 2022-08-01 12:59:36 +02:00
Davin K. Tanabe aaab920f88
feat: Add support for blink, hidden, and strikethrough styles. (#4138)
Add support for blink, hidden, and strikethrough styles.
2022-07-31 16:30:34 +02:00
David Cantrell dd73447329
feat: Add the ability to have some file extensions *prevent* a module from triggering (#4043)
* test that we can match a multi-part file extension such as in foo.tar.gz

* now we can match multi-part file extensions like on foo.tar.gz

* add a test that a !ext is a negative match and over-rides any positive match

* test that negative extensions that don't match any file have no effect

* fail the match if any negative extensions exist

* cargo fmt

I'm not happy with this, in particular it's made the structures of has_any_positive_extension and has_no_negative_extension look different, and the logic in is_match is harder to follow

* placate clippy

* documentation for multi-part extensions and negative extensions

* get rid of an unnecessary .to_string() and comment the necessary but weird-looking invocations of .to_string_lossy().to_string()

* tests for negative matching of files and folders

* fail the match is any negative files/folders match

* document file/folder negative matching; be less prolix

* suppress Nodejs if Deno files are present (#2627)

* Revert "suppress Nodejs if Deno files are present (#2627)"

This reverts commit c1394fd7b37bb0bf06b1449e074020a2e16bfa04.

This was a terrible way of doing this, there's got to be a better way!
2022-07-31 16:29:48 +02:00
Rashil Gandhi 6e9c013e60
feat: Enable transience for Cmd and PowerShell (#4143) 2022-07-24 21:10:40 -05:00
David Knaack 0a1235e279
feat(package): support cargo workspace versions (#4161) 2022-07-20 11:17:27 +02:00
David Knaack d8ac940098
perf(rust): avoid calling `rustup` in more conditions (#4174) 2022-07-20 11:15:46 +02:00
Artyom Belousov 61438484bd
feat(status): Add pipestatus_segment_format option to status module (#4103)
Add pipestatus_segment_format
2022-07-19 15:07:50 +02:00
filip f56955084b
build: bump path-slash from 0.1.4 to 0.2.0 (#4155)
* build: bump path-slash from 0.1.4 to 0.2.0

Bumps [path-slash](https://github.com/rhysd/path-slash) from 0.1.4 to 0.2.0.
- [Release notes](https://github.com/rhysd/path-slash/releases)
- [Changelog](https://github.com/rhysd/path-slash/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rhysd/path-slash/compare/v0.1.4...v0.2.0)

---
updated-dependencies:
- dependency-name: path-slash
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix errors in code after path-slash bump to 0.2.0

* fmt

* refactor contract_path to return Cow<str>

* update contract_windows_style_root_directory test

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-12 11:31:43 +02:00
Thomas O'Donnell 5c5969c50b
feat(k8s): Add folder detection to the k8s module. (#4157)
Have added configuration options to the k8s module to allow activating
the module only in directories that contains certain files or folders.
To ensure this is backwards compatible and because there are not really
any standard files or folders for Kubernetes I have set the defaults to
empty and will activate the module for all directories.
2022-07-10 11:14:54 +02:00
David Knaack af15de93c4
perf(pulumi): allow disabling upwards discovery (#4159)
* perf(pulumi): disable upwards discovery by default

* change `search_upwards` default to `true`
2022-07-10 11:14:43 +02:00
Jan Larres aae1ed04ba
fix(timings): count time spent on custom on 'when' command failure (#4121)
Count time spent on custom 'when' commands
2022-07-08 16:38:26 +02:00
David Knaack eb67534ac9
chore: fix new clippy lints (#4136) 2022-06-30 16:18:29 -04:00
Kian-Meng Ang 018b077630
chore: fix typos in comments (#4122) 2022-06-28 14:19:17 -04:00
David Knaack 277a7cc740
build: bump windows from 0.37.0 to 0.38.0 (#4105)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-26 18:27:45 -04:00
Filip Sergot 1a4fac63f7
feat: add Raku module (#4048)
* feat: add Raku module

* Update docs/config/README.md

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2022-06-26 12:00:55 +02:00
Thomas O'Donnell 67619386cd
fix(character): Standadise Vim config names (#4081)
Have switched all vi/vim symbols to have the same prefix 'vim'. To
preserve backwards compatibility with existing configs I have added an
alias for the previous config name.
2022-06-18 23:23:59 +02:00
yutotnh e7c1976528
docs: fix some typos in comments (#4069)
fix: some typos
2022-06-15 19:55:10 -05:00
David Knaack 009eb93c83
build: bump clap crates to v3.2 (#4067) 2022-06-15 23:31:12 +02:00
David Knaack a72b4638f3
docs(aws): improve legibility (#4050) 2022-06-12 13:27:19 +02:00
Mat Jones 146976351e
fix(fish): add proper vi mode detection for fish shell (#3839)
* add proper vi mode detection for fish shell

* update tests

* fix test

* update config-schema.json

* update docs

* add warning about symbols only supported in fish
2022-06-04 12:41:24 +02:00
Tyler Ruckinger 9b52475e54
fix(nu): don't use `cygpath` for starship binary path in init (#4001)
nu on windows need not be posix
2022-06-02 23:46:46 +02:00
Tobi df5c2d8836
feat(kubernetes): add user alias (#4008)
* add kubernetes user alias (fixes #3870)

* update config schema

* sort config property alphabetically

* Update README.md

* add test-case for non-matching alias
2022-05-30 20:09:53 +02:00
David Knaack 2039931d85
refactor(memory_usage): replace `sys-info` with `systemstat` (#4028) 2022-05-29 16:47:06 +02:00
David Knaack 7d31bac1cc
fix: escape text segments in meta variables (#3563) 2022-05-27 12:36:37 -05:00
Stefano Baghino 3fe6cc023c
feat: Add support for Daml (#4004) 2022-05-26 16:42:31 +02:00
David Knaack 0ae61c7758
chore(clippy): fix new lints (#4002) 2022-05-23 06:58:27 -04:00
Arya Adarsha Gautam 9ebfce1e36
feat(go): check for go.work file to show Go module in prompt (#3968)
* check for go.work file to display go version

* add test to check for go.work file

* update docs to include go.work file

* chore(dprint): fmt & upgrade plugins (#3969)

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2022-05-07 08:04:37 +02:00
Noa 81a696a914
fix: Use git2::Repository::open_ext() instead of discover() (#3591)
This lets starship respect the $GIT_CEILING_DIRECTORIES env var.
2022-05-05 11:43:03 -05:00
Kevin Song 393d62c726
feat(rust): Display toolchain names (#3414)
This is an actualization of PR #559 as originally envisioned by qryxip.

Adds the ability to display toolchain versions, either as extracted from
environment/settings files or by getting the host triple. As part of
this, several other major changes were needed:
- Many of the smaller functions within the code have been fused, moved,
  or dropped.
- The Rustup environmental info is now initialized lazily using
  OnceCells. This will hopefully lead to a performance increase.
- New configuration variables (`toolchain` and `numver`) have been added
  to allow finer-grained configuration.
- Override information is no longer read from `rustup` output. Instead,
  it is parsed from the same files that rustup would use to determine
  this info.

Co-authored-by: qryxip <qryxip@gmail.com>

Co-authored-by: qryxip <qryxip@gmail.com>
2022-05-04 15:40:44 -05:00