This commit introduces a boilerplate inspired by https://github.com/numerique-gouv/impress. The code has been cleaned to remove unnecessary Impress logic and dependencies. Changes made: - Removed Minio, WebRTC, and create bucket from the stack. - Removed the Next.js frontend (it will be replaced by Vite). - Cleaned up impress-specific backend logics. The whole stack remains functional: - All tests pass. - Linter checks pass. - Agent Connexion sources are already set-up. Why clear out the code? To adhere to the KISS principle, we aim to maintain a minimalist codebase. Cloning Impress allowed us to quickly inherit its code quality tools and deployment configurations for staging, pre-production, and production environments. What’s broken? - The tsclient is not functional anymore. - Some make commands need to be fixed. - Helm sources are outdated. - Naming across the project sources are inconsistent (impress, visio, etc.) - CI is not configured properly. This list might be incomplete. Let's grind it.
39 lines
974 B
Bash
Executable File
39 lines
974 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# shellcheck source=bin/_config.sh
|
|
source "$(dirname "${BASH_SOURCE[0]}")/_config.sh"
|
|
|
|
declare diff_from
|
|
declare -a paths
|
|
declare -a args
|
|
|
|
# Parse options
|
|
for arg in "$@"
|
|
do
|
|
case $arg in
|
|
--diff-only=*)
|
|
diff_from="${arg#*=}"
|
|
shift
|
|
;;
|
|
-*)
|
|
args+=("$arg")
|
|
shift
|
|
;;
|
|
*)
|
|
paths+=("$arg")
|
|
shift
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [[ -n "${diff_from}" ]]; then
|
|
# Run pylint only on modified files located in src/backend
|
|
# (excluding deleted files and migration files)
|
|
# shellcheck disable=SC2207
|
|
paths=($(git diff "${diff_from}" --name-only --diff-filter=d -- src/backend ':!**/migrations/*.py' | grep -E '^src/backend/.*\.py$'))
|
|
fi
|
|
|
|
# Fix docker vs local path when project sources are mounted as a volume
|
|
read -ra paths <<< "$(echo "${paths[@]}" | sed "s|src/backend/||g")"
|
|
_dc_run app-dev pylint "${paths[@]}" "${args[@]}"
|