summaryrefslogtreecommitdiffstats
path: root/src/module.rs
AgeCommit message (Collapse)Author
2021-07-10feat: Add the `git_metrics` module (#2827)Alexander Gonzalez
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-02style: enforce ALL_MODULES ordering in test (#2837)Andrew Houts
* style: enforce ALL_MODULES ordering in test * use unstable sort * use copied instead of dereferencing in iterator
2021-05-25feat(r-lang): add module for R programming language (#1475)Jimmy Royer
* feat(formatter): Allow scoped variables (#1094) * feat: Allow scoped variables , with the following improvements to the format string parser. - Add documentation to spec - Simplify some syntax in the spec - Rewrite for loop with iterators * Added support for R programming language. * Removed unnecessary debug log used during dev process. * Make the `R` command upper case as the *nix OS executables are case sensitives and the correct command is upper-case. * Changed comments to reflect R features (rather than node.js where code was coming from). * feat(format_string): Allow positional segments (#1138) * feat(format_string): Allow using variables in a style string (#1130) * fix(format_string): Allow multiple variable mappers (#1142) * refactor: Add error handling to variables (#1148) * Squashed commit of changes with meta variables: commit 5beb3bca18f0b0c822b740afb3778ccb1e3a7d19 Author: heyrict <xiezh0831@yahoo.co.jp> Date: Mon Apr 27 09:52:59 2020 +0800 fix: Cache variables in meta variables properly commit 49b9324942dd55350c87107d0e8c7d1592d92e8a Merge: cc575bc 260a1ab Author: heyrict <xiezh0831@yahoo.co.jp> Date: Sun Apr 26 21:34:52 2020 +0800 Merge branch 'feat/format-string' into meta-variables commit cc575bc27cbf87c4197e96d2fa5416d4932e45d7 Merge: 3ed2d32 e0c1901 Author: heyrict <xiezh0831@yahoo.co.jp> Date: Sun Apr 26 12:16:12 2020 +0800 Merge branch 'feat/format-string' into meta-variables commit 3ed2d326c9f625930bdd72cea736c1d0eab6d381 Author: heyrict <xiezh0831@yahoo.co.jp> Date: Sun Apr 26 11:06:28 2020 +0800 refactor(format_string): Allow returning error in variable mapper commit 766732fe697df947538fe12ca92a8eb8e7bfea3e Author: heyrict <xiezh0831@yahoo.co.jp> Date: Sat Apr 25 22:56:02 2020 +0800 fix: Add test for StyleVariableHolder commit 444334ad206a68132fa6257b83c3992b7b790981 Merge: 479d4a7 9796a66 Author: heyrict <xiezh0831@yahoo.co.jp> Date: Sat Apr 25 22:52:27 2020 +0800 Merge branch 'positional-segments' into style-variables commit 9796a66a9679597676e7fd859197fd542e8042dc Author: heyrict <xiezh0831@yahoo.co.jp> Date: Sat Apr 25 22:51:26 2020 +0800 test: Add tests for VariableHolder commit 479d4a72fa58fd8aa777acd8228d4834407a7b6a Author: heyrict <xiezh0831@yahoo.co.jp> Date: Sat Apr 25 22:41:47 2020 +0800 feat: Add trait StyleVariableHolder commit 21d40c6f4e2d12b34fdec4e2e38b6ad0f91217a3 Merge: 3b459f4 e7dd987 Author: heyrict <xiezh0831@yahoo.co.jp> Date: Sat Apr 25 22:17:11 2020 +0800 Merge branch 'positional-segments' into style-variables commit e7dd987fd7b01a82c6012ba7055d1dd9b5fd84aa Author: heyrict <xiezh0831@yahoo.co.jp> Date: Sat Apr 25 15:10:12 2020 +0800 misc: Minor changes on docs and codes commit 71020b0397a86e850ad5beda926aa9416250025c Author: heyrict <xiezh0831@yahoo.co.jp> Date: Fri Apr 24 20:51:45 2020 +0800 feat(format_string): Add syntax for positional segments commit 3b459f4379b08defce50c57a903502513ad1b2b6 Author: heyrict <xiezh0831@yahoo.co.jp> Date: Wed Apr 22 17:49:15 2020 +0800 fix: Fix clippy commit 2fb052d68cb46680c081f5a0e25e2c3fbdc9e204 Author: heyrict <xiezh0831@yahoo.co.jp> Date: Wed Apr 22 17:02:09 2020 +0800 feat: Add map_style method to feed values in style string * fix: Change error type of StringFormatter::new * fix: Fix rustfmt * tests: Add tests to variable errors * docs: Add documentation * chore: Rename positional to conditional (#1166) * docs: Add docs for format strings (#1083) Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com> * refactor(rust): Use format strings (#1063) * Updated to latest string formatter's changes. * feat(format-string): add format string support to battery module (#1158) * update battery module with format string * update battery module docs * update battery module with format string * update battery module docs * fix battery module with new StringFormatter api * fix clippy warnings * Update docs/config/README.md Co-authored-by: Zhenhui Xie <xiezh0831@yahoo.co.jp> * battery symbols now supports format-string * battery symbols now support format-string remove space between symbol and percentage fix battery config Co-authored-by: Zhenhui Xie <xiezh0831@yahoo.co.jp> * refactor(golang): Use format strings (#1066) * refactor(golang): Use format strings * docs(golang): Update docs * docs(golang): Update docs * fix: Update to upstream API changes * docs(golang): Update docs Co-authored-by: heyrict <xiezh0831@yahoo.co.jp> * Fixed a few inconsistencies. * Removed string clone in favor of a reference. * Update src/modules/r.rs Reverting the r version string formatting to a more idiomatic way of handling it. Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com> * Update src/configs/r.rs Co-authored-by: Zhenhui Xie <xiezh0831@yahoo.co.jp> * Updated documentation to reflect changes in config. * refactor(java): Added formatter support for Java module. (#1084) * refactor(haskell): Added formatter support for the Haskell module. (#1111) * Added formatter support for the Haskell module. * Updated haskell module with latest formatter code changes. * Changed documentation for latest Haskell string formatter changes. * Fixed a few inconsistencies. * Removed unnecessary variable cloning for using reference instead. * refactor(env_var): Added formatter support for the env_var module (#1180) * refactor(memory_usage): Added formatter support for memory_usage module (#1182) * Migrated the memory usage module to string formatter' support. * Fixed a few inconsistencies. * Removed cloning of variables to instead use references. * refactor(cmd_duration): Use format strings (#1200) * Fixed format issue in code. * Fixed compilation error after adding new 'r' module in root config. * Added .Rproj extension file to be detected with R prog lang. * Aligned R module code with existing ones. * Update src/configs/r.rs Co-authored-by: David Knaack <davidkna@users.noreply.github.com> * fix: Added rconfig to fullconfig and fixed broken api calls * Apply suggestions from code review Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Update src/modules/r.rs Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Addressed PR comments. Cleaned up code and fixed code errors. * Updated docs for consistency purpose. Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com> * refactor: Renamed the `r` module to `rlang` * test: Provided R fixture and R module renderer test * doc: Updated rlang mod config to reflect latest detection changes * fix: Added missing rlang entry in config/mod * feat: Added version formatted fined grained configuration * Added version_format in R lang documentation. Co-authored-by: David Knaack <davidkna@users.noreply.github.com> * review: Addressed later comments * fix: README was missing a previously present section for Python * Fix: Test was not updated for previous version string upgrade. * fix: Upgraded R version in remaining test. Co-authored-by: Zhenhui Xie <xiezh0831@yahoo.co.jp> Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com> Co-authored-by: Luca Rinaldi <lucarin@protonmail.com> Co-authored-by: John Letey <johnletey@gmail.com> Co-authored-by: Tilmann Meyer <47182955+ATiltedTree@users.noreply.github.com> Co-authored-by: David Knaack <davidkna@users.noreply.github.com> Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
2021-05-03feat(vlang): create module (#2577)Milo
* Add V module * Format * Fix tests * fix typo * Update src/configs/v.rs Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Update docs/config/README.md Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Update docs/config/README.md Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Update docs/config/README.md Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Use blue bold * v -> vlang * change docs * More vlang fixes * add package support for v * Update docs/config/README.md Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * use regex * Update src/configs/mod.rs Co-authored-by: David Knaack <davidkna@users.noreply.github.com> * apply patch * fix Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2021-04-20feat(red): create module (#2599)Milo
* create module * fmt * fix clippy * fmt even though i already did it * add all extensions * tests for .reds * change from circle to triangle * remove hi.red * fix test name * update variables * fix comment * Update docs/config/README.md Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Update docs/config/README.md Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * apply patchs Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>
2021-04-15feat(deno): create module (#2565)Milo
* Add deno module * Update docs * Update src/utils.rs Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Update src/modules/deno.rs Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Update src/modules/deno.rs Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Update src/modules/deno.rs Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Update src/modules/deno.rs Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * run rust fmt * Use deno -V * fmt * Fix deno module * do clippy * Update src/configs/deno.rs Co-authored-by: David Knaack <davidkna@users.noreply.github.com> * Update src/modules/deno.rs Co-authored-by: David Knaack <davidkna@users.noreply.github.com> * Update docs/config/README.md Co-authored-by: David Knaack <davidkna@users.noreply.github.com> * Fix test and docs * Remove unused code * fmt * update configs * Add more tests * Update docs/config/README.md Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2021-03-28feat(vcsh): Add new module for VCSH (#2513)Caleb Maclennan
* feat(vcsh): Implement new VCSH module * test(vcsh): Add unit tests for VCSH module * docs(vcsh): Document VCSH module
2021-03-14feat(scala): Add scala module (#2409)Beni Ben zikry
* Add support for scala ( w/o sbt ) * Add scala description * Change scala color to bold red * update scala extensions in README * failed lint * cr changes ( regex, simplify parsing, imports ) * Scala readme punctuation Co-authored-by: David Knaack <davidkna@users.noreply.github.com> Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2021-02-27feat: add support for tcsh (#2288)Vivek Malneedi
* feat: add support for tcsh * add tcsh to install.sh install message * list tcsh in bug_report.rs and main.rs * quote starship path Co-authored-by: David Knaack <davidkna@users.noreply.github.com> * fix job count * add tcsh support to shell module * fix STARSHIP_START_TIME undefined error * preserve existing user precmd and postcmd, remove jobs support * remove unnecessary parentheses * minor script improvement * removes parens from install script message * Update docs/config/README.md Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com> Co-authored-by: David Knaack <davidkna@users.noreply.github.com> Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2021-02-20feat: create shell module (#2329)Mikołaj Rosowski
* Add the shell module This module allows to quickly identify which shell is currently used, in case someone frequently switches between them. * Updated documentation with shell module. Co-authored-by: mro <mro@fedorabox.localdomain>
2021-01-30feat(vagrant): Add support for Vagrant (#1812)Furkan Türkal
Signed-off-by: Dentrax <furkan.turkal@hotmail.com> Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com> Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-12-26feat(kotlin): Add the kotlin module (#2026)Nicola Corti
Add a module to show the currently installed Kotlin version if a .kt/.kts file is found in the current folder
2020-10-27feat(lua): Add a Lua module (#1815)Shu Kutsuzawa
* feat: add lua module * docs: add lua module * fix: lua version test * feat: lua module can be detected if the current dir contains a "lua" dir * feat: enable to use luajit * fix: improve regex * fix based on https://github.com/starship/starship/pull/1815#discussion_r510932742 * fix based on https://github.com/starship/starship/pull/1815#discussion_r511362581 * fix based on https://github.com/starship/starship/pull/1815#discussion_r510941252
2020-10-24feat(openstack): Add module for OpenStack (#1664)Mauricio Teixeira
* first (crude) attempt to implement the openstack module * Attempt to follow OpenStack standards for clouds.yaml location * fmt * provide unittest * add documentation * fix fmt * fix clippy * fix clippy * fix fmt * fix small nitpicks * expand openstack explanation * load config file using find_map * fix fmt * add test for valid config, plus fix test for invalid config * fix fmt * re-add forgotten comment
2020-09-26feat(status): add the status module (#1651)Jan Katins
* add the exit code module this allows to display more precisely the last command exit code and to configure starship to not change the last charcter of the prompt even in case of failure. It is disabled by default, because it seems a bit redundant with the character module in its default configuration. * rename exit_code module to status * Enforce a default disabled=true In the outer places, we only check for the disabled flag in the config toml file, only when this is loaded into the real config struct, we see the default. And if the default is true, we have to abort at that place. For status and hg_branch that wasn't so. I also commented the rest * fix spaces in markdown table for status module * Add a tip that status module is disabled by default Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com> * Remove unrelated changes for default disabled=true Co-authored-by: Gaëtan Lehmann <gaetan.lehmann@gmail.com> Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-09-21feat: Add timings subcommand (#1629)Jan Katins
* feat: Add computational duration to all computed modules This also means that in case we do some computations and these end up empty, we submit an empty module * feat: Add timings subcommand This outputs the timings of all computed modules, sorted by the duration it took to compute the module. Useful for debugging why the prompt takes so long. * feat: Add timings to explain output * fix: Ensure that even empty custom modules get timings * format main.rs * feat: Only show interesting timings * fix(tests): Change tests to look for empty string instead of None * Use proper wording in timings help * Revert "fix(tests): Change tests to look for empty string instead of None" This reverts commit aca5bd1b03c48e1dee1b7ca91d66e2bda2d5a97c. * fix(tests): Returning None in case the module produced an empty string * fix: Ensure that linebreaks (and space) make a module not-empty * Make cargo clippy happy * Make Module.duration a proper Duration * Only return a module if we would report it * Change to cleaner way to return None for empty modules * Avoid unnecessary module creation * Simplify a string comparison * Add timings to trace Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com> Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-09-08fix: use suffixes for modules before directory (#1645)Matan Kushner
Previously, all modules would have prefixes, which lead to the first module having a dangling prefix. This change ensures that the first few modules would instead have suffixes so that we don't start or end with a prefix or suffix.
2020-08-16chore: remove unused name from Segment and remove some of the misleading ↵Tilmann Meyer
underscores (#1584) * chore: Remove unused name from Segment and remove some of the misleading underscores * chore: Access members of `Segment` directly
2020-08-05feat(shlvl): Add shlvl module (#1385)Daniel A. White
* initial commit of support for shlvl * documentation for shlvl * use a symbol instead * test coverage for shlvl * actually disable when the config says to * fix docs * tweak defaults some * refactor from pr comments * redisable * return early to avoid indenting * make default suffix empty space * fixing tests after suffix change * updating docs for format * making shlvl compatible with formatting * adding variables table for shlvl * removing extra line * doc clarity
2020-08-04feat(perl): Added perl version module (#1382)Stéphane Benoit
Adds a module for perl support.
2020-08-03feat: Add gcloud module (#1493)Takahiro Tsuruda
* feat(gcloud): Add document of gcloud module Signed-off-by: dulltz <isrgnoe@gmail.com> * feat(gcloud): Add gcloud module Signed-off-by: dulltz <isrgnoe@gmail.com> * feat(gcloud): Add test for gcloud module Signed-off-by: dulltz <isrgnoe@gmail.com> * Apply the comment https://github.com/starship/starship/pull/1493\#discussion_r456965413 Signed-off-by: dulltz <isrgnoe@gmail.com>
2020-07-29feat(dart): add Dart module (#1392)Dario Vladović
2020-07-29feat(swift): add Swift module (#1261)Dario Vladović
2020-07-17feat(helm): Add Helm module (#1463)Batuhan Apaydın
Signed-off-by: Furkan <furkan.turkal@hotmail.com> Co-authored-by: Furkan <furkan.turkal@hotmail.com>
2020-07-09feat(cmake): Add CMake module (#1456)Tilmann Meyer
* feat: CMake module * docs: Document symbol variable
2020-07-07feat: refactor modules to use format strings (#1374)Zhenhui Xie
2020-07-06fix!: remove haskell module (#1418)Matan Kushner
Given how slow the Haskell module is (#1240), it is slowing down the entire prompt from rendering when the module is active. This commit removes the module until we can find a faster way to retreive the Haskell version.
2020-06-09feat(nim): Add Nim module (#1189)Rekihyt
* Nim module and tests * Add nim to docs * parse_nim_version refactor, add nim desc * Add nim symbol to Nerd Font preset * Yellow with v prefix as default version * Nim version fmt fix * Update docs/config/README.md Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Update src/modules/nim.rs Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Nim module and tests * Add nim to docs * Yellow with v prefix as default version * Update docs/config/README.md Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Update src/modules/nim.rs Co-authored-by: Dario Vladović <d.vladimyr@gmail.com> * Add nim to docs, proper version formatting. * Remove v from symbol, add to fmt string * cargo fmt Co-authored-by: Dario Vladovic <d.vladimyr@gmail.com>
2020-05-22feat(PureScript): Add Purescript module (#1227)nobv
* Added configs/purescript * Added modules/purescript * Added necessary codes * Added tests * Updated README * Fixed color because black is hard to see * Fixed of push mistake * Fixed pointed out in PR
2020-05-21feat: add Zig module (#1231)Dario Vladović
2020-05-21feat(ocaml): Add OCaml module (#1218)Hirochika Matsumoto
* Add OCaml module * Update README.md accordingly * Fix typo * Add Reason support Obtain OCaml version using `-vnum` flag. Extend conditions to match projects using jbuild, esy or merlin. * Update README.md Co-authored-by: Dario Vladovic <d.vladimyr@gmail.com>
2020-04-27feat(erlang): Add Erlang module (#1129)Benedikt Reinartz
2020-04-07fix: Fix typo (#1054)Zhenhui Xie
2020-04-06improvement: add parser for format strings (#1021)Zhenhui Xie
This PR implements the parser of format strings described in #624.
2020-04-05feat: add docker context module (#996)Barnaby Keene
* feat: add docker context module Adds a simple module that checks for a Docker config file and if present, reads the `currentContext` value out and displays on the prompt with a whale. * feat: add `only_with_compose_yml` option to docker_context When enabled, will only show the docker context name if there's a docker-compose.yml file in the current directory. * Update src/modules/docker_context.rs Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> * Update src/modules/docker_context.rs Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> * rename `only_with_compose_yml` configuration key to a more generic `only_with_files` * Update src/modules/docker_context.rs Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> * re-order configuration table * Update docs/config/README.md Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> * Update src/configs/docker_context.rs Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-04-03feat: Add a julia module (#1030)Shu Kutsuzawa
* add a julia module * Update docs/config/README.md Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> * fix based on https://github.com/starship/starship/pull/1030#pullrequestreview-381767326 Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-03-01feat: add Elixir module (#437)KokaKiwi
2020-02-26feat: add singularity module (#932)Tadej Novak
2020-02-06refactor: Move ANSI escaping into its own functions (#866)Kevin Song
2020-02-05feat: Add an Elm module (#879)Andrew Prokhorenkov
Former-commit-id: d42137309da457a438b554601f0734db963a193e
2020-02-04feat: Add Crystal version module (#170)Youssef Habri
2020-01-28fix: escape "$" character to avoid bash interpreting (#884)Luca Rinaldi
2020-01-26test(nodejs): Port nodejs module tests from E2E to integraton (#867)Matan Kushner
Replaces the existing nodejs module end-to-end tests with integration tests that don't require preinstalled environmental dependencies. - Moved the tests to the same file as the module they test - Created a render_module utility function for rendering modules within tests - Removed Node.js installation during CI setup - Add Shell to Context to allow for tests to not run shell-specific code
2020-01-25feat: add Haskell Stack support (#546)Andrew Prokhorenkov
Add a Haskell Stack module when a stack.yaml file is detected
2020-01-01feat: Add the `starship explain` command (#699)Jon Grythe Stødle
This adds the explain argument to Starship, which explains what the printed modules in the prompt are.
2019-12-13fix: Wrap prefix and suffix in shell-specific escape codes (#712)Brian Low
2019-12-08feat: Implement terraform module with workspace and version (#644)wdullaer
2019-12-06feat: Add git_commit module (#673)Qingping Hou
2019-12-05feat: Add PHP version module (#244)Stephen Ball
2019-12-02feat: Add the hg_branch module (#569)Luca Greco