Commit Graph

84 Commits

Author SHA1 Message Date
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 6d0dc577d5.

* 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
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
Baku Kim
36134d896b
feat(python): detect pixi and ipynb files (#6228) 2024-09-26 10:53:18 +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
David Knaack
cfc58161e0
Merge commit from fork
addresses GHSA-vx24-x4mv-vwr5
2024-07-26 19:31:41 +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
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
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
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
df65b2155f
feat(os): add new os symbols (#5849) 2024-03-21 12:39:28 +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
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
Andrew Pantuso
e47bfbabb9
feat(direnv): add new direnv module (#5157) 2023-12-17 08:22:29 +01:00
Stefan Richter
6d96df3c68
feat(aws): Adding the AWS SSO CLI env variable to profile list (#5640)
Adding the AWS SSO CLI env variable to profile list

Adding support for the profile env variable used by https://github.com/synfinatic/aws-sso-cli
2023-12-17 08:20:58 +01:00
Jan Gorecki
5267c464eb
feat: R lang packages version, remove .Rprofile from rlang detection (#5588)
* do not detect R for .Rprofile files, closes #2817

* get R package version, #5586

* update schema

* fix and simplify regex for rlang package version

* attempt to fix regex

* proper detect R packages, closes #5590

* reduce diff vs master branch
2023-11-29 07:25:40 +01:00
Gilbert Sanchez
d7a34b45f8
feat(shell): allow distinguishing between pwsh and powershell (#5478)
* Distinguish between pwsh and powershell

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2023-11-25 14:06:03 +01:00
Charlotte Thomas
7b217056bd feat: add typst module
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2023-11-12 19:02:31 +01:00
Ohad Lutzky
7b851fc30e
feat(scanner): add option not to follow symlinks (#5325)
Add follow_symlinks option

Settings this to false can fix hanging on symlinks to slow/inaccessible
filesystems.
2023-11-02 09:01:09 +01:00
Mick Hohmann
43b2d42cd5
feat(hostname): add detect_env_vars as option (#5196)
* Added hostname.detect_env_vars

based on the newly added context::detect_env_vars

- extended context::detect_env_vars to check for negated environment
  variables as well, analogous to the other detect modules
- made hostname.detect_env_vars only active if ssh_only is set to false
  for backwards compatibility

Co-authored-by: Dominik Sander <dsander@users.noreply.github.com>

* added clippy recommendations, removed unneeded comments

* Added new logic (suggested in https://github.com/starship/starship/pull/5196#issuecomment-1566228913)

The new `detect_env_vars` now requires either SSH_ONLY to be false or the
environment variable SSH_CONNECTION to be set, so that is will be used

* Fixed typo

* Refactored the detect_env_vars function for early returns and better readability

* Change boolean logic for better readability

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

* Apply suggestions from code review to `detect_env_vars` method.

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

* Fixed bracket error & updated comments

- fixed bracket error in hostname.rs, after changes
- updated comments for context.rs, for the suggested changes

* Removed obsolete warning from docs/config/README.md

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

---------

Co-authored-by: Dominik Sander <dsander@users.noreply.github.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2023-09-16 16:42:13 +02:00
Jan Katins
6b444e05c6
feat(kubernetes): Add styling based on current context (#4550)
* feat(kubernetes): Add styling based on current context

Add an ability to customize the configuration of the kubernetes module style, based on the current context.

A new variable is added to the config section, called environments, which is a list of possible customizations. Each such customization is an object with a context_pattern regex, which matches context name, and an optional style and icon that will override the global configuration, if the currently used context matched the context_pattern.

Based on multiple attempts to add per-context styling and symbols to the kubernetes module.

- https://github.com/starship/starship/pull/1568 by @lht https://github.com/lht -> base
- https://github.com/starship/starship/pull/614 by @nomaed https://github.com/nomaed -> naming, symbol, some tests

Rebased and combined by @jankatins

Contains the following squasched commits

- Rename to contexts and move aliases into contexts
- Move deprecated functions to a submodule
- Cleanup: ignore None-valued KubeCtxComponents
- Add regex func + clean up matching-context search
- Placate paper clip

Closes: https://github.com/starship/starship/issues/570

Co-authored-by: =?UTF-8?q?Boris=20Aranovic=CC=8C?= <nomaed@gmail.com>
Co-authored-by: Jan Katins <jasc@gmx.net>
Co-authored-by: Kevin Song <chips@ksong.dev>

* refactor(kubernetes): Remove options and use clearer names

* test(kubernetes): Handle duplicated contexts right

* refactor(kubernetes): Cleaner user matching

* fix(kubernetes): Only show warning in case of problems

* feat(kubernetes): Add back alias replacements

* refactor(kubernetes): Cleanup rust usage

---------

Co-authored-by: Haitao Li <lihaitao@gmail.com>
Co-authored-by: =?UTF-8?q?Boris=20Aranovic=CC=8C?= <nomaed@gmail.com>
Co-authored-by: Kevin Song <chips@ksong.dev>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2023-09-02 09:19:33 +02:00
Vegard Skui
e867cda1eb
feat(fossil_metrics): add fossil_metrics module (#4874)
* feat(fossil_metrics): add fossil_metrics module

* Return early if not in a Fossil check-out

* Add more tests for fossil_metrics

* Move is in Fossil checkout check after module enabled check

* Update type for new toml version

* Update the config file schema

* Rework parsing of fossil diff output

* Fix Fossil check-out detection in subdirectories

* Use regex to only match expected fossil diff output

* Use shared ancestor scanning and fix detection on Windows

* Add note on minimum Fossil version
2023-09-02 09:19:04 +02:00
Vivek Kushwaha
3402f0e82a
feat(shlvl): add repeat_offset for repeated symbol (#5289)
Signed-off-by: Vivek Kushwaha <yoursvivek@users.noreply.github.com>
2023-07-14 10:59:02 +02:00
marcybell
351bf9d0b3
feat(golang): adding mod_version variable (#5177) 2023-06-01 21:18:38 +02:00
Mick Hohmann
2558c4588b
fix: update of presets and default configuration to reflect changes in Nerd Fonts 3.0 (#5162)
* Updated nf-mdi-* to nf-md-* symbols

The following symbols where changed
- directory.read_only
- memory_usage
- meson
- nim
- os.symbols.Garuda
- os.symbols.HardenedBSD
- os.symbols.Illumos
- os.symbols.OpenBSD
- os.symbols.OracleLinux
- os.symbols.Redox
- os.symbols.Solus
- os.symbols.Windows
- package
- rlang

* Updated nf-mdi-* to nf-md-* symbols (for all other presets)

The following symbols where changed
for pastel-powerline:
- directory.substitutions.Documents
- nim
for tokyo-night
- directory.substitutions.Documents
- golang

* Updated nf-mdi-* to nf-md-* symbols for the default configuration in modules in src/configs/*.rs

The following symbols where changed
- azure
- battery.full_symbol
- battery.charging_symbol
- battery.discharging_symbol
- battery.unknown_symbol
- battery.empty_symbol

* Updated config-schema.json

* Updated src/modules/*.rs docs/config/README.md

and used `nerdfix` to check if I overlook anything

* Fixed the battery discharging symbol in the tests

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jtrv <travershasemail@gmail.com>
2023-05-10 14:36:56 +02:00
Denis Cornehl
d07a8e3668
feat(gcloud): add detect_env_vars option (#5166)
* feat(gcloud): add `detect_env_vars` option

* regenerate config schema
2023-05-09 07:55:49 +02:00
AnirbanHalder654322
b2ebd5b50c
feat: Add Solidity Module (#5047)
* Adding documentation

* Documentation and schema addition

* Creating solidity config

* Module for solidity lang

* Updating all the files

* Changing according to clippy

* Fixing misspellings

* Changes suggested by clippy

* Updating schema , maybe fixing docs workflow error

* Updating schema

* Removing solcjs from default compiler list

* Fallback test added and test string fixed

* Fixing docs

* Updating schema

* Updating schema

* Fixing docs

* Updating schema

* Updating schema

* Typo fix

* Update docs/config/README.md

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

* Update src/utils.rs

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

* Fix build commit

---------

Co-authored-by: Anirban Halder <shaeo967@gmail.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2023-04-13 21:05:12 +02:00
Colton Donnelly
ce01423152
feat(git_metrics): add option to ignore submodules (#5052)
* add docs

* update schema

* ok, actually update schema

* add test

* fix lint

* accidentally included my .devenv directory
2023-04-13 21:04:15 +02:00
marcybell
27ffa37cfd
feat(azure): subscription name aliases (#4949)
* From issue #4448, added `subscription_aliases`
as a field for the Azure module

Can be set in starship.toml with
[azure.subscription_aliases]

* Updated config file schema

* Added entry into documentation

* Update README.md

* Formatted with dprint
2023-04-13 21:03:14 +02:00
Chad Denyar
edb96cad58
feat: add typechange to git_status module (#4829)
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2023-04-13 21:02:08 +02:00
David Knaack
b475b5809f
build(deps): update rust crate os_info to 3.7.0 (#5057)
* build(deps): update rust crate os_info to 3.7.0

* add new os symbols

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-10 13:07:30 +02:00
jliaoh
d29ce7c45d
feat(custom): add option to check if pwd is in a repo (#4822)
* feat(custom): add option to check if pwd is in a repo

* Apply suggestions from code review

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

* change whenrepo to require_repo

* chore: fix doc formatting

---------

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2023-04-02 16:39:45 +02:00
Zhizhen He
0f8a2d9363
chore: add spell checker to workflows (#4975)
* chore: add spell checker to workflows

* fix: update config schema

* fix: revert for fennel.rs
2023-03-22 13:42:46 -05:00
Harry Hodge
74ce7fdbee
feat(aws): Adds support for AWS_CREDENTIAL_EXPIRATION environment variable (#5002)
feat(aws): supports AWS_CREDENTIAL_EXPIRATION environment variable

Adds support for the AWS_CREDENTIAL_EXPIRATION environment variable
which was adopted as the standard way to set the expiration for
temporary credentials. The existing AWS_SESSION_EXPIRATION environment
variable is not dropped for backwards compatibility.

See https://github.com/aws/aws-cli/pull/7398
2023-03-20 21:56:12 +01:00
iuhoay
07c2298965
feat(java): Add .sdkmanrc for Java (#4888)
* Add `.sdkmanrc` for Java

* Update config-schema.json, Add `.sdkmanrc` file for Java

* Update doc
2023-02-11 14:06:21 +01:00
David Knaack
c019630653
build(deps): update rust crate os_info to 3.6.0 (#4878)
* build(deps): update rust crate os_info to 3.6.0

* add new os symbols

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-07 12:52:14 +01:00
Vegard Skui
41eb98b310
feat(fossil_branch): add fossil_branch module (#4806)
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2023-01-31 09:06:46 +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
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
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
fold-squirrel
e93dbf8630
feat(fennel): add fennel module (#4717) 2022-12-21 10:53:53 -06:00