forked from fsprojects/fantomas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update fsdocs to v20 alpha * Add devcontainer config * Update getting started * Build devcontainer * cmd as one line? * -p Init is ran as postCreateCommand cmd. * Use docker file * Add some handy bash functions * Use lf in config file test * Use explicit lf in unit test.
- Loading branch information
Showing
18 changed files
with
265 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
] | ||
}, | ||
"fsdocs-tool": { | ||
"version": "19.1.1", | ||
"version": "20.0.0-alpha-009", | ||
"commands": [ | ||
"fsdocs" | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0.100-rc.2 | ||
|
||
# Avoid warnings by switching to noninteractive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Configure apt and install packages | ||
RUN apt-get update \ | ||
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ | ||
# Verify bash, git, process tools, lsb-release (common in install instructions for CLIs) installed | ||
&& apt-get -y install bash git openssh-client less iproute2 procps lsb-release \ | ||
&& apt-get -y install gnupg \ | ||
# Clean up | ||
&& apt-get autoremove -y \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Switch back to dialog for any ad-hoc use of apt-get | ||
ENV DEBIAN_FRONTEND=dialog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet-fsharp | ||
{ | ||
"name": "Fantomas", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
// Configure properties specific to VS Code. | ||
"vscode": { | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"Ionide.Ionide-fsharp", | ||
"ms-dotnettools.csharp", | ||
"tintoy.msbuild-project-tools" | ||
] | ||
} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/github-cli:1": {} | ||
}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [ 8901 ], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "dotnet restore", | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
"remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
alias ni="touch" | ||
# alias dtr="dotnet tool restore" | ||
function dtr () { | ||
# Extract lines that contain tool names and versions | ||
tools=$(grep -oP '"\K[^"]+(?=": {)' .config/dotnet-tools.json | grep -v '^tools$') | ||
versions=$(grep -oP 'version": "\K[^"]+' .config/dotnet-tools.json) | ||
|
||
# Convert strings to arrays | ||
readarray -t tools_array <<<"$tools" | ||
readarray -t versions_array <<<"$versions" | ||
|
||
# Loop through the arrays | ||
for i in "${!tools_array[@]}"; do | ||
tool_name=${tools_array[$i]} | ||
tool_version=${versions_array[$i]} | ||
|
||
# Install the tool | ||
dotnet tool install "$tool_name" --version "$tool_version" | ||
done | ||
} | ||
|
||
function format-changed() { | ||
# Get the root of the current git repository | ||
repo_root=$(git rev-parse --show-toplevel) | ||
|
||
# Run git status --porcelain in the root directory and save the output as an array | ||
mapfile -t status_array < <(git -C "$repo_root" status --porcelain) | ||
|
||
# Filter the file names in the status_array array | ||
filtered_files=() | ||
for file in "${status_array[@]}"; do | ||
if [[ $file =~ \.fs$ || $file =~ \.fsi$ || $file =~ \.fsx$ ]]; then | ||
# Trim leading symbols before the first space | ||
trimmed_file="${file##* }" | ||
filtered_files+=("$trimmed_file") | ||
fi | ||
done | ||
|
||
# Concatenate the filtered file names into a single string with spaces | ||
concatenated_files="${filtered_files[*]}" | ||
|
||
pushd "$repo_root" > /dev/null || exit 1 | ||
|
||
# Run fantomas | ||
echo "dotnet fantomas $concatenated_files" | ||
dotnet fantomas $concatenated_files | ||
|
||
popd > /dev/null || exit | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<li class="nav-item"><a href="{{fsdocs-menu-item-link}}" class="nav-link pb-2 d-block" > {{fsdocs-menu-item-content}}</a></li> | ||
<li class="nav-item {{fsdocs-menu-item-active-class}}"><a href="{{fsdocs-menu-item-link}}" class="nav-link pb-2 d-block" > {{fsdocs-menu-item-content}}</a></li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.