-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: expand linted file types to markdown and shell
Signed-off-by: Vladislav Doster <[email protected]>
- Loading branch information
1 parent
704f4be
commit 96fe03f
Showing
9 changed files
with
732 additions
and
752 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 |
---|---|---|
@@ -1,47 +1,38 @@ | ||
name: 👮 linting | ||
on: [push, pull_request, workflow_dispatch] | ||
name: Lint | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-matrix: | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- name: "📡 Check out repository code" | ||
uses: actions/checkout@v3 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: "💬 Set matrix output" | ||
id: set-matrix | ||
- name: install dependencies | ||
run: | | ||
MATRIX="$(find . -type d -name 'doc' -prune -o -type f -iname '*.zsh' -print | jq -ncR '{"include": [{"file": inputs}]}')" | ||
echo "MATRIX=${MATRIX}" >&2 | ||
echo "::set-output name=matrix::${MATRIX}" | ||
brew install shellcheck shfmt zsh | ||
pip3 install --user linkify-it-py mdformat mdformat-config mdformat-gfm mdformat-shfmt mdformat-tables mdformat-toc | ||
lint: | ||
runs-on: ubuntu-latest | ||
needs: build-matrix | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJSON(needs.build-matrix.outputs.matrix) }} | ||
- name: run mdformat | ||
run: find . -name '*.md' -type f -print0 | xargs -0 -n1 -P4 python3 -m mdformat --check --wrap 120 | ||
|
||
steps: | ||
- name: "📡 Check out repository code" | ||
uses: actions/checkout@v3 | ||
- name: run shfmt | ||
run: find . -name '*.sh' -type f -print0 | xargs -0 -n1 -P4 shfmt -bn -ci -d -i 2 -ln bash -s -sr | ||
|
||
- name: "📦 Install dependencies" | ||
run: | | ||
sudo apt install -y zsh | ||
- name: run shellcheck | ||
run: find . -name '*.sh' -type f -print0 | xargs -0 -n1 -P4 shellcheck | ||
|
||
- name: "👓 zsh -n ${{ matrix.file }}" | ||
env: | ||
ZSH_FILE: ${{ matrix.file }} | ||
run: | | ||
zsh -n "${ZSH_FILE}" | ||
- name: "run zsh" | ||
run: find . -name '*.zsh' -type f -print0 | xargs -0 -n1 -P4 zsh -n | ||
|
||
- name: "💎 zcompile ${{ matrix.file }}" | ||
env: | ||
ZSH_FILE: ${{ matrix.file }} | ||
run: | | ||
zsh -fc "zcompile ${ZSH_FILE}" | ||
rc=$? | ||
ls -al "${ZSH_FILE}.zwc" | ||
exit "$rc" | ||
- name: "run zcompile" | ||
run: find . -name '*.zsh' -type f -exec zsh -fc "zcompile {}" \; |
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,18 +1,22 @@ | ||
# Code documentation | ||
|
||
Here is `Asciidoc` code documentation generated using [Zshelldoc](https://github.com/zdharma-continuum/zshelldoc). | ||
There are `4` Zinit's source files, the main one is [zinit.zsh](zinit.zsh.adoc). The documentation | ||
lists all functions, interactions between them, their comments and features used. | ||
Here is `Asciidoc` code documentation generated using [Zshelldoc](https://github.com/zdharma-continuum/zshelldoc). There | ||
are `4` Zinit's source files, the main one is [zinit.zsh](zinit.zsh.adoc). The documentation lists all functions, | ||
interactions between them, their comments and features used. | ||
|
||
Github allows to directly view `Asciidoc` documents: | ||
* [zinit.zsh](zinit.zsh.adoc) – always loaded, in `.zshrc` ([pdf](https://zdharma-continuum.github.io/zinit/wiki/zinit.zsh)) | ||
* [zinit-side.zsh](zinit-side.zsh.adoc) – common functions, loaded by `*-install` and `*-autoload` scripts ([pdf](https://zdharma-continuum.github.io/zinit/wiki/zinit-side.zsh)) | ||
* [zinit-install.zsh](zinit-install.zsh.adoc) – functions used only when installing a plugin or snippet ([pdf](https://zdharma-continuum.github.io/zinit/wiki/zinit-install.zsh)) | ||
* [zinit-autoload.zsh](zinit-autoload.zsh.adoc) – functions used only in interactive `Zinit` invocations ([pdf](https://zdharma-continuum.github.io/zinit/wiki/zinit-autoload.zsh/)) | ||
|
||
- [zinit.zsh](zinit.zsh.adoc) – always loaded, in `.zshrc` | ||
([pdf](https://zdharma-continuum.github.io/zinit/wiki/zinit.zsh)) | ||
- [zinit-side.zsh](zinit-side.zsh.adoc) – common functions, loaded by `*-install` and `*-autoload` scripts | ||
([pdf](https://zdharma-continuum.github.io/zinit/wiki/zinit-side.zsh)) | ||
- [zinit-install.zsh](zinit-install.zsh.adoc) – functions used only when installing a plugin or snippet | ||
([pdf](https://zdharma-continuum.github.io/zinit/wiki/zinit-install.zsh)) | ||
- [zinit-autoload.zsh](zinit-autoload.zsh.adoc) – functions used only in interactive `Zinit` invocations | ||
([pdf](https://zdharma-continuum.github.io/zinit/wiki/zinit-autoload.zsh/)) | ||
|
||
# PDFs, man pages, etc. | ||
|
||
Formats other than `Asciidoc` can be produced by using provided Makefile. For example, issuing | ||
`make pdf` will create and populate a new directory `pdf` (requires `asciidoctor`, install with | ||
`gem install asciidoctor-pdf --pre`). `make man` will create man pages (requires package `asciidoc`, | ||
uses its command `a2x`, which is quite slow). | ||
Formats other than `Asciidoc` can be produced by using provided Makefile. For example, issuing `make pdf` will create | ||
and populate a new directory `pdf` (requires `asciidoctor`, install with `gem install asciidoctor-pdf --pre`). | ||
`make man` will create man pages (requires package `asciidoc`, uses its command `a2x`, which is quite slow). |
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
Oops, something went wrong.