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>
This commit is contained in:
AlexHaxe
2022-12-04 18:28:49 +01:00
committed by GitHub
parent ef83e7a092
commit 2766c78749
11 changed files with 492 additions and 0 deletions
@@ -64,6 +64,9 @@ format = '\[[$symbol]($style)\]'
[haskell]
format = '\[[$symbol($version)]($style)\]'
[haxe]
format = '\[[$symbol($version)]($style)\]'
[helm]
format = '\[[$symbol($version)]($style)\]'
@@ -37,6 +37,9 @@ symbol = " "
[haskell]
symbol = " "
[haxe]
symbol = "⌘ "
[hg_branch]
symbol = " "
@@ -37,6 +37,9 @@ format = 'via [$symbol]($style)'
[golang]
format = 'via [$symbol]($style)'
[haxe]
format = 'via [$symbol]($style)'
[helm]
format = 'via [$symbol]($style)'
+42
View File
@@ -286,6 +286,7 @@ $erlang\
$golang\
$guix_shell\
$haskell\
$haxe\
$helm\
$java\
$julia\
@@ -1959,6 +1960,47 @@ By default the module will be shown if any of the following conditions are met:
*: This variable can only be used as a part of a style string
## Haxe
The `haxe` module shows the currently installed version of [Haxe](https://haxe.org/).
By default the module will be shown if any of the following conditions are met:
- The current directory contains a `project.xml`, `Project.xml`, `application.xml`, `haxelib.json`, `hxformat.json` or `.haxerc` file
- The current directory contains a `.haxelib` or a `haxe_libraries` directory
- The current directory contains a file with the `.hx` or `.hxml` extension
### Options
| Option | Default | Description |
| ------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `detect_extensions` | `["hx", "hxml"]` | Which extensions should trigger this module. |
| `detect_files` | `["project.xml", "Project.xml", "application.xml", "haxelib.json", "hxformat.json", ".haxerc"]` | Which filenames should trigger this module. |
| `detect_folders` | `[".haxelib", "haxe_libraries"]` | Which folders should trigger this modules. |
| `symbol` | `"⌘ "` | A format string representing the symbol of Helm. |
| `style` | `"bold fg:202"` | The style for the module. |
| `disabled` | `false` | Disables the `haxe` module. |
### Variables
| Variable | Example | Description |
| -------- | -------- | ------------------------------------ |
| version | `v4.2.5` | The version of `haxe` |
| symbol | | Mirrors the value of option `symbol` |
| style\* | | Mirrors the value of option `style` |
*: This variable can only be used as a part of a style string
### Example
```toml
# ~/.config/starship.toml
[haxe]
format = "via [⌘ $version](bold fg:202) "
```
## Helm
The `helm` module shows the currently installed version of [Helm](https://helm.sh/).