Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Mega-Linter locally #14

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
20 changes: 20 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
Hinton marked this conversation as resolved.
Show resolved Hide resolved
"dictionaryDefinitions": [
{
"name": "project-words",
"path": "./project-words.txt",
"addWords": true
}
],
"dictionaries": ["project-words"],
"ignorePaths": [
".vscode",
"**/.cspell.json",
"**/.git/**",
"**/node_modules/**",
"**/package-lock.json",
"/project-words.txt"
]
}
10 changes: 10 additions & 0 deletions .git-hooks/pre-commit
withinfocus marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
[ -z "$FILES" ] && exit 0

npx mega-linter-runner --remove-container --fix --filesonly $FILES

echo "$FILES" | xargs git add

exit 0
7 changes: 7 additions & 0 deletions .github/workflows/enforce-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@ on:
workflow_call:
pull_request:
types: [labeled, unlabeled, opened, reopened, synchronize]

permissions: read-all

jobs:
enforce-label:
if: ${{ contains(github.event.*.labels.*.name, 'hold') || contains(github.event.*.labels.*.name, 'needs-qa') }}
name: Enforce label
runs-on: ubuntu-22.04
permissions:
contents: read
checks: write
pull-requests: write

steps:
- name: Check for label
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/workflow-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
paths:
- .github/workflows/**

permissions: read-all

jobs:
call-workflow:
uses: bitwarden/gh-actions/.github/workflows/workflow-linter.yml@67ab95d7a466bcefdedf3f93cbc10bcff436edfe
permissions:
contents: read
checks: write
pull-requests: write
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ Thumbs.db
!.vscode/extensions.json
.history/*

# Node
node_modules
npm-debug.log
# Lint
megalinter-reports/
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

15 changes: 15 additions & 0 deletions .jscpd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"threshold": 0,
"reporters": ["html", "markdown"],
"ignore": [
"**/node_modules/**",
"**/.git/**",
"**/.rbenv/**",
"**/.venv/**",
"**/*cache*/**",
"**/.github/**",
"**/.idea/**",
"**/report/**",
"**/*.svg"
]
}
4 changes: 4 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
APPLY_FIXES: all
DEFAULT_BRANCH: main
SHOW_ELAPSED_TIME: false
FILEIO_REPORTER: false
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Template Repository

This repository serves as a template for others and establishes very basic structure and tooling setup for later customization.

## Hooks

To gain enhanced functionality such as local linting, install the hooks for this repository:

```bash
git config core.hooksPath .git-hooks
```
Loading