From 6e51eb1e1e92d9475f3dc77e63790f5ac5d4dacd Mon Sep 17 00:00:00 2001 From: sam Date: Wed, 9 Oct 2024 17:11:05 +0200 Subject: [PATCH] add husky and csharpier --- .config/dotnet-tools.json | 20 ++++++++++++++++++++ .husky/task-runner.json | 16 ++++++++++++++++ README.md | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 .config/dotnet-tools.json create mode 100644 .husky/task-runner.json create mode 100644 README.md diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..b315638 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,20 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "csharpier": { + "version": "0.29.2", + "commands": [ + "dotnet-csharpier" + ], + "rollForward": false + }, + "husky": { + "version": "0.7.1", + "commands": [ + "husky" + ], + "rollForward": false + } + } +} \ No newline at end of file diff --git a/.husky/task-runner.json b/.husky/task-runner.json new file mode 100644 index 0000000..992089f --- /dev/null +++ b/.husky/task-runner.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://alirezanet.github.io/Husky.Net/schema.json", + "tasks": [ + { + "name": "run-csharpier", + "command": "dotnet", + "args": [ + "csharpier", + "${staged}" + ], + "include": [ + "**/*.cs" + ] + } + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..545267f --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# Catalogger.NET + +C# rewrite of [Catalogger][old-repo]. + +## Development + +Command-line tools for this project can be installed with `dotnet tool restore`. + +- We use [Husky.Net][husky] for Git hooks, install it with `dotnet husky install`. +- We use [CSharpier][csharpier] for formatting .NET code. + It can be called with `dotnet csharpier .`, but is automatically run by Husky pre-commit. + +## License + +Copyright (C) 2021-present sam (https://starshines.gay) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published +by the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +[old-repo]: https://github.com/starshine-sys/catalogger/tree/main +[husky]: https://github.com/alirezanet/Husky.Net +[csharpier]: https://csharpier.com/