mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 11:31:46 +00:00
style: standardize punctuation across codebase
- Replace parentheses with commas for supplementary info - Use commas instead of em-dashes for separators - Update bullet points from - to * in some contexts - Improve version extraction regex with fallback logic
This commit is contained in:
@@ -14,7 +14,7 @@ usage() {
|
||||
Usage: ./scripts/check.sh [--format|--no-format]
|
||||
|
||||
Options:
|
||||
--format Apply formatting fixes only (shfmt, gofmt)
|
||||
--format Apply formatting fixes only, shfmt, gofmt
|
||||
--no-format Skip formatting and run checks only
|
||||
--help Show this help
|
||||
EOF
|
||||
@@ -55,7 +55,7 @@ readonly ICON_ERROR="☻"
|
||||
readonly ICON_WARNING="●"
|
||||
readonly ICON_LIST="•"
|
||||
|
||||
echo -e "${BLUE}=== Mole Check (${MODE}) ===${NC}\n"
|
||||
echo -e "${BLUE}=== Mole Check, ${MODE} ===${NC}\n"
|
||||
|
||||
SHELL_FILES=$(find . -type f \( -name "*.sh" -o -name "mole" \) \
|
||||
-not -path "./.git/*" \
|
||||
@@ -75,11 +75,11 @@ if [[ "$MODE" == "format" ]]; then
|
||||
fi
|
||||
|
||||
if command -v goimports > /dev/null 2>&1; then
|
||||
echo -e "${YELLOW}Formatting Go code (goimports)...${NC}"
|
||||
echo -e "${YELLOW}Formatting Go code, goimports...${NC}"
|
||||
goimports -w -local github.com/tw93/Mole ./cmd
|
||||
echo -e "${GREEN}${ICON_SUCCESS} Go formatting complete${NC}\n"
|
||||
elif command -v go > /dev/null 2>&1; then
|
||||
echo -e "${YELLOW}Formatting Go code (gofmt)...${NC}"
|
||||
echo -e "${YELLOW}Formatting Go code, gofmt...${NC}"
|
||||
gofmt -w ./cmd
|
||||
echo -e "${GREEN}${ICON_SUCCESS} Go formatting complete${NC}\n"
|
||||
else
|
||||
@@ -100,11 +100,11 @@ if [[ "$MODE" != "check" ]]; then
|
||||
fi
|
||||
|
||||
if command -v goimports > /dev/null 2>&1; then
|
||||
echo -e "${YELLOW}2. Formatting Go code (goimports)...${NC}"
|
||||
echo -e "${YELLOW}2. Formatting Go code, goimports...${NC}"
|
||||
goimports -w -local github.com/tw93/Mole ./cmd
|
||||
echo -e "${GREEN}${ICON_SUCCESS} Go formatting applied${NC}\n"
|
||||
elif command -v go > /dev/null 2>&1; then
|
||||
echo -e "${YELLOW}2. Formatting Go code (gofmt)...${NC}"
|
||||
echo -e "${YELLOW}2. Formatting Go code, gofmt...${NC}"
|
||||
gofmt -w ./cmd
|
||||
echo -e "${GREEN}${ICON_SUCCESS} Go formatting applied${NC}\n"
|
||||
fi
|
||||
@@ -148,18 +148,18 @@ fi
|
||||
|
||||
echo -e "${YELLOW}5. Running syntax check...${NC}"
|
||||
if ! bash -n mole; then
|
||||
echo -e "${RED}${ICON_ERROR} Syntax check failed (mole)${NC}\n"
|
||||
echo -e "${RED}${ICON_ERROR} Syntax check failed, mole${NC}\n"
|
||||
exit 1
|
||||
fi
|
||||
for script in bin/*.sh; do
|
||||
if ! bash -n "$script"; then
|
||||
echo -e "${RED}${ICON_ERROR} Syntax check failed ($script)${NC}\n"
|
||||
echo -e "${RED}${ICON_ERROR} Syntax check failed, $script${NC}\n"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
find lib -name "*.sh" | while read -r script; do
|
||||
if ! bash -n "$script"; then
|
||||
echo -e "${RED}${ICON_ERROR} Syntax check failed ($script)${NC}\n"
|
||||
echo -e "${RED}${ICON_ERROR} Syntax check failed, $script${NC}\n"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -392,7 +392,7 @@ ${command}
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
log_success "Workflow ready: ${name} (keyword: ${keyword})"
|
||||
log_success "Workflow ready: ${name}, keyword: ${keyword}"
|
||||
done
|
||||
|
||||
log_step "Open Alfred preferences → Workflows if you need to adjust keywords."
|
||||
@@ -413,11 +413,11 @@ main() {
|
||||
|
||||
echo ""
|
||||
log_success "Done! Raycast and Alfred are ready with 5 commands:"
|
||||
echo " • clean - Deep system cleanup"
|
||||
echo " • uninstall - Remove applications"
|
||||
echo " • optimize - System health & tuning"
|
||||
echo " • analyze - Disk space explorer"
|
||||
echo " • status - Live system monitor"
|
||||
echo " • clean, Deep system cleanup"
|
||||
echo " • uninstall, Remove applications"
|
||||
echo " • optimize, System health & tuning"
|
||||
echo " • analyze, Disk space explorer"
|
||||
echo " • status, Live system monitor"
|
||||
echo ""
|
||||
}
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ echo ""
|
||||
echo "6. Testing installation..."
|
||||
# Skip if Homebrew mole is installed (install.sh will refuse to overwrite)
|
||||
if brew list mole &> /dev/null; then
|
||||
printf "${GREEN}${ICON_SUCCESS} Installation test skipped (Homebrew)${NC}\n"
|
||||
printf "${GREEN}${ICON_SUCCESS} Installation test skipped, Homebrew${NC}\n"
|
||||
elif ./install.sh --prefix /tmp/mole-test > /dev/null 2>&1; then
|
||||
if [ -f /tmp/mole-test/mole ]; then
|
||||
printf "${GREEN}${ICON_SUCCESS} Installation test passed${NC}\n"
|
||||
@@ -203,5 +203,5 @@ if [[ $FAILED -eq 0 ]]; then
|
||||
printf "${GREEN}${ICON_SUCCESS} All tests passed!${NC}\n"
|
||||
exit 0
|
||||
fi
|
||||
printf "${RED}${ICON_ERROR} $FAILED test(s) failed!${NC}\n"
|
||||
printf "${RED}${ICON_ERROR} $FAILED tests failed!${NC}\n"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user