Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 1,
"isRoot": true,
"tools": {
"husky": {
"version": "0.7.2",
"commands": [
"husky"
]
},
"csharpier": {
"version": "1.0.3",
"commands": [
"csharpier"
]
}
}
}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @bmazzarol
Comment thread
bmazzarol marked this conversation as resolved.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '…'
2. Click on '…'
3. Scroll down to '…'
4. See error.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Comment thread
bmazzarol marked this conversation as resolved.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when (...)

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
17 changes: 17 additions & 0 deletions .github/workflows/build-deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Build and Deploy Docs
Comment thread
bmazzarol marked this conversation as resolved.

on:
push:
branches: [main]

jobs:
build-and-deploy-docs:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- uses: bmazzarol/bmazzarol/.github/actions/build-deploy-docs@main
with:
docsProjectPath: Cutout.Docs
csProjFileName: Cutout.Docs.csproj
Comment thread
bmazzarol marked this conversation as resolved.
23 changes: 23 additions & 0 deletions .github/workflows/cd-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CD Build
Comment thread
bmazzarol marked this conversation as resolved.

on:
workflow_dispatch:
inputs:
version:
description: Release Version
required: true
release:
types: [published]

env:
PACKAGE_VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }}

jobs:
publish:
name: Publish to Nuget
runs-on: ubuntu-latest
steps:
- uses: bmazzarol/bmazzarol/.github/actions/cd-build@main
with:
version: ${{ env.PACKAGE_VERSION }}
nugetKey: ${{ secrets.NUGET_API_KEY }}
12 changes: 12 additions & 0 deletions .github/workflows/check-code-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Check C# Formatting

on:
pull_request:
branches: [main]

jobs:
check_formatting:
runs-on: ubuntu-latest
name: Check C# Formatting
steps:
- uses: bmazzarol/bmazzarol/.github/actions/check-code-format@main
Comment thread
bmazzarol marked this conversation as resolved.
12 changes: 12 additions & 0 deletions .github/workflows/check-commit-message.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Check Commit Message
Comment thread
bmazzarol marked this conversation as resolved.

on:
pull_request:
branches: [main]

jobs:
commitlint:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- uses: bmazzarol/bmazzarol/.github/actions/check-commit-message@main
Comment thread
bmazzarol marked this conversation as resolved.
14 changes: 14 additions & 0 deletions .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Check the Docfx site
Comment thread
bmazzarol marked this conversation as resolved.

on:
pull_request:
branches: [main]

jobs:
check-docs:
runs-on: ubuntu-latest
steps:
- uses: bmazzarol/bmazzarol/.github/actions/check-docs@main
with:
docsProjectPath: Cutout.Docs
csProjFileName: Cutout.Docs.csproj
Comment thread
bmazzarol marked this conversation as resolved.
21 changes: 21 additions & 0 deletions .github/workflows/check-markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check Markdown
Comment thread
bmazzarol marked this conversation as resolved.

on:
push:
branches: [main]
paths:
- "**/*.md"
- .github/workflows/check-markdown.yml
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
permissions:
statuses: write
steps:
Comment thread
bmazzarol marked this conversation as resolved.
- uses: bmazzarol/bmazzarol/.github/actions/check-markdown@main
with:
targetMdFiles: |
"Cutout*/**/*.md" "Cutout.Docs/**/*.md" "*.md" "!LICENSE.md"
Comment thread
bmazzarol marked this conversation as resolved.
Comment thread
bmazzarol marked this conversation as resolved.
22 changes: 22 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI Build

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Build and analyze
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- uses: bmazzarol/bmazzarol/.github/actions/ci-build@main
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
sonarToken: ${{ secrets.SONAR_TOKEN }}
sonarProjectKey: bmazzarol_Cutout
Comment thread
bmazzarol marked this conversation as resolved.
18 changes: 18 additions & 0 deletions .github/workflows/test-reporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test Reporter
Comment thread
bmazzarol marked this conversation as resolved.

on:
workflow_run:
workflows: [CI Build]
types: [completed]

jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1
Comment thread
bmazzarol marked this conversation as resolved.
with:
artifact: test-results
name: Test Results
path: |
**/*.trx
reporter: dotnet-trx
22 changes: 22 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

## husky task runner examples -------------------
## Note : for local installation use 'dotnet' prefix. e.g. 'dotnet husky'

## run all tasks
#husky run

### run all tasks with group: 'group-name'
#husky run --group group-name

## run task with name: 'task-name'
#husky run --name task-name

## pass hook arguments to task
#husky run --args "$1" "$2"

## or put your custom commands -------------------
#echo 'Husky.Net is awesome!'

npx --no -- commitlint --edit ${1}
22 changes: 22 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

## husky task runner examples -------------------
## Note : for local installation use 'dotnet' prefix. e.g. 'dotnet husky'

## run all tasks
#husky run

### run all tasks with group: 'group-name'
#husky run --group group-name

## run task with name: 'task-name'
#husky run --name task-name

## pass hook arguments to task
#husky run --args "$1" "$2"

## or put your custom commands -------------------
#echo 'Husky.Net is awesome!'

dotnet husky run
39 changes: 39 additions & 0 deletions .husky/task-runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"tasks": [
{
"name": "Format C# Code",
"command": "dotnet",
"args": [
"csharpier",
"format",
"."
]
},
{
"name": "Lint Markdown",
"command": "npx",
"args": [
"markdownlint-cli2",
"Cutout*/**/*.md",
"Cutout.Docs/**/*.md",
"*.md",
"!LICENSE.md"
]
},
{
"name": "Test C# Code",
"command": "dotnet",
"args": [
"test"
]
},
{
"name": "Lint Docs",
"command": "dotnet",
"args": [
"build",
"Cutout.Docs/Cutout.Docs.csproj"
]
}
Comment thread
bmazzarol marked this conversation as resolved.
]
}
12 changes: 12 additions & 0 deletions Cutout.Docs/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"docfx": {
"version": "2.78.2",
"commands": [
"docfx"
]
}
}
}
3 changes: 3 additions & 0 deletions Cutout.Docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
_site
api
doctests
3 changes: 3 additions & 0 deletions Cutout.Docs/Cutout.Docs.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetPathOfFileAbove('Common.Docs.props', '$(MSBuildThisFileDirectory)'))" />
</Project>
Comment thread
bmazzarol marked this conversation as resolved.
25 changes: 25 additions & 0 deletions Cutout.Docs/articles/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Getting Started

To use this library, simply include `Cutout.dll` in your project or grab
it from [NuGet](https://www.nuget.org/packages/Cutout/), and add a reference to it.

```xml
<ItemGroup>
<PackageReference Include="Cutout" Version="x.x.x">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
```

Then use the `Cutout.Template` attribute to define a template method.

[!code-csharp[](../../Cutout.Sample/Examples.cs#ParameterExample)]

The first parameter is the `StringBuilder`-like type to write to. Everything
else passed can be used in the template.

The template must be a compile-time constant string, so it can be defined
as a `const` field or inline in the attribute.

[!code-csharp[](../../Cutout.Sample/Examples.cs#ExampleWithConditionAndConstTemplate)]
9 changes: 9 additions & 0 deletions Cutout.Docs/articles/rules/CUTOUT001.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# CUTOUT001 - Invalid Template

The template used is not valid in some way. This could be due to a syntax
error, or it could be that the template is not compatible with the Cutout
version of the liquid language.
Comment thread
bmazzarol marked this conversation as resolved.

The error will indicate the line number and position where the parser
encountered the issue. The user should review the template string and
resolve the problem.
Comment thread
bmazzarol marked this conversation as resolved.
3 changes: 3 additions & 0 deletions Cutout.Docs/articles/rules/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
items:
- name: (CUTOUT001) Invalid Template
href: CUTOUT001.md
Loading
Loading