1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-09-28 21:19:10 +00:00
Commit Graph

490 Commits

Author SHA1 Message Date
Denis Cornehl
c63e9a71bd
perf(rust): additionally check rustup default for faster result. (#3354)
* perf(rust): additionally check `rustup default` for faster result.

After checking directory overrides we were directly falling back to the
relatively slow call to `rustc --version`.

Inserting a call to `rustup default` leads to a quicker response.

* use `context.exec_cmd` instead of `create_command`
2021-12-28 21:10:49 +01:00
Zhong Liu
8d0cebdcbd
fix(dart): detect version output in stdout with dart 2.15+ (#3349) 2021-12-24 09:43:07 -05:00
Mika Fischer
cb40787e2a
feat(status): Add hex_status (#3312) 2021-12-21 05:05:28 -05:00
Denis Cornehl
006fbf0dd5
fix(aws): prevent endless loop when AWS config file is a directory (#3335)
When opening a directory as a file the intial open works, while
subsequent line-reads will fail with _is a directory_.
Since erroring line-reads were just skipped this lead to an
endless loop.
2021-12-20 21:15:00 +01:00
David Knaack
b4a14e3a80
test(hostname): fix trim_at test with unicode hostname (#3295) 2021-12-09 22:15:25 +01:00
Mikkel Mork Hegnhoj
365b295433
feat(azure): Azure module (#3275)
* Azure module

* make Semantic PR bot happy

* Responding to review

* Changing severity of logging event
2021-12-06 23:01:33 +01:00
arcnmx
e3a88a6ec1
fix(git_branch): more robust handling of .git (#3290) 2021-12-03 15:15:31 -05:00
pejax
1109fd6997
feat: Add package version detection for sbt projects (#3274) 2021-12-03 01:56:06 -05:00
David Knaack
77182a9a22
chore(clippy): fix new clippy lints (#3294) 2021-12-03 00:54:56 -06:00
David Knaack
e18c61cd68
fix(directory): improve truncation detection (#3266) 2021-11-26 13:07:28 +01:00
Ikko Ashimine
337154ad35
chore: fix typo in docker_context.rs (#3265)
enviroment -> environment
2021-11-23 17:56:16 +01:00
Gabriel Victor
779e53cd66
feat(module): Add sudo module (#3135)
* add feature - sudo module

* add sudo module identifiers and entry point

* fix test test_sudo_not_cached

* add test test_sudo_cached

* add `allow_windows` and `binary` options

* rustfmt sudo_x_cached and rmv them on windows

* add false `allow_windows` block windows test

* add `doas` cached/not_cached tests

* better description in `starship explain`

* fix `test_doas_cached` with `-n` flag

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

* rmv `binary` alternatives and their tests

* fix symbol and update config/README

* fix all mocks to use `sudo -n true`

* fix expected output in `test_sudo_cached`

* proper checking for blocked sudo

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

* add `allow_windows = true` to non-windows tests

* allow sudo_* tests to run on windows + fix parsed

* rustfmt `blocks_windows` test

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2021-11-15 06:46:13 +01:00
cbolgiano
8d80d2ef06
feat(python): Show value of PYENV_VERSION when present (#3144)
* 2872: Show value of PYENV_VERSION when present

* 2872: Run cargo fmt
2021-11-09 21:55:53 +01:00
t-mangoe
b07abc990e
feat: style git repo root (#2010) 2021-11-09 14:12:40 -05:00
Matan Kushner
9df7c7d256
fix: replace battery with starship-battery (#3213) 2021-11-09 06:35:45 -05:00
Aaron Kollasch
d1ce352528
feat(ruby): Add environment variable checks to ruby module (#3206)
* feat(ruby): Add environment variable checks to ruby module

* docs(ruby): describe version detection method
2021-11-08 21:21:09 +01:00
David Knaack
4ee1bdc2a4
fix(memory_usage): remove duplicate % handling (#3193) 2021-11-01 22:19:27 +01:00
Fred Cox
c1f2d345aa
fix(escaping): move escaping to individual variables (#3107) 2021-11-01 22:18:45 +01:00
Thomas O'Donnell
39e7b78cb2
feat: also read from DOCKER_MACHINE_NAME (#3175)
This adds support to also read the context from `DOCKER_MACHINE_NAME`
since it is a bit more user friendly.
2021-10-25 07:54:39 +02:00
Aman Kumar Sinha
eb203ebe95
feat(fill): add disabled option for fill module (#3158)
* add disabled option for fill module

* update tests

* update docs
2021-10-21 14:27:32 +02:00
vypxl
614e0e2763
feat(package): Add support for crystal shards (#3147)
* add crystal shard (package) version support

* module package: crystal shard version: read shard.yml directly

* module package: add test for crystal shard version

* format src/modules/package.rs

* use yaml-rust instead of serde-yaml

* document shards package support

* Update docs/config/README.md

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

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2021-10-13 07:42:55 +02:00
Ian Wahbe
dfb1208787
feat: Add pulumi module (#3055) 2021-10-05 18:27:25 -05:00
Aman Kumar Sinha
f8e81a1622
feat(shell): Add style config for shell module (#3108)
* add style config for shell module

* update shell docs

* fix formatting

* update tests
2021-10-04 19:46:33 +02:00
David Knaack
68694029c4
fix(status): Don't show status if all exit codes are 0 (#3109)
* fix(status): Don't show status if all exit codes are 0

* fix tests
2021-10-03 16:03:09 +02:00
David Knaack
20af85f0a8
docs(modules): add missing module descriptions (#3081) 2021-09-17 16:16:02 -05:00
Tom Most
bbb8d3c357
fix(package): Ignore setup.cfg attr: and file: (#3054)
The setup.cfg version key allows "attr:" and "file:" directives to load
the actual value from elsewhere [1]. Treat these as if no version was
found, since the text of the directive isn't the version number we're
after.

[1]: https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html#specifying-values
2021-09-14 12:17:05 -05:00
Matthew (Matt) Jeffryes
5d0a38aca3
feat: Add a fill module to pad out the line (#3029) 2021-09-12 19:59:15 -04:00
David Knaack
5ac7ad741f
fix(zsh): always escape percent character (#3058) 2021-09-12 19:55:46 -04:00
Bill
08b5cd0862
feat(cobol): added COBOL module (#2994)
* feat: added COBOL module

* slight README fix

* added command faking for COBOL

* updated COBOL symbol to better suit language

Co-authored-by: Bill Risher <bill@encephaloinvestments.com>
2021-09-07 09:59:14 -05:00
Marcin Puc
6598275e15
refactor: simplify iterator usage (#3017) 2021-09-02 11:48:29 -04:00
Thomas O'Donnell
3933553486
fix(status): Showing exit code 0 with pipelines (#3028)
Have fixed a bug there the status module was showing when the exit code
was 0.
2021-09-02 00:18:44 +02:00
filip
6b13296741
feat(git_metrics): Git metrics show only nonzero diffs (#2887)
* implement only_nonzero_diffs configuration option

* update documetation
2021-08-27 09:38:46 -05:00
filip
1c9758f08b
style: Improve modules consistency (#3006)
* cmake - consistent parse version method names

* crystal - consistent parse version method names

* dart - consistent parse version method names

* deno - consistent parse version method names

* golang - consistent parse version method names

* helm - consistent parse version method names

* implement get_command_string_output, java - consistent parse version method names & small refactor

* julia - consistent parse version method names

* kotlin - consistent parse version method names and refactor

* lua - consistent parse version method names and refactor

* implement get_command_string_output for scala

* format crystal module

* remove outdated comment

* node use format_module_version

* terraform - consistent parse version method names

* vagrant - consistent parse version method names

* format

* refactor python module

* improve rlang module consistency

* fix clippy warning
2021-08-25 10:41:10 -05:00
David Knaack
9d3ec93d82
refactor: allow passing OsStr as-is to exec_cmd (#2997) 2021-08-23 18:49:30 +02:00
Elia Geretto
2e9223dd8c
fix(git_status): show working tree status if index status is present (#2973) 2021-08-18 19:55:40 +02:00
Thomas O'Donnell
9e5fcd1e14
feat(red,vlang): Add version formatting (#2987)
Have added version formatting to the red and vlang modules. Note the
docs for red already mentioned the `version_format` string but it had
not actually been added.
2021-08-15 21:30:58 +02:00
Alexander González
7038ae2ec8
fix(jobs): Add the symbol and number thresholds respecting the threshold option (#2908)
* feat: Add the symbol and number thresholds respecting the threshold option

* fix: Maintain the old behavior + add lots of tests

* docs: Fix the jobs module documentation
2021-08-14 15:29:25 +02:00
filip
3139c6b8a3
feat(git_status): dont render module output if not in git repository (#2897)
* refactor get_repo method to not swallow error

* module git status don't render if not in git repository
2021-08-14 15:19:43 +02:00
Bill
b2e2330cb0
feat(git_status): added symbol for local repos up-to-date with remote. (#2945)
* git_status: added symbol for when local branch is up-to-date with upstream

* updated docs

* removed unused variable, moved location of config comment

* changed uptodate default to empty string, simplified and made safer

* added uptodate default line back into docstring

* fixed linting and formatting errors

* refactored uptodate to up_to_date, removed redundant else statement
2021-08-07 19:22:00 +02:00
Thomas O'Donnell
b7b7df9885
feat(package): Add ability to format the version (#2959)
Have added the ability to use format the version of the package using
the `version_format` option. While doing this I have also done some
refactoring of the module to remove the if/else if/... block and replace
it with an iterator. This should make fix some edge cases where versions
are not correctly picked up due to other files an example would be a
python project that has a `pyproject.toml` file but using the
`setup.cfg` for the package version. It should also make it easier to
make the order of the list configurable in the future.
2021-08-06 21:16:14 +02:00
David Herberth
cd6fc9cea0
feat(kubernetes): implements regex matching for context aliases (#2883) 2021-08-03 23:56:28 +02:00
filip
b1db771baa
fix(rlang): module not working on MacOs (#2880)
Fix rlang module and refactor other modules to use new method.
2021-08-02 13:13:29 -04:00
David Knaack
af43aeefba
fix(clippy): fix new clippy lints (#2939) 2021-07-29 14:27:46 -04:00
Hugues Morisset
40cb667b9d
feat(status): Add pipestatus display in status module (#2481)
* feat: Add pipestatus display in status module

This MR is based on this one https://github.com/starship/starship/pull/370

* Documentation

* Add a test with map_symbol false

* Handle bash preexec pipestatus

* Add zsh support

* Add fish support

Thanks kidonng for the diff patch

* Rename sucess_symbol to success_symbol
2021-07-28 12:26:00 -04:00
Tom
2fa7f56cec
feat(package): Support package version from setup.cfg (python). (#2890)
* Support package version from setup.cfg (python).

Add an additional package version extraction function to parse
the 'version' attribute under the 'metadata' section in a python
package 'setup.cfg' file.

Also add similar tests from the poetry extraction function to test
the desired behaviour.

This adds a dependency on ConfigParser:
https://crates.io/crates/configparser.

* Clean up comments

* Use rust_ini over ConfigParser

* Add mention to setup.cfg version parsing in docs
2021-07-27 17:58:35 +02:00
Jeremy Schlatter
b1dcd5aecd
feat: add support for xonsh (#2807)
* feat: add support for xonsh

* xonsh: add STARSHIP_SESSION_KEY

* xonsh: implement STARSHIP_SESSION_KEY in xonsh

* docs: mention tcsh, elvish, and nu in more places

* xonsh: change STARSHIP_SESSION_KEY implementation

See https://github.com/starship/starship/pull/2807#discussion_r667064149

* xonsh: fix jobs implementation

* xonsh: do not silently discard stderr from starship
2021-07-16 15:25:01 -04:00
David Knaack
1eaf996a36
fix(windows): avoid inadvertly running exes from cwd (#2885)
On Windows when running commands with their name instead of the path with Command::new, executable with that name from the current working directory will be executed.

This PR replaces all instances of Command::new with a new create_command function which will first resolve any executable paths and avoid this issue.
2021-07-16 15:20:59 -04:00
filip
88ed0ed45a
feat(env_var): allow multiple instances (#2797)
Allows displaying multiple instances of the env_var module.
2021-07-13 17:06:08 -04:00
Alexander Gonzalez
9f337d15e7
feat: Add the git_metrics module (#2827)
This PR adds a new module named git_metrics. It shows the added/deleted lines in the current git repository following the format: "[+$added_lines]($added_style) [-$deleted_lines]($deleted_style)".
2021-07-10 16:54:34 -04:00
Thomas O'Donnell
9e2da88d95
fix(git_status): Fix when the worktree != root dir (#2831)
Have updated the git_status module to work if the worktree has been
changed to a different directory than the repository root directory.
2021-07-05 17:19:09 -04:00