1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-13 08:46:34 +00:00
starship/.github
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
..
ISSUE_TEMPLATE fix(init): Change Nushell init for nu 0.60 (#3773) 2022-03-24 15:06:24 -04:00
workflows build(deps): update crate-ci/typos action to v1.16.10 2023-09-02 02:21:09 +00:00
config-schema.json feat(kubernetes): Add styling based on current context (#4550) 2023-09-02 09:19:33 +02:00
FUNDING.yml Update Sponsor badge to support the Starship org 2020-03-19 12:16:30 -04:00
PULL_REQUEST_TEMPLATE.md chore: remove redundant section from PR template (#1253) 2020-05-24 12:12:22 -04:00
renovate.json5 chore: use updated gitoxide crate names (#4913) 2023-02-21 13:03:17 +09:00