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
76 changes: 76 additions & 0 deletions .expeditor/buildkite/hugo_lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash

set -euo pipefail

# Configuration
readonly CONTENT_DIR="${1:-./content}"
readonly ALLOWED_NON_ASCII='[✓|├|─|│|└|↑|↓|‣|✔|✗|☛|»|Ω|★|☑|é|í]'

# Skip auto-generated files
readonly SKIP_FILES=("habitat_cli.md" "service_templates.md")

# Function to check for non-ASCII characters
check_non_ascii() {
local content_dir="$1"
local allowed_chars="$2"

if [[ ! -d "$content_dir" ]]; then
echo "Error: Content directory '$content_dir' not found" >&2
return 2
fi

# Find non-ASCII characters, excluding allowed ones and skipped files
local violations
violations=$(grep -r -I --color=auto -o --with-filename -n -P '[^\x00-\x7F]' "$content_dir" 2>/dev/null \
| grep -v "$allowed_chars" \
| grep -v -E "$(printf "|%s" "${SKIP_FILES[@]}")" || true)

if [[ -z "$violations" ]]; then
return 0 # Success - no violations found
else
echo "$violations"
return 1 # Failure - violations found
fi
}

# Function to display usage information
usage() {
cat << EOF
Usage: $0 [CONTENT_DIR]

Check for non-ASCII characters in Hugo content files.

Arguments:
CONTENT_DIR Directory to check (default: ./content)

Exit codes:
0 Success - no non-ASCII violations found
1 Failure - non-ASCII violations found
2 Error - content directory not found
EOF
}

# Main execution
main() {
# Handle help flag
if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
usage
exit 0
fi

echo "Checking for non-ASCII characters in '$CONTENT_DIR'..."

if violations=$(check_non_ascii "$CONTENT_DIR" "$ALLOWED_NON_ASCII"); then
echo "✓ Success! No non-ASCII violations found."
exit 0
else
echo "✗ Failure! Found non-ASCII violations:"
echo "$violations"
exit 1
fi
}

# Only run main if script is executed directly (not sourced)
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
main "$@"
fi
15 changes: 15 additions & 0 deletions .expeditor/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
github:
delete_branch_on_merge: true

release_branches:
- main

pipelines:
- verify:
description: Pull Request validation tests
public: true

slack:
notify_channel:
- docs-notify
12 changes: 12 additions & 0 deletions .expeditor/verify.pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
steps:

- label: lint hugo site
command:
- .expeditor/buildkite/hugo_lint.sh
timeout_in_minutes: 10
retry:
automatic:
limit: 1
expeditor:
executor:
docker:
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Order is important. The last matching pattern has the most precedence.

* @chef/docs-team
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

## Description

<!-- Describe what this change achieves -->

## Version

These are changes for Chef Workstation versions:

<!-- Include the version that this updates. -->

## Definition of done

## Issues resolved

<!-- List any existing issues this PR resolves, or any Discourse or
StackOverflow discussion that's relevant -->

## Related PRs

## Checklist

- [ ] spellcheck
- [ ] use [relref shortcode](https://gohugo.io/content-management/cross-references/#use-of-ref-and-relref) for links to Workstation docs in this doc set
- [ ] all tests pass
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
time: "06:00"
timezone: America/New_York
open-pull-requests-limit: 10
33 changes: 33 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Automatic backport action

on:
pull_request_target:
types: ["labeled", "closed"]

jobs:
backport:
name: Backport PR
runs-on: ubuntu-latest
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& startsWith(github.event.label.name, 'backport-to')
)
)
steps:
- name: Backport Action
uses: sorenlouv/backport-github-action@v9.5.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
auto_backport_label_prefix: backport-to-

- name: Info log
if: ${{ success() }}
run: cat ~/.backport/backport.info.log

- name: Debug log
if: ${{ failure() }}
run: cat ~/.backport/backport.debug.log
61 changes: 61 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This is a basic workflow to help you get started with Actions

name: lint

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events
pull_request:
push:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
cspell-action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: streetsidesoftware/cspell-action@v2.1.1
with:
files: '**/*.md'
root: '.'
github_token: "${{ secrets.GITHUB_TOKEN }}"
incremental_files_only: true
inline: error
strict: true
# Path to CSpell config file
config: 'cspell.yaml'

markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: "${{ secrets.GITHUB_TOKEN }}"
- uses: carlosperate/download-file-action@v1.1.2
id: download-mdl-config
with:
file-url: 'https://raw.githubusercontent.com/chef/chef-web-docs/main/.markdownlint.yaml'
file-name: 'markdownlint.yaml'
- uses: DavidAnson/markdownlint-cli2-action@v5
with:
globs: |
*.md
content/**/*.md
!_vendor/

vale:
name: runner / vale
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: errata-ai/vale-action@reviewdog
with:
files: '["content", "layouts"]'
vale_flags: "--config=.vale.ini --minAlertLevel=error"
filter_mode: diff_context
fail_on_error: true
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.DS_Store

# Hugo/Go workspace files
*.work
*.work.sum

# Hugo build directories
public/
/resources/

# temp file created by hugo
.hugo_build.lock

# NPM
node_modules

# local testing with dart-sass
/dart-sass

/.vscode

# Local Netlify folder
# https://docs.netlify.com/cli/get-started/#link-and-unlink-sites
.netlify
11 changes: 11 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Markdownlint-cli2 config file
## See also:
## .markdownlintignore.yaml
## .markdownlint.yaml
## https://github.com/DavidAnson/markdownlint-cli2

ignores:
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- COPYRIGHT.md
- SECURITY.MD
86 changes: 86 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
default: true
MD001: true
MD002:
level: 2
MD003:
style: consistent
MD004:
style: consistent
MD005: true
MD006: true
MD007:
indent: 2
start_indented: false
MD009:
br_spaces: 2
list_item_empty_lines: false
strict: false
MD010:
code_blocks: false
MD011: true
MD012:
maximum: 1
MD013:
line_length: 999
code_blocks: false
tables: false
MD014: true
MD018: true
MD019: true
MD020: true
MD021: true
MD022:
lines_above: 1
lines_below: 1
MD023: true
MD024:
allow_different_nesting: true
siblings_only: true
MD025:
level: 1
front_matter_title: '^\s*title\s*[:=]'
MD026:
punctuation: '.,;:!'
MD027: true
MD028: false
MD029:
style: one_or_ordered
MD030:
ul_single: 1
ol_single: 1
ul_multi: 1
ol_multi: 1
MD031:
list_items: true
MD032: true
MD033:
allowed_elements:
- code
- table
- tbody
- thead
- td
- th
- tr
- colgroup
- col
- span
MD034: true
MD035:
style: consistent
MD036:
punctuation: '.,;:!?'
MD037: true
MD038: true
MD039: true
MD040: true
MD041: false
MD042: true
MD043: false
MD044:
names: []
code_blocks: true
MD045: true
MD046:
style: fenced
MD047: true
4 changes: 4 additions & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CODE_OF_CONDUCT.md
CONTRIBUTING.md
COPYRIGHT.md
SECURITY.MD
22 changes: 22 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Vale configuration file.
#
# This config file configures Vale when it's run locally.
# The tools/vale/.vale-github-action.ini file configures Vale when it's run by GitHub Actions.
#
# For more information, see https://vale.sh/docs/.

StylesPath = tools/vale/
MinAlertLevel = suggestion
SkippedScopes = code
Packages = Microsoft, write-good, Hugo
Vocab = Chef

[*.{md,yaml,yml}]
BasedOnStyles = chef, Microsoft, vale, write-good

# Ignore SVG markup
TokenIgnores = (\*\*\{\w*\}\*\*), (Master License and Services Agreement)

# Modify rule alert levels
write-good.ThereIs = warning
Microsoft.GeneralURL = NO
3 changes: 3 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Chef Code of Conduct

Participants in this project must adhere to the [Chef Code of Conduct](https://chef.github.io/chef-oss-practices/policies/code-of-conduct/).
Loading
Loading