-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
to be included locally in repos no registry handling copy/paste distribution
- Loading branch information
1 parent
29c988a
commit 7d1484f
Showing
25 changed files
with
722 additions
and
0 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,51 @@ | ||
rules: | ||
body-leading-blank: | ||
- 1 | ||
- always | ||
body-max-line-length: | ||
- 2 | ||
- always | ||
- 96 | ||
footer-leading-blank: | ||
- 1 | ||
- always | ||
footer-max-line-length: | ||
- 2 | ||
- always | ||
- 96 | ||
header-max-length: | ||
- 2 | ||
- always | ||
- 72 # github hides text beyond this length behind an ellipsis | ||
subject-case: | ||
- 2 | ||
- always | ||
- - lower-case | ||
- kebab-case | ||
- snake-case | ||
subject-empty: | ||
- 2 | ||
- never | ||
subject-full-stop: | ||
- 2 | ||
- never | ||
- . | ||
type-empty: | ||
- 2 | ||
- never | ||
|
||
# Semver commit type convention | ||
# | ||
# M (MAJOR) => Incompatible change | ||
# m (MINOR) => Backward compatible feature | ||
# p (PATCH) => Backward compatible bug fix | ||
# r (REVISION/REFACTOR) => Backward compatible improvement | ||
# x (MISCELLANEOUS) => Neutral change (documentation, ci/cd, dev dependencies, etc.) | ||
type-enum: | ||
- 2 | ||
- always | ||
- - M | ||
- m | ||
- p | ||
- r | ||
- x |
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,10 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
max_line_length = 96 |
Validating CODEOWNERS rules …
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 @@ | ||
* @logisparte/homoioi |
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,28 @@ | ||
name: ci-branch | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
env: | ||
DOCKER_BUILDKIT: true | ||
|
||
jobs: | ||
check-branch: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone project | ||
uses: actions/checkout@v4 | ||
|
||
- name: Initialize development environment | ||
run: ./docker/env.sh init | ||
|
||
- name: Start development environment | ||
run: ./docker/env.sh up | ||
|
||
- name: Lint project | ||
run: ./docker/env.sh exec ./scripts/lint.sh all | ||
|
||
- name: Stop development environment | ||
run: ./docker/env.sh down |
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,4 @@ | ||
default: true | ||
MD013: | ||
line_length: 96 | ||
code_blocks: false |
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 @@ | ||
printWidth: 96 | ||
proseWrap: always |
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 @@ | ||
disable=SC1090,SC1091 |
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,46 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM ubuntu:24.04 AS base | ||
|
||
LABEL org.opencontainers.image.authors="@logisparte" | ||
LABEL org.opencontainers.image.source="https://github.com/logisparte/docker-env" | ||
|
||
RUN <<EOF | ||
DEBIAN_FRONTEND=noninteractive \ | ||
apt-get update && apt-get install --yes --quiet --no-install-recommends \ | ||
apt-transport-https \ | ||
bash \ | ||
ca-certificates \ | ||
curl \ | ||
git \ | ||
gnupg2 \ | ||
software-properties-common \ | ||
ssh-client \ | ||
sudo \ | ||
vim \ | ||
wget \ | ||
zsh | ||
apt-get clean | ||
rm -rf /var/lib/apt/lists/* | ||
EOF | ||
|
||
ENV EDITOR="/usr/bin/vim" | ||
|
||
FROM base AS project | ||
|
||
RUN <<EOF | ||
curl --silent --fail --show-error --location https://deb.nodesource.com/setup_lts.x \ | ||
| bash - | ||
DEBIAN_FRONTEND=noninteractive \ | ||
apt-get update && apt-get install --yes --quiet --no-install-recommends \ | ||
nodejs \ | ||
shellcheck \ | ||
shfmt | ||
npm config --location=global set update-notifier=false fund=false | ||
npm install --location=global --omit=dev --omit=optional \ | ||
markdownlint-cli \ | ||
prettier \ | ||
@commitlint/cli | ||
npm cache clean --force | ||
apt-get clean | ||
rm -rf /var/lib/apt/lists/* | ||
EOF |
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 @@ | ||
../src/compose.yaml |
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 @@ | ||
../src/env.sh |
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 @@ | ||
# docker-env | ||
|
||
Containerized development environments | ||
|
||
## License | ||
|
||
This repository is distributed under the terms of the [Apache 2.0 license](/LICENSE) |
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,3 @@ | ||
#!/bin/sh -e | ||
|
||
commitlint --edit "$@" |
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,4 @@ | ||
#!/bin/sh -e | ||
|
||
./scripts/format.sh staged | ||
./scripts/lint.sh staged |
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,54 @@ | ||
#!/bin/sh -e | ||
|
||
. ./scripts/utils/colorize.sh | ||
. ./scripts/utils/git/list_all_files.sh | ||
. ./scripts/utils/git/list_dirty_files.sh | ||
. ./scripts/utils/git/list_staged_files.sh | ||
. ./scripts/utils/report.sh | ||
|
||
FILTER="${1:-dirty}" | ||
|
||
case "$FILTER" in | ||
dirty) | ||
report --info "[format] Formatting dirty files only" | ||
FILES="$(list_dirty_files)" | ||
;; | ||
|
||
staged) | ||
report --info "[format] Formatting staged files only" | ||
FILES=$(list_staged_files) | ||
;; | ||
|
||
all) | ||
report --info "[format] Formatting all files" | ||
FILES="$(list_all_files)" | ||
;; | ||
|
||
*) | ||
report --error "[format] Unknown filter: '$FILTER'" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# Skip symbolic links | ||
FILES="$({ | ||
for FILE in $FILES; do | ||
[ -L "$FILE" ] && continue | ||
echo "$FILE" | ||
done | ||
})" | ||
|
||
PRETTIER_FILES="$(echo "$FILES" | grep -e "\.md$" -e "\.yml$" -e "\.yaml$" || true)" | ||
if [ -n "$PRETTIER_FILES" ]; then | ||
report --info "Markdown and yaml files >>" | ||
echo "$PRETTIER_FILES" | xargs prettier --write | ||
fi | ||
|
||
SHFMT_FILES="$(echo "$FILES" | grep -e "\.sh$" || true)" | ||
if [ -n "$SHFMT_FILES" ]; then | ||
report --info "Shell files >>" | ||
report "$(colorize --gray "$SHFMT_FILES")" | ||
echo "$SHFMT_FILES" | xargs shfmt -p -w -bn -ci -sr -kp -i 2 | ||
fi | ||
|
||
report --success "[format] Done" |
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,55 @@ | ||
#!/bin/sh -e | ||
|
||
. ./scripts/utils/colorize.sh | ||
. ./scripts/utils/git/list_all_files.sh | ||
. ./scripts/utils/git/list_dirty_files.sh | ||
. ./scripts/utils/git/list_staged_files.sh | ||
. ./scripts/utils/report.sh | ||
|
||
FILTER="${1:-dirty}" | ||
|
||
case "$FILTER" in | ||
dirty) | ||
report --info "[lint] Linting dirty files only" | ||
FILES="$(list_dirty_files)" | ||
;; | ||
|
||
staged) | ||
report --info "[lint] Linting staged files only" | ||
FILES=$(list_staged_files) | ||
;; | ||
|
||
all) | ||
report --info "[lint] Linting all files" | ||
FILES="$(list_all_files)" | ||
;; | ||
|
||
*) | ||
report --error "[lint] Unknown filter: '$FILTER'" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# Skip symbolic links | ||
FILES="$({ | ||
for FILE in $FILES; do | ||
[ -L "$FILE" ] && continue | ||
echo "$FILE" | ||
done | ||
})" | ||
|
||
MARKDOWN_FILES="$(echo "$FILES" | grep -e "\.md$" || true)" | ||
if [ -n "$MARKDOWN_FILES" ]; then | ||
report --info "Markdown files >>" | ||
report "$(colorize --gray "$MARKDOWN_FILES")" | ||
echo "$MARKDOWN_FILES" | xargs markdownlint | ||
fi | ||
|
||
SHELLCHECK_FILES="$(echo "$FILES" | grep -e "\.sh$" || true)" | ||
if [ -n "$SHELLCHECK_FILES" ]; then | ||
report --info "Shell files >>" | ||
report "$(colorize --gray "$SHELLCHECK_FILES")" | ||
echo "$SHELLCHECK_FILES" | xargs shellcheck | ||
fi | ||
|
||
report --success "[lint] Done" |
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 @@ | ||
#!/bin/sh -e | ||
|
||
. ./scripts/utils/report.sh | ||
|
||
report --info "[postclone] Configuring git hooks" | ||
git config --local core.hooksPath "$PWD/hooks" | ||
report --success "[postclone] Done" |
Oops, something went wrong.