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>
This commit is contained in:
AnirbanHalder654322
2023-04-14 00:35:12 +05:30
committed by GitHub
parent ce01423152
commit b2ebd5b50c
12 changed files with 369 additions and 0 deletions
@@ -186,3 +186,6 @@ format = '\[[$symbol($version)]($style)\]'
[zig]
format = '\[[$symbol($version)]($style)\]'
[solidity]
format = '\[[$symbol($version)]($style)\]'
@@ -106,6 +106,9 @@ format = 'via [$symbol]($style)'
[rust]
format = 'via [$symbol]($style)'
[solidity]
format = 'via [$symbol]($style)'
[swift]
format = 'via [$symbol]($style)'
@@ -197,6 +197,9 @@ symbol = "scala "
[spack]
symbol = "spack "
[solidity]
symbol = "solidity "
[status]
symbol = "[x](bold red) "
+40
View File
@@ -311,6 +311,7 @@ $red\
$ruby\
$rust\
$scala\
$solidity\
$swift\
$terraform\
$vlang\
@@ -3817,6 +3818,45 @@ and `$SINGULARITY_NAME` is set.
format = '[📦 \[$env\]]($style) '
```
## Solidity
The `solidity` module shows the currently installed version of [Solidity](https://soliditylang.org/)
The module will be shown if any of the following conditions are met:
- The current directory contains a file with the `.sol` extension
### Options
| Option | Default | Description |
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------- |
| `format` | `"via [$symbol($version )]($style)"` | The format for the module. |
| `version_format` | `"v${major}.${minor}.${patch}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` |
| `symbol` | `"S "` | A format string representing the symbol of Solidity |
| `compiler | ["solc"] | The default compiler for Solidity. |
| `detect_extensions` | `["sol"]` | Which extensions should trigger this module. |
| `detect_files` | `[]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this module. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables this module. |
### Variables
| Variable | Example | Description |
| -------- | -------- | ------------------------------------ |
| version | `v0.8.1` | The version of `solidity` |
| 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
[solidity]
format = "via [S $version](blue bold)"
```
## Spack
The `spack` module shows the current [Spack](https://spack.readthedocs.io/en/latest/) environment, if `$SPACK_ENV` is set.