build: adding some automatic formatting on commits

This commit is contained in:
Dylan R. E. Moonfire 2022-04-02 17:30:41 -05:00
parent 8ac6b3b514
commit bf9e40dadd
8 changed files with 55 additions and 39 deletions

View File

@ -103,7 +103,7 @@ tab_width=2
[*.{cs,js,json,jsx,proto,resjson,ts,tsx}]
indent_style=space
indent_size=space
indent_size=4
tab_width=4
[*.{asax,ascx,aspx,cshtml,css,htm,html,master,razor,skin,vb,xaml,xamlx,xoml}]

View File

@ -1,5 +1,5 @@
include:
- template: Security/SAST.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
stages:
- build

6
.prettierignore Normal file
View File

@ -0,0 +1,6 @@
*~
flake.*
node_modules/
.direnv/
.config/

View File

@ -1,5 +1,5 @@
- [ ] Split out tables into an assembly
- [ ] Switch to GitVersion for release
- [ ] Switch to scripts instead of Node for targets
- [ ] Clean up the Gitlab setup
- [ ] Change configuration back to default
- [ ] Split out tables into an assembly
- [ ] Switch to GitVersion for release
- [ ] Switch to scripts instead of Node for targets
- [ ] Clean up the Gitlab setup
- [ ] Change configuration back to default

View File

@ -1,5 +1,5 @@
{
description = "A .NET core library for building tools";
description = "A .NET core library for easily building CLI tools";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
@ -11,7 +11,13 @@
let pkgs = nixpkgs.legacyPackages.${system};
in {
devShell = pkgs.mkShell {
buildInputs = [ pkgs.dotnet-sdk pkgs.lefthook pkgs.convco pkgs.nixfmt ];
buildInputs = [
pkgs.dotnet-sdk
pkgs.lefthook
pkgs.convco
pkgs.nodePackages.prettier
pkgs.nixfmt
];
};
});
}

View File

@ -1,12 +1,16 @@
pre-push:
parallel: true
commands:
commit-check:
run: convco check -n 30
parallel: true
commands:
commit-check:
run: convco check -n 30
pre-commit:
parallel: true
commands:
dotnet-format:
glob: "*.cs"
run: dotnet format
parallel: true
commands:
dotnet-format:
glob: "*.cs"
run: dotnet format
prettier:
run: prettier . --write --loglevel warn
nixfmt:
run: nixfmt flake.nix

View File

@ -1,21 +1,19 @@
#!/usr/bin/env sh
# Normalize our environment.
cd $(dirname $0)/..
# Make sure we have .NET installed.
if ! which dotnet >& /dev/null
then
echo "Cannot find 'dotnet' in the path"
exit 1
fi
# Make sure we have lefthook.and it is installed.
if ! which lefthook >& /dev/null
then
echo "Cannot find 'lefthook' in the path"
exit 1
fi
# Make sure we have the needed executables installed.
for e in dotnet lefthook prettier nixfmt
do
if ! which $e >& /dev/null
then
echo "Cannot find '$e' in the path"
exit 1
fi
done
# Make sure we have lefthook is installed.
lefthook install
# Everything is good.

View File

@ -1,11 +1,13 @@
mode: MainLine
major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)"
minor-version-bump-message: "^(feat)(\\([\\w\\s-]*\\))?:"
patch-version-bump-message: "^(build|chore|ci|docs|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?:"
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch
assembly-informational-format: '{InformationalVersion}'
mode: ContinuousDelivery
increment: Inherit
continuous-delivery-fallback-tag: ci
tag-prefix: '[vV]'
major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)"
minor-version-bump-message: "^(feat)(\\([\\w\\s-]*\\))?:"
patch-version-bump-message: "^(build|chore|ci|docs|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?:"
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch
assembly-informational-format: "{InformationalVersion}"
tag-prefix: "[vV]"