-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add CI to lint the codebase. (#78)
I've found some inconsistencies in the code. So, perhaps this PR will solve the issue. This PR adds: - [typos by crate-ci](https://github.com/crate-ci/typos), to fix and check for typos. - [dprint by dprint](https://github.com/dprint/dprint), to properly format markdown, YAML, and Dockerfile files. The mentioned tools are also included inside the `justfile`. So, one is able to check locally just using `just fmt` or `just fmt-check`.
- Loading branch information
Showing
27 changed files
with
374 additions
and
237 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,11 @@ | ||
{ | ||
"markdown": {}, | ||
"toml": {}, | ||
"dockerfile": {}, | ||
"excludes": [], | ||
"plugins": [ | ||
"https://plugins.dprint.dev/markdown-0.17.1.wasm", | ||
"https://plugins.dprint.dev/toml-0.6.2.wasm", | ||
"https://plugins.dprint.dev/dockerfile-0.3.2.wasm" | ||
] | ||
} |
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,40 @@ | ||
name: Lint | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
code_quality: | ||
name: Code quality | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: taiki-e/install-action@just | ||
- uses: taiki-e/install-action@dprint | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: typos-cli | ||
|
||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
|
||
- name: Install dependencies | ||
run: | | ||
pnpm install | ||
- name: Show version information | ||
shell: bash | ||
run: | | ||
just --version | ||
dprint --version | ||
typos --version | ||
pnpm --version | ||
- name: Lint codebase | ||
shell: bash | ||
run: | | ||
just lint | ||
just fmt-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 |
---|---|---|
|
@@ -2,3 +2,10 @@ | |
pnpm-lock.yaml | ||
package-lock.json | ||
yarn.lock | ||
|
||
# Managed by dprint | ||
*.yml | ||
*.yaml | ||
*.md | ||
|
||
static/ |
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,2 @@ | ||
[default.extend-words] | ||
ratatui = "ratatui" |
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,4 +1,4 @@ | ||
Weird source code is Copyright (c) 2024 Weird team ([Erlend Sogge Heggen](https://github.com/erlend-sh/), [Kapono Haws](https://github.com/zicklag/) & [Joe](https://github.com/hnb-ku)) \ | ||
Weird source code is Copyright (c) 2024 Weird team ([Erlend Sogge Heggen](https://github.com/erlend-sh/), [Kapono Haws](https://github.com/zicklag/) & [Joe](https://github.com/hnb-ku))\ | ||
and licensed as [PolyForm NonCommercial v1.0](https://polyformproject.org/licenses/noncommercial/1.0.0/). | ||
|
||
..except for the general utilities of `/example`, `/example2` and `/example3`, which are licensed under [Blue Oak Model License v1.0](https://blueoakcouncil.org/license/1.0.0). | ||
..except for the general utilities of `/example`, `/example2` and `/example3`, which are licensed under [Blue Oak Model License v1.0](https://blueoakcouncil.org/license/1.0.0). |
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
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
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 |
---|---|---|
|
@@ -3,4 +3,3 @@ FROM scratch | |
COPY --from=rauthy /app/rauthy / | ||
COPY --from=rauthy /app/rauthy.cfg / | ||
CMD "/idontexist" | ||
|
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,43 @@ | ||
#!/usr/bin/env -S just --justfile | ||
|
||
set dotenv-load := true | ||
|
||
alias d := dev | ||
alias f := fmt | ||
alias l := lint | ||
alias c := comply | ||
alias k := check | ||
|
||
# List available commands. | ||
_default: | ||
just --list --unsorted | ||
|
||
# Setup the repository. | ||
setup: | ||
docker compose up -d | ||
pnpm i | ||
|
||
# Tasks to make the code-base comply with the rules. Mostly used in git hooks. | ||
comply: fmt lint | ||
|
||
# Check if the repository comply with the rules and ready to be pushed. | ||
check: fmt-check lint | ||
|
||
# Develop the app. | ||
dev: | ||
pnpm run dev | ||
|
||
# Format the codebase. | ||
fmt: | ||
pnpm run format | ||
dprint fmt | ||
|
||
# Check is the codebase properly formatted. | ||
fmt-check: | ||
dprint check | ||
|
||
# Lint the codebase. | ||
lint: | ||
pnpm run lint | ||
# Run `typos --write-changes` to fix the mistakes | ||
typos |
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 |
---|---|---|
|
@@ -2,4 +2,3 @@ | |
@tailwind components; | ||
@tailwind utilities; | ||
@tailwind variants; | ||
|
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,8 +1,8 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* Calculates the Proof of Work for the given challenge | ||
* @param {string} challenge | ||
* @returns {Promise<string | undefined>} | ||
*/ | ||
* Calculates the Proof of Work for the given challenge | ||
* @param {string} challenge | ||
* @returns {Promise<string | undefined>} | ||
*/ | ||
export function pow_work_wasm(challenge: string): Promise<string | undefined>; |
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,4 +1,4 @@ | ||
import * as wasm from "./spow-wasm_bg.wasm"; | ||
import { __wbg_set_wasm } from "./spow-wasm_bg.js"; | ||
import * as wasm from './spow-wasm_bg.wasm'; | ||
import { __wbg_set_wasm } from './spow-wasm_bg.js'; | ||
__wbg_set_wasm(wasm); | ||
export * from "./spow-wasm_bg.js"; | ||
export * from './spow-wasm_bg.js'; |
Oops, something went wrong.