-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-config-files.sh.jinja
More file actions
executable file
·38 lines (28 loc) · 1.02 KB
/
setup-config-files.sh.jinja
File metadata and controls
executable file
·38 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
# shellcheck disable=SC1091
set -e
set -u
ROOT_DIR=$(git rev-parse --show-toplevel)
. "$ROOT_DIR/tools/ci/general.sh"
function main() {
cd "$ROOT_DIR"
# We link config files to the root directory.
# To make IDE formatting setups work and also
# such that we do not need to configure all formatters
# in `treefmt-nix`.
ci::print_info "Linking configs files to root '$ROOT_DIR'."
rm -rf ".prettierrc.yaml" || true
ln -s "tools/configs/prettier/prettierrc.yaml" ".prettierrc.yaml"
rm -rf ".typos.toml" || true
ln -s "tools/configs/typos/typos.toml" ".typos.toml"
rm -rf ".yamllint.yaml" || true
ln -s "tools/configs/yamllint/yamllint.yaml" ".yamllint.yaml"
{% if project_language == "rust" -%}
rm -rf ".rustfmt.toml" || true
ln -s "tools/configs/rust/rustfmt.toml" ".rustfmt.toml"
{% elif project_language == "go" -%}
rm -rf ".golangci.yaml" || true
ln -s "tools/configs/golangci-lint/golangci.yaml" ".golangci.yaml"
{%- endif %}
}
main "$@"