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

Updated configs #5

Merged
merged 2 commits into from
Oct 16, 2024
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
97 changes: 97 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Continuous Integration

on:
push:
branches:
- main
- next
pull_request:
branches:
- main
- next

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint Lua with Luacheck
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Luacheck linter
uses: lunarmodules/luacheck@v1

format:
name: Check Formatting with StyLua
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: v0.20.0 # NOTE: we recommend pinning to a specific version in case of formatting changes
# CLI arguments
args: --check lua/

test:
name: Run Neovim Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
neovim_version:
- nightly
- stable
- v0.10.2
- v0.9.5
- v0.8.3
steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.neovim_version}}

- uses: extractions/setup-just@v1
with:
just-version: 1.36.0 # optional semver specification, otherwise latest

- name: Run tests
run: just test
release:
needs: [lint, format, test]
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
fetch-depth: 0
persist-credentials: false

- name: Semantic Release
uses: cycjimmy/semantic-release-action@b1b432f13acb7768e0c8efdec416d363a57546f2 # v4.1.1
id: semantic
with:
semantic_version: 24.0.0
extra_plugins: |
@semantic-release/exec@6
@semantic-release/git@10
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/scorecard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Scorecard supply-chain security
on:
branch_protection_rule:
schedule:
- cron: "30 1 * * 4"
push:
branches: ["main"]

permissions: read-all

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
security-events: write
id-token: write

steps:
- name: "Checkout code"
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
with:
results_file: results.sarif
results_format: sarif
publish_results: true

- name: "Upload artifact"
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.pre.node20
with:
name: SARIF file
path: results.sarif
retention-days: 5

- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3
with:
sarif_file: results.sarif
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/plugin/reload.vim
!scripts/
/plugin/reload.vim
deps/
.ci
4 changes: 4 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
globals = { "vim", "MiniTest" }
max_line_length = false

exclude_files = { "deps" }
11 changes: 11 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"diagnostics.globals": [
"vim",
"MiniTest"
],
"runtime.version": "LuaJIT",
"workspace.library": [
"/usr/local/share/nvim/runtime/lua",
".ci/neovim/share/nvim/runtime/lua"
]
}
16 changes: 16 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"MD003": {
"style": "atx"
},
"MD007": {
"indent": 2
},
"MD013": false,
"MD024": false,
"MD033": false,
"MD041": false,
"default": true,
"link-fragments": false,
"no-hard-tabs": true,
"whitespace": false
}
4 changes: 4 additions & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
^LICENSE
.github/**/*
meta/LICENSE-HEADER
guide/src/SUMMARY.md
125 changes: 125 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# SPDX-FileCopyrightText: 2024 Ali Sajid Imami
#
# SPDX-License-Identifier: MIT

default_stages:
- pre-commit
- commit-msg
- pre-push
repos:
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.29.1
hooks:
- id: commitizen

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-json
- id: no-commit-to-branch
args:
- --branch
- main
- --branch
- next
- id: check-merge-conflict
- id: check-toml
- id: check-xml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
args:
- --fix=no
- id: pretty-format-json
args:
- --indent=4
- --autofix
- id: trailing-whitespace
args:
- --markdown-linebreak-ext=md
- id: check-added-large-files

- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.4.0
hooks:
- id: conventional-pre-commit
args:
- build
- chore
- ci
- docs
- feat
- fix
- perf
- refactor
- revert
- style
- test
- bump
stages:
- commit-msg

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: forbid-tabs
- id: remove-tabs

- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args:
- --config=$(pwd)/.yamllint.yml
stages:
- commit-msg

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.42.0
hooks:
- id: markdownlint
args:
- --ignore
- CHANGELOG.md

- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args:
- '--baseline'
- '.secrets.baseline'
exclude: 'pnpm-lock.yaml'

- repo: https://github.com/sirosen/texthooks
rev: 0.6.7
hooks:
- id: fix-smartquotes
- id: fix-ligatures
- id: forbid-bidi-controls

- repo: https://github.com/zricethezav/gitleaks
rev: v8.21.0
hooks:
- id: gitleaks

- repo: https://github.com/fsfe/reuse-tool
rev: 'v4.0.3'
hooks:
- id: reuse

- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 38.124.0
hooks:
- id: renovate-config-validator

- repo: https://github.com/Calinou/pre-commit-luacheck
rev: v1.0.0
hooks:
- id: luacheck
- repo: https://github.com/JohnnyMorganz/StyLua
rev: v0.20.0
hooks:
- id: stylua # or stylua-system / stylua-github
17 changes: 17 additions & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# SPDX-FileCopyrightText: 2022 - 2024 Ali Sajid Imami
#
# SPDX-License-Identifier: MIT

branches:
- main
- name: next
prerelease: true

plugins:
- '@semantic-release/commit-analyzer'
- '@semantic-release/release-notes-generator'
- - '@semantic-release/git'
- assets:
['CHANGELOG.md']
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
- '@semantic-release/github'
Loading
Loading