generated from deepgram/oss-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements Markdown, GH Action, YAML, and Shell Linting
- Loading branch information
1 parent
f247994
commit ed98d86
Showing
19 changed files
with
654 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Check - actionlint | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- assigned | ||
- opened | ||
- synchronize | ||
- reopened | ||
paths: | ||
- ".github/workflows/**" | ||
|
||
jobs: | ||
checkactionlint: | ||
name: Check actionlint | ||
# Only run this job if we're in the main repo, not a fork. | ||
if: github.repository == 'deepgram/deepgram-js-sdk' | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout code by commit | ||
uses: actions/checkout@v4 | ||
|
||
- name: Ensure dependencies installed | ||
shell: bash | ||
run: | | ||
make ensure-deps | ||
- name: Run actionlint | ||
run: | | ||
make actionlint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Check - All linters, etc | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- release-* | ||
tags-ignore: | ||
- "**" | ||
|
||
jobs: | ||
build: | ||
name: Change to Main/Release Branch | ||
# Only run this job if we're in the main repo, not a fork. | ||
if: github.repository == 'deepgram/deepgram-js-sdk' | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout code by commit | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.19" | ||
id: go | ||
|
||
- name: Ensure dependencies installed | ||
shell: bash | ||
run: | | ||
make ensure-deps | ||
- name: Run all checks | ||
shell: bash | ||
run: | | ||
make check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Check - mdlint | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- assigned | ||
- opened | ||
- synchronize | ||
- reopened | ||
paths: | ||
- "**.md" | ||
- "hack/check/check-mdlint.sh" | ||
|
||
jobs: | ||
checkmdlint: | ||
name: Check mdlint | ||
# Only run this job if we're in the main repo, not a fork. | ||
if: github.repository == 'deepgram/deepgram-js-sdk' | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout code by commit | ||
uses: actions/checkout@v4 | ||
|
||
- name: Ensure dependencies installed | ||
shell: bash | ||
run: | | ||
make ensure-deps | ||
- name: Run mdlint | ||
run: | | ||
make mdlint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Check - shell | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- assigned | ||
- opened | ||
- synchronize | ||
- reopened | ||
paths: | ||
- "**/Makefile" | ||
- "**.sh" | ||
- "hack/check/check-shell.sh" | ||
|
||
jobs: | ||
checkshell: | ||
name: Check shell | ||
# Only run this job if we're in the main repo, not a fork. | ||
if: github.repository == 'deepgram/deepgram-js-sdk' | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout code by commit | ||
uses: actions/checkout@v4 | ||
|
||
- name: Ensure dependencies installed | ||
shell: bash | ||
run: | | ||
make ensure-deps | ||
- name: Run shellcheck | ||
run: | | ||
make shellcheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Check - yaml | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- assigned | ||
- opened | ||
- synchronize | ||
- reopened | ||
paths: | ||
- ".github/workflows/**" | ||
|
||
jobs: | ||
checkmdlint: | ||
name: Check mdlint | ||
# Only run this job if we're in the main repo, not a fork. | ||
if: github.repository == 'deepgram/deepgram-js-sdk' | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout code by commit | ||
uses: actions/checkout@v4 | ||
|
||
- name: Ensure dependencies installed | ||
shell: bash | ||
run: | | ||
make ensure-deps | ||
- name: Run mdlint | ||
run: | | ||
make mdlint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"default": true, | ||
"line_length": false, | ||
"MD024": { "allow_different_nesting": true }, | ||
"MD026": { "punctuation": ".,;:!" }, | ||
"MD046": { "style": "fenced" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
extends: relaxed | ||
|
||
rules: | ||
line-length: disable | ||
trailing-spaces: enable | ||
new-line-at-end-of-file: enable | ||
new-lines: | ||
type: unix | ||
indentation: disable | ||
key-duplicates: disable | ||
empty-lines: enable | ||
colons: disable | ||
commas: disable | ||
|
||
ignore: | | ||
# /deepgram-go-sdk/.github/ISSUE_TEMPLATE/config.yml | ||
/deepgram-go-sdk/node_modules/**/*/ | ||
/deepgram-go-sdk/jspm_packages/**/*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright 2024 Deepgram SDK contributors. All Rights Reserved. | ||
# Use of this source code is governed by a MIT license that can be found in the LICENSE file. | ||
# SPDX-License-Identifier: MIT | ||
|
||
# detect the build OS | ||
ifeq ($(OS),Windows_NT) | ||
build_OS := Windows | ||
NUL = NUL | ||
else | ||
build_OS := $(shell uname -s 2>/dev/null || echo Unknown) | ||
NUL = /dev/null | ||
endif | ||
|
||
.DEFAULT_GOAL:=help | ||
|
||
##### GLOBAL | ||
ROOT_DIR := $(shell git rev-parse --show-toplevel) | ||
|
||
help: #### Display help | ||
@echo '' | ||
@echo 'Syntax: make <target>' | ||
@awk 'BEGIN {FS = ":.*## "; printf "\nTargets:\n"} /^[a-zA-Z_-]+:.*?#### / { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
@echo '' | ||
##### GLOBAL | ||
|
||
##### LINTING TARGETS | ||
.PHONY: version | ||
version: #### display version of components | ||
@echo 'ROOT_DIR: $(ROOT_DIR)' | ||
|
||
.PHONY: check mdlint shellcheck actionlint yamllint ### Performs all of the checks, lint'ing, etc available | ||
check: mdlint shellcheck actionlint yamllint | ||
|
||
.PHONY: ensure-deps | ||
ensure-deps: #### Ensure that all required dependency utilities are downloaded or installed | ||
hack/ensure-deps/ensure-dependencies.sh | ||
|
||
mdlint: #### Performs Markdown lint | ||
# mdlint rules with common errors and possible fixes can be found here: | ||
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md | ||
hack/check/check-mdlint.sh | ||
|
||
shellcheck: #### Performs bash/shell lint | ||
hack/check/check-shell.sh | ||
|
||
yamllint: #### Performs yaml lint | ||
hack/check/check-yaml.sh | ||
|
||
actionlint: #### Performs GitHub Actions lint | ||
actionlint | ||
##### LINTING TARGETS |
Oops, something went wrong.