Skip to content

Commit

Permalink
✨ Initial public commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Thalhammer committed Jul 8, 2024
0 parents commit 0508c9f
Show file tree
Hide file tree
Showing 44 changed files with 8,350 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
BasedOnStyle: LLVM
BreakBeforeBraces: Attach

ColumnLimit: 120 # Match GitHub UI

UseTab: Always
TabWidth: 4
IndentWidth: 4
AccessModifierOffset: -4
ContinuationIndentWidth: 4
NamespaceIndentation: All
IndentCaseLabels: false

PointerAlignment: Left
AlwaysBreakTemplateDeclarations: Yes
SpaceAfterTemplateKeyword: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortBlocksOnASingleLine: Always

FixNamespaceComments: true
ReflowComments: false
27 changes: 27 additions & 0 deletions .github/actions/badge/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Regular badging sequence
description: Publishes a badge based on the job status
inputs:
category:
description: The subfolder where to group the badges
required: true
badges:
description: A json object of label => status for all badges
required: true
github_token:
description: The token to use to publish the changes
required: false
default: ${{ github.token }}
runs:
using: composite
steps:
- run: |
node ./.github/actions/badge/write-json-object.js ${{ inputs.category }} '${{ inputs.badges }}'
shell: bash
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ inputs.github_token }}
publish_branch: badges
publish_dir: ./badges
keep_files: true
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
17 changes: 17 additions & 0 deletions .github/actions/badge/write-json-object.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const fs = require('fs');
const category = process.argv[2];
const status = JSON.parse(process.argv[3]);

if (!fs.existsSync("./badges")) fs.mkdirSync("./badges");
if (!fs.existsSync("./badges/" + category)) fs.mkdirSync("./badges/" + category);
for (let e in status) {
const path = "./badges/" + category + "/" + e;
if (!fs.existsSync(path)) fs.mkdirSync(path);
const ok = status[e] == "success";
fs.writeFileSync(path + "/shields.json", JSON.stringify({
"schemaVersion": 1,
"label": e,
"message": ok ? "Passing" : "Failing",
"color": ok ? "brightgreen" : "red"
}));
}
26 changes: 26 additions & 0 deletions .github/actions/process-linting-results/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Process Linting Results
description: Add a comment to a pull request with when `git diff` present and save the changes as an artifact so they can be applied manually
inputs:
linter_name:
description: The name of the tool to credit in the comment
required: true
runs:
using: "composite"
steps:
- run: git add --update
shell: bash
- id: stage
#continue-on-error: true
uses: Thalhammer/patch-generator-action@v2

# Unfortunately the previous action reports a failure so nothing else can run
# partially a limitation on composite actions since `continue-on-error` is not
# yet supported
- if: steps.stage.outputs.result == 'dirty'
uses: actions-ecosystem/action-create-comment@v1
with:
github_token: ${{ github.token }}
body: |
Hello, @${{ github.actor }}! `${{ inputs.linter_name }}` had some concerns :scream:
- run: exit $(git status -uno -s | wc -l)
shell: bash
80 changes: 80 additions & 0 deletions .github/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions .github/scripts/add-newline-if-missing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
if [[ -f "$1" && -s "$1" ]]; then
if [[ -n "$(tail -c 1 "$1")" ]]; then
echo "Fixed missing newline in file $1"
sed -i -e '$a\' $1
fi
fi
Loading

0 comments on commit 0508c9f

Please sign in to comment.