Skip to content

Commit bb1c6bb

Browse files
committed
fix: linting
1 parent c4d3ff0 commit bb1c6bb

File tree

3 files changed

+26
-22
lines changed

3 files changed

+26
-22
lines changed

scripts/bash/detect-workflow-config.sh

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ detect_workflow_config() {
2020
fi
2121

2222
# Extract mode (look for line: **Workflow Mode**: build|spec)
23-
local mode_line=$(grep "^\*\*Workflow Mode\*\*:" "$spec_file" | head -1)
24-
if [[ -n "$mode_line" ]]; then
25-
mode=$(echo "$mode_line" | sed 's/.*: *\([^ ]*\).*/\1/' | tr -d '[:space:]')
26-
fi
23+
local mode_line
24+
mode_line=$(grep "^\*\*Workflow Mode\*\*:" "$spec_file" | head -1)
25+
local mode="spec"
26+
if [[ -n "$mode_line" ]]; then
27+
mode=$(echo "$mode_line" | sed 's/.*: *\(.*\)/\1/' | tr -d '[:space:]')
28+
fi
2729

2830
# Validate mode (must be build or spec)
2931
if [[ ! "$mode" =~ ^(build|spec)$ ]]; then
@@ -40,21 +42,19 @@ detect_workflow_config() {
4042

4143
# Extract and override with explicit options
4244
# Look for line: **Framework Options**: tdd=true, contracts=false, ...
43-
local options_line=$(grep "^\*\*Framework Options\*\*:" "$spec_file" | head -1 | sed 's/.*: *\(.*\)/\1/')
44-
45-
if [[ -n "$options_line" ]]; then
46-
# Parse: tdd=true, contracts=false, data_models=true, risk_tests=true
47-
local tdd_val=$(echo "$options_line" | grep -o "tdd=[^,]*" | cut -d= -f2 | tr -d '[:space:]')
48-
local contracts_val=$(echo "$options_line" | grep -o "contracts=[^,]*" | cut -d= -f2 | tr -d '[:space:]')
49-
local data_models_val=$(echo "$options_line" | grep -o "data_models=[^,]*" | cut -d= -f2 | tr -d '[:space:]')
50-
local risk_tests_val=$(echo "$options_line" | grep -o "risk_tests=[^,]*" | cut -d= -f2 | tr -d '[:space:]')
45+
local options_line
46+
options_line=$(grep "^\*\*Framework Options\*\*:" "$spec_file" | head -1 | sed 's/.*: *\(.*\)/\1/')
47+
local tdd_val="true"
48+
local contracts_val="true"
49+
local data_models_val="true"
50+
local risk_tests_val="true"
5151

52-
# Override defaults if explicitly set
53-
[[ -n "$tdd_val" ]] && tdd="$tdd_val"
54-
[[ -n "$contracts_val" ]] && contracts="$contracts_val"
55-
[[ -n "$data_models_val" ]] && data_models="$data_models_val"
56-
[[ -n "$risk_tests_val" ]] && risk_tests="$risk_tests_val"
57-
fi
52+
if [[ -n "$options_line" ]]; then
53+
tdd_val=$(echo "$options_line" | grep -o "tdd=[^,]*" | cut -d= -f2 | tr -d '[:space:]')
54+
contracts_val=$(echo "$options_line" | grep -o "contracts=[^,]*" | cut -d= -f2 | tr -d '[:space:]')
55+
data_models_val=$(echo "$options_line" | grep -o "data_models=[^,]*" | cut -d= -f2 | tr -d '[:space:]')
56+
risk_tests_val=$(echo "$options_line" | grep -o "risk_tests=[^,]*" | cut -d= -f2 | tr -d '[:space:]')
57+
fi
5858

5959
# Return as JSON
6060
echo "{\"mode\":\"$mode\",\"tdd\":$tdd,\"contracts\":$contracts,\"data_models\":$data_models,\"risk_tests\":$risk_tests}"

scripts/bash/setup-architecture.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5858
source "$SCRIPT_DIR/common.sh"
5959

6060
# Get all paths and variables from common functions
61-
eval $(get_feature_paths)
61+
eval "$(get_feature_paths)"
6262

6363
# Ensure the memory directory exists
6464
mkdir -p "$REPO_ROOT/memory"
@@ -161,15 +161,18 @@ detect_tech_stack() {
161161
tech_stack+="**Containerization**: Docker\n"
162162
fi
163163

164-
if [[ -d "kubernetes" ]] || [[ -d "k8s" ]] || [[ -f "*.yaml" ]] && grep -q "apiVersion:" *.yaml 2>/dev/null; then
164+
local yaml_files=(*.yaml)
165+
if [[ -d "kubernetes" ]] || [[ -d "k8s" ]] || [[ -f "${yaml_files[0]}" ]] && grep -q "apiVersion:" *.yaml 2>/dev/null; then
165166
tech_stack+="**Orchestration**: Kubernetes\n"
166167
fi
167168

168169
if [[ -d "terraform" ]] || [[ -f "*.tf" ]]; then
169170
tech_stack+="**IaC**: Terraform\n"
170171
fi
171172

172-
if [[ -f ".github/workflows/"*.yml ]] || [[ -f ".github/workflows/"*.yaml ]]; then
173+
local github_yml_files=(".github/workflows/"*.yml)
174+
local github_yaml_files=(".github/workflows/"*.yaml)
175+
if [[ -f "${github_yml_files[0]}" ]] || [[ -f "${github_yaml_files[0]}" ]]; then
173176
tech_stack+="**CI/CD**: GitHub Actions\n"
174177
fi
175178

templates/commands/specify.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Parse the following parameters from `$ARGUMENTS`:
3636
- `--no-risk-tests`: Disable risk-based testing (overrides mode default)
3737

3838
**Mode-Specific Defaults**:
39+
3940
- **Build Mode**: tdd=false, contracts=false, data_models=false, risk_tests=false
4041
- **Spec Mode**: tdd=true, contracts=true, data_models=true, risk_tests=true
4142

@@ -45,7 +46,7 @@ After parsing, extract the feature description (everything after parameters).
4546

4647
1. **Determine Effective Mode**: Parse `--mode` from arguments, default to "spec" if not specified
4748

48-
2. **Determine Effective Options**:
49+
2. **Determine Effective Options**:
4950
- Start with mode-specific defaults
5051
- Override with explicit flags (e.g., `--no-tdd` overrides default)
5152
- Pass to script as: `--mode build --tdd false --contracts false --data-models false --risk-tests false`

0 commit comments

Comments
 (0)