Skip to content

Commit 19dc246

Browse files
committed
Run Prettier to reformat various scripts and configuration files for consistent styling across the project.
1 parent 6bebc02 commit 19dc246

File tree

47 files changed

+626
-484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+626
-484
lines changed

.github/scripts/version-bump.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ main() {
192192

193193
# Always run formatter to ensure consistent formatting
194194
echo "🔧 Running formatter to ensure consistent formatting..."
195-
if command -v bun >/dev/null 2>&1; then
196-
bun fmt >/dev/null 2>&1 || echo "⚠️ Warning: bun fmt failed, but continuing..."
195+
if command -v bun > /dev/null 2>&1; then
196+
bun fmt > /dev/null 2>&1 || echo "⚠️ Warning: bun fmt failed, but continuing..."
197197
else
198198
echo "⚠️ Warning: bun not found, skipping formatting"
199199
fi

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
- name: golangci-lint
2222
uses: golangci/golangci-lint-action@v8
2323
with:
24-
version: v2.1
24+
version: v2.1

.github/workflows/release.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,33 @@ jobs:
1111
permissions:
1212
contents: write
1313
pull-requests: read
14-
14+
1515
steps:
1616
- name: Checkout code
1717
uses: actions/checkout@v5
1818
with:
1919
fetch-depth: 0
2020
persist-credentials: false
21-
21+
2222
- name: Extract tag information
2323
id: tag_info
2424
run: |
2525
TAG=${GITHUB_REF#refs/tags/}
2626
echo "tag=$TAG" >> $GITHUB_OUTPUT
27-
27+
2828
IFS='/' read -ra PARTS <<< "$TAG"
2929
NAMESPACE="${PARTS[1]}"
3030
MODULE="${PARTS[2]}"
3131
VERSION="${PARTS[3]}"
32-
32+
3333
echo "namespace=$NAMESPACE" >> $GITHUB_OUTPUT
3434
echo "module=$MODULE" >> $GITHUB_OUTPUT
3535
echo "version=$VERSION" >> $GITHUB_OUTPUT
3636
echo "module_path=registry/$NAMESPACE/modules/$MODULE" >> $GITHUB_OUTPUT
37-
37+
3838
RELEASE_TITLE="$NAMESPACE/$MODULE $VERSION"
3939
echo "release_title=$RELEASE_TITLE" >> $GITHUB_OUTPUT
40-
40+
4141
- name: Find previous tag
4242
id: prev_tag
4343
env:
@@ -46,15 +46,15 @@ jobs:
4646
CURRENT_TAG: ${{ steps.tag_info.outputs.tag }}
4747
run: |
4848
PREV_TAG=$(git tag -l "release/$NAMESPACE/$MODULE/v*" | sort -V | grep -B1 "$CURRENT_TAG" | head -1)
49-
49+
5050
if [ -z "$PREV_TAG" ] || [ "$PREV_TAG" = "$CURRENT_TAG" ]; then
5151
echo "No previous tag found, using initial commit"
5252
PREV_TAG=$(git rev-list --max-parents=0 HEAD)
5353
fi
54-
54+
5555
echo "prev_tag=$PREV_TAG" >> $GITHUB_OUTPUT
5656
echo "Previous tag: $PREV_TAG"
57-
57+
5858
- name: Generate changelog
5959
id: changelog
6060
env:
@@ -64,15 +64,15 @@ jobs:
6464
CURRENT_TAG: ${{ steps.tag_info.outputs.tag }}
6565
run: |
6666
echo "Generating changelog for $MODULE_PATH between $PREV_TAG and $CURRENT_TAG"
67-
67+
6868
COMMITS=$(git log --oneline --no-merges "$PREV_TAG..$CURRENT_TAG" -- "$MODULE_PATH")
69-
69+
7070
if [ -z "$COMMITS" ]; then
7171
echo "No commits found for this module"
7272
echo "changelog=No changes found for this module." >> $GITHUB_OUTPUT
7373
exit 0
7474
fi
75-
75+
7676
if [[ "$PREV_TAG" == release/* ]]; then
7777
FULL_CHANGELOG=$(gh api repos/:owner/:repo/releases/generate-notes \
7878
--field tag_name="$CURRENT_TAG" \
@@ -82,11 +82,11 @@ jobs:
8282
echo "New module detected, skipping GitHub API"
8383
FULL_CHANGELOG=""
8484
fi
85-
85+
8686
MODULE_COMMIT_SHAS=$(git log --format="%H" --no-merges "$PREV_TAG..$CURRENT_TAG" -- "$MODULE_PATH")
87-
87+
8888
FILTERED_CHANGELOG="## What's Changed\n\n"
89-
89+
9090
for sha in $MODULE_COMMIT_SHAS; do
9191
SHORT_SHA=${sha:0:7}
9292
@@ -100,11 +100,11 @@ jobs:
100100
FILTERED_CHANGELOG="${FILTERED_CHANGELOG}* $COMMIT_MSG by @$AUTHOR\n"
101101
fi
102102
done
103-
103+
104104
echo "changelog<<EOF" >> $GITHUB_OUTPUT
105105
echo -e "$FILTERED_CHANGELOG" >> $GITHUB_OUTPUT
106106
echo "EOF" >> $GITHUB_OUTPUT
107-
107+
108108
- name: Create Release
109109
env:
110110
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -114,4 +114,4 @@ jobs:
114114
run: |
115115
gh release create "$TAG_NAME" \
116116
--title "$RELEASE_TITLE" \
117-
--notes "$CHANGELOG"
117+
--notes "$CHANGELOG"

.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ linters:
163163
staticcheck:
164164
checks:
165165
- all
166-
- SA4006 # Detects redundant assignments
167-
- SA4009 # Detects redundant variable declarations
166+
- SA4006 # Detects redundant assignments
167+
- SA4009 # Detects redundant variable declarations
168168
- SA1019
169169
exclusions:
170170
generated: lax

.prettierignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Ignore symlinks to avoid Prettier errors
2+
CLAUDE.md
3+
.github/copilot-instructions.md
4+
5+
# Ignore node_modules and dependencies
6+
node_modules/
7+
8+
# Ignore Terraform files (formatted by terraform fmt)
9+
*.tf
10+
*.hcl
11+
*.tfvars
12+
13+
# Ignore generated and temporary files
14+
.terraform/
15+
*.tfstate
16+
*.tfstate.backup
17+
*.tfstate.lock.info
18+
19+
# Ignore other files that shouldn't be formatted
20+
bun.lock
21+
go.sum
22+
go.mod

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "registry",
33
"scripts": {
4-
"fmt": "bun x prettier --write **/*.sh **/*.ts **/*.md *.md && terraform fmt -recursive -diff",
5-
"fmt:ci": "bun x prettier --check **/*.sh **/*.ts **/*.md *.md && terraform fmt -check -recursive -diff",
4+
"fmt": "bun x prettier --write . && terraform fmt -recursive -diff",
5+
"fmt:ci": "bun x prettier --check . && terraform fmt -check -recursive -diff",
66
"terraform-validate": "./scripts/terraform_validate.sh",
77
"test": "./scripts/terraform_test_all.sh",
88
"update-version": "./update-version.sh"

registry/anomaly/modules/tmux/main.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ describe("tmux module", async () => {
2828

2929
// check that the script contains expected lines
3030
expect(scriptResource.script).toContain("Installing tmux");
31-
expect(scriptResource.script).toContain("Installing Tmux Plugin Manager (TPM)");
31+
expect(scriptResource.script).toContain(
32+
"Installing Tmux Plugin Manager (TPM)",
33+
);
3234
expect(scriptResource.script).toContain("tmux configuration created at");
3335
expect(scriptResource.script).toContain("✅ tmux setup complete!");
3436
});

registry/anomaly/modules/tmux/scripts/run.sh

Lines changed: 83 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -8,75 +8,75 @@ TMUX_CONFIG="${TMUX_CONFIG}"
88

99
# Function to install tmux
1010
install_tmux() {
11-
printf "Checking for tmux installation\n"
12-
13-
if command -v tmux &> /dev/null; then
14-
printf "tmux is already installed \n\n"
15-
return 0
16-
fi
17-
18-
printf "Installing tmux \n\n"
19-
20-
# Detect package manager and install tmux
21-
if command -v apt-get &> /dev/null; then
22-
sudo apt-get update
23-
sudo apt-get install -y tmux
24-
elif command -v yum &> /dev/null; then
25-
sudo yum install -y tmux
26-
elif command -v dnf &> /dev/null; then
27-
sudo dnf install -y tmux
28-
elif command -v zypper &> /dev/null; then
29-
sudo zypper install -y tmux
30-
elif command -v apk &> /dev/null; then
31-
sudo apk add tmux
32-
elif command -v brew &> /dev/null; then
33-
brew install tmux
34-
else
35-
printf "No supported package manager found. Please install tmux manually. \n"
36-
exit 1
37-
fi
38-
39-
printf "tmux installed successfully \n"
11+
printf "Checking for tmux installation\n"
12+
13+
if command -v tmux &> /dev/null; then
14+
printf "tmux is already installed \n\n"
15+
return 0
16+
fi
17+
18+
printf "Installing tmux \n\n"
19+
20+
# Detect package manager and install tmux
21+
if command -v apt-get &> /dev/null; then
22+
sudo apt-get update
23+
sudo apt-get install -y tmux
24+
elif command -v yum &> /dev/null; then
25+
sudo yum install -y tmux
26+
elif command -v dnf &> /dev/null; then
27+
sudo dnf install -y tmux
28+
elif command -v zypper &> /dev/null; then
29+
sudo zypper install -y tmux
30+
elif command -v apk &> /dev/null; then
31+
sudo apk add tmux
32+
elif command -v brew &> /dev/null; then
33+
brew install tmux
34+
else
35+
printf "No supported package manager found. Please install tmux manually. \n"
36+
exit 1
37+
fi
38+
39+
printf "tmux installed successfully \n"
4040
}
4141

4242
# Function to install Tmux Plugin Manager (TPM)
4343
install_tpm() {
44-
local tpm_dir="$HOME/.tmux/plugins/tpm"
45-
46-
if [ -d "$tpm_dir" ]; then
47-
printf "TPM is already installed"
48-
return 0
49-
fi
50-
51-
printf "Installing Tmux Plugin Manager (TPM) \n"
52-
53-
# Create plugins directory
54-
mkdir -p "$HOME/.tmux/plugins"
55-
56-
# Clone TPM repository
57-
if command -v git &> /dev/null; then
58-
git clone https://github.com/tmux-plugins/tpm "$tpm_dir"
59-
printf "TPM installed successfully"
60-
else
61-
printf "Git is not installed. Please install git to use tmux plugins. \n"
62-
exit 1
63-
fi
44+
local tpm_dir="$HOME/.tmux/plugins/tpm"
45+
46+
if [ -d "$tpm_dir" ]; then
47+
printf "TPM is already installed"
48+
return 0
49+
fi
50+
51+
printf "Installing Tmux Plugin Manager (TPM) \n"
52+
53+
# Create plugins directory
54+
mkdir -p "$HOME/.tmux/plugins"
55+
56+
# Clone TPM repository
57+
if command -v git &> /dev/null; then
58+
git clone https://github.com/tmux-plugins/tpm "$tpm_dir"
59+
printf "TPM installed successfully"
60+
else
61+
printf "Git is not installed. Please install git to use tmux plugins. \n"
62+
exit 1
63+
fi
6464
}
6565

6666
# Function to create tmux configuration
6767
setup_tmux_config() {
68-
printf "Setting up tmux configuration \n"
68+
printf "Setting up tmux configuration \n"
6969

70-
local config_dir="$HOME/.tmux"
71-
local config_file="$HOME/.tmux.conf"
70+
local config_dir="$HOME/.tmux"
71+
local config_file="$HOME/.tmux.conf"
7272

73-
mkdir -p "$config_dir"
73+
mkdir -p "$config_dir"
7474

75-
if [ -n "$TMUX_CONFIG" ]; then
76-
printf "$TMUX_CONFIG" > "$config_file"
77-
printf "$${BOLD}Custom tmux configuration applied at {$config_file} \n\n"
78-
else
79-
cat > "$config_file" << EOF
75+
if [ -n "$TMUX_CONFIG" ]; then
76+
printf "$TMUX_CONFIG" > "$config_file"
77+
printf "$${BOLD}Custom tmux configuration applied at {$config_file} \n\n"
78+
else
79+
cat > "$config_file" << EOF
8080
# Tmux Configuration File
8181
8282
# =============================================================================
@@ -106,48 +106,48 @@ bind C-r run-shell "~/.tmux/plugins/tmux-resurrect/scripts/restore.sh"
106106
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
107107
run '~/.tmux/plugins/tpm/tpm'
108108
EOF
109-
printf "tmux configuration created at {$config_file} \n\n"
110-
fi
109+
printf "tmux configuration created at {$config_file} \n\n"
110+
fi
111111
}
112112

113113
# Function to install tmux plugins
114114
install_plugins() {
115-
printf "Installing tmux plugins"
115+
printf "Installing tmux plugins"
116116

117-
# Check if TPM is installed
118-
if [ ! -d "$HOME/.tmux/plugins/tpm" ]; then
119-
printf "TPM is not installed. Cannot install plugins. \n"
120-
return 1
121-
fi
117+
# Check if TPM is installed
118+
if [ ! -d "$HOME/.tmux/plugins/tpm" ]; then
119+
printf "TPM is not installed. Cannot install plugins. \n"
120+
return 1
121+
fi
122122

123-
# Install plugins using TPM
124-
"$HOME/.tmux/plugins/tpm/bin/install_plugins"
123+
# Install plugins using TPM
124+
"$HOME/.tmux/plugins/tpm/bin/install_plugins"
125125

126-
printf "tmux plugins installed successfully \n"
126+
printf "tmux plugins installed successfully \n"
127127
}
128128

129129
# Main execution
130130
main() {
131-
printf "$${BOLD} 🛠️Setting up tmux with session persistence! \n\n"
132-
printf ""
131+
printf "$${BOLD} 🛠️Setting up tmux with session persistence! \n\n"
132+
printf ""
133133

134-
# Install dependencies
135-
install_tmux
136-
install_tpm
134+
# Install dependencies
135+
install_tmux
136+
install_tpm
137137

138-
# Setup tmux configuration
139-
setup_tmux_config
138+
# Setup tmux configuration
139+
setup_tmux_config
140140

141-
# Install plugins
142-
install_plugins
141+
# Install plugins
142+
install_plugins
143143

144-
printf "$${BOLD}✅ tmux setup complete! \n\n"
144+
printf "$${BOLD}✅ tmux setup complete! \n\n"
145145

146-
printf "$${BOLD} Attempting to restore sessions\n"
147-
tmux new-session -d \; source-file ~/.tmux.conf \; run-shell '~/.tmux/plugins/tmux-resurrect/scripts/restore.sh'
148-
printf "$${BOLD} Sessions restored: -> %s\n" "$(tmux ls)"
146+
printf "$${BOLD} Attempting to restore sessions\n"
147+
tmux new-session -d \; source-file ~/.tmux.conf \; run-shell '~/.tmux/plugins/tmux-resurrect/scripts/restore.sh'
148+
printf "$${BOLD} Sessions restored: -> %s\n" "$(tmux ls)"
149149

150150
}
151151

152152
# Run main function
153-
main
153+
main

0 commit comments

Comments
 (0)