Skip to content

Commit

Permalink
Create repository
Browse files Browse the repository at this point in the history
This repository has been created to implement a series of smoke tests
for the infrastructure of the Rust[^1] project. The repository contains
a set of default developer tooling to ensure a consistent coding style
in the project.
  • Loading branch information
jdno committed Mar 17, 2024
0 parents commit b914650
Show file tree
Hide file tree
Showing 14 changed files with 531 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

[bin/*]
indent_style = tab

[*.md]
trim_trailing_whitespace = false

[*.toml]
indent_size = 4
indent_style = space

[*.rs]
max_line_length = 100

[*.{yml,yaml}]
indent_size = 2
indent_style = space
9 changes: 9 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true
15 changes: 15 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: ["config:base"],

// Disable creating a GitHub issue that lists all available dependency updates
dependencyDashboard: false,

// Keep pre-commit hooks up-to-date
"pre-commit": {
enabled: true,
},

// Disable prefixing commits with the semantic commit type
semanticCommits: "disabled",
}
51 changes: 51 additions & 0 deletions .github/workflows/json.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: JSON

"on":
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
detect-changes:
name: Detect changes
runs-on: ubuntu-latest

outputs:
any_changed: ${{ steps.detect-changes.outputs.any_changed }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get changed files
id: detect-changes
uses: tj-actions/changed-files@v43
with:
files: |
**/*.json
- name: Print changed files
run: |
for file in ${{ steps.detect-changes.outputs.all_changed_files }}; do
echo "$file"
done
style:
name: Check style
runs-on: ubuntu-latest

needs: detect-changes
if: needs.detect-changes.outputs.any_changed == 'true'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: prettier
uses: creyD/prettier_action@v4.3
with:
dry: true
prettier_options: "--check **/*.json"
67 changes: 67 additions & 0 deletions .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: Markdown

"on":
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
detect-changes:
name: Detect changes
runs-on: ubuntu-latest

outputs:
any_changed: ${{ steps.detect-changes.outputs.any_changed }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get changed files
id: detect-changes
uses: tj-actions/changed-files@v43
with:
files: |
**/*.md
- name: Print changed files
run: |
for file in ${{ steps.detect-changes.outputs.all_changed_files }}; do
echo "$file"
done
lint:
name: Lint code
runs-on: ubuntu-latest

needs: detect-changes
if: needs.detect-changes.outputs.any_changed == 'true'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: markdownlint-cli
uses: nosborn/github-action-markdown-cli@v3.3.0
with:
files: "**.md"

style:
name: Check style
runs-on: ubuntu-latest

needs: detect-changes
if: needs.detect-changes.outputs.any_changed == 'true'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: prettier
uses: creyD/prettier_action@v4.3
with:
dry: true
prettier_options: "--check **/*.md"
66 changes: 66 additions & 0 deletions .github/workflows/yaml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: YAML

"on":
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
detect-changes:
name: Detect changes
runs-on: ubuntu-latest

outputs:
any_changed: ${{ steps.detect-changes.outputs.any_changed }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get changed files
id: detect-changes
uses: tj-actions/changed-files@v43
with:
files: |
**/*.yaml
**/*.yml
- name: Print changed files
run: |
for file in ${{ steps.detect-changes.outputs.all_changed_files }}; do
echo "$file"
done
lint:
name: Lint code
runs-on: ubuntu-latest

needs: detect-changes
if: needs.detect-changes.outputs.any_changed == 'true'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run yamllint
uses: actionshub/yamllint@v1.8.2

style:
name: Check style
runs-on: ubuntu-latest

needs: detect-changes
if: needs.detect-changes.outputs.any_changed == 'true'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: prettier
uses: creyD/prettier_action@v4.3
with:
dry: true
prettier_options: "--check **/*.{yml,yaml}"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Cache for Prettier 4
node_modules/
1 change: 1 addition & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# pre-commit configuration
#
# We use pre-commit to enforce a consistency in our repositories. By default,
# YAML and Markdown files get linted, and Prettier runs to auto-format the file
# types it supports. Depending on the project, other rules can be added here to
# support the needs of the project.
#
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
args: ["--maxkb=1024"]
- id: check-case-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.39.0
hooks:
- id: markdownlint
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
7 changes: 7 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
extends: default

rules:
line-length:
ignore: |
.github/workflows/*
Loading

0 comments on commit b914650

Please sign in to comment.