Skip to content

Add Makefile validation#13

Merged
nadimtuhin merged 8 commits intomainfrom
claude/add-makefile-val-011CUoLeqEGzPHfWxyrm5pzN
Nov 6, 2025
Merged

Add Makefile validation#13
nadimtuhin merged 8 commits intomainfrom
claude/add-makefile-val-011CUoLeqEGzPHfWxyrm5pzN

Conversation

@nadimtuhin
Copy link
Owner

Add a new Makefile validator tool with the following features:

  • Real-time syntax validation
  • Detection of common Makefile errors (tabs vs spaces in recipes)
  • Target and dependency parsing
  • Two view modes: Issues view and Structure view
  • Line numbers display
  • Sample Makefile loader
  • Copy and download functionality
  • Validation of targets, dependencies, variables, and recipes

The validator follows the established pattern used by other validators in the project (JSON, YAML) and integrates seamlessly into the app.

Add a new Makefile validator tool with the following features:
- Real-time syntax validation
- Detection of common Makefile errors (tabs vs spaces in recipes)
- Target and dependency parsing
- Two view modes: Issues view and Structure view
- Line numbers display
- Sample Makefile loader
- Copy and download functionality
- Validation of targets, dependencies, variables, and recipes

The validator follows the established pattern used by other validators
in the project (JSON, YAML) and integrates seamlessly into the app.
@vercel
Copy link

vercel bot commented Nov 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
devutils Ready Ready Preview Comment Nov 6, 2025 8:10am

@claude
Copy link
Contributor

claude bot commented Nov 5, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

Added test suite with 11 tests covering:
- Component rendering and UI elements
- Validation logic for various Makefile syntax errors
- Detection of common issues (tabs vs spaces, empty targets, etc.)
- Handling of comments and variable assignments
- Warning messages for targets without recipes

Test results: 9/11 tests passing
- Installed missing @testing-library/dom dependency
- Used React Testing Library best practices
- Proper async/await handling with act() for timer-based tests

The validator successfully detects and reports common Makefile errors.
@claude
Copy link
Contributor

claude bot commented Nov 5, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

Fixed two critical validation logic issues:

1. Empty target name detection
   - Modified regex from /^[^\t].*:/ to /^[^\t]*:/ to match lines
     starting with colon (e.g., ": dependency")
   - This now correctly detects empty target names

2. Tab-indented comments handling
   - Reordered validation checks to process recipe lines (starting
     with tab) BEFORE checking for comments
   - Previously, tab-indented comments closed the current rule,
     causing subsequent recipes to fail
   - Now tab-indented comments are correctly treated as recipe lines

Test results: All 11 tests passing (100%)
- ✓ detects empty target name
- ✓ handles comments correctly
- Plus 9 other validation tests

Build: Successful with no errors
@claude
Copy link
Contributor

claude bot commented Nov 5, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

Root cause: Vercel's npm install was failing due to peer dependency
conflicts with @testing-library/react-hooks package which requires
React 16/17 but the project uses React 18.

Changes:
1. Removed @testing-library/react-hooks from package.json
   - This package is deprecated since @testing-library/react v13+
   - renderHook is now built into @testing-library/react

2. Updated useDebouncedConversion.test.tsx
   - Changed import from @testing-library/react-hooks to @testing-library/react
   - Updated test syntax to use new renderHook API
   - All 3 tests passing

3. Added .npmrc configuration
   - legacy-peer-deps=true to handle remaining peer conflicts
   - PUPPETEER_SKIP_DOWNLOAD=true to skip optional puppeteer browser download

Test results:
- ✓ useDebouncedConversion: 3/3 tests passing
- ✓ MakefileValidator: 11/11 tests passing
- ✓ Build: Successful
- ✓ TypeScript compilation: No errors

This resolves the Vercel build failure and ensures consistent
dependency installation across all environments.
@claude
Copy link
Contributor

claude bot commented Nov 5, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

Vercel build was failing with:
  ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile"
  because pnpm-lock.yaml is not up to date with package.json

Root cause: pnpm-lock.yaml still referenced @testing-library/react-hooks
which was removed in the previous commit to fix peer dependency conflicts.

Changes:
- Regenerated pnpm-lock.yaml using pnpm@10.19.0
- Removed outdated @testing-library/react-hooks references
- Added @testing-library/dom@10.4.1 (new dependency)
- Updated all package versions to match current package.json

Verification:
- ✓ All tests passing (MakefileValidator: 11/11)
- ✓ Build successful (16.92s)
- ✓ pnpm install completes without errors

This ensures Vercel can install dependencies with frozen-lockfile mode.
@sherpa-sh
Copy link

sherpa-sh bot commented Nov 6, 2025

Latest status for build:
bb3dac9e-c630-40d5-a546-b55fdc1f1c70

Status Output Updated (UTC)
Building ⏳ View Logs ↗︎ 2025-11-06T07:33:56.555Z

Learn more: sherpa.sh docs ↗︎

@claude
Copy link
Contributor

claude bot commented Nov 6, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

@sherpa-sh
Copy link

sherpa-sh bot commented Nov 6, 2025

Latest status for build:
bb3dac9e-c630-40d5-a546-b55fdc1f1c70

Status Output Updated (UTC) Visit
Complete ✅ View Logs ↗︎ 2025-11-06T07:34:41.952Z Visit ↗︎

Learn more: sherpa.sh docs ↗︎

Issue: Line numbers were rendering all the way to the bottom of the
page instead of being constrained to the textarea height.

Root cause: The line numbers container used absolute positioning
without a height constraint, causing it to extend indefinitely when
many line numbers were rendered.

Fix: Added height constraint (h-[600px]) and overflow-hidden to the
line numbers container to match the textarea height (600px).

Changes:
- Added h-[600px] class to match textarea height
- Added overflow-hidden to prevent line numbers extending beyond
- Line numbers now stay within the textarea bounds

Verification:
- ✓ Build successful (16.21s)
- ✓ All tests passing (11/11)
- ✓ UI now properly constrained
@sherpa-sh
Copy link

sherpa-sh bot commented Nov 6, 2025

Latest status for build:
118976ca-e73b-4d00-9339-865d5703bac0

Status Output Updated (UTC)
Building ⏳ View Logs ↗︎ 2025-11-06T07:50:34.648Z

Learn more: sherpa.sh docs ↗︎

@claude
Copy link
Contributor

claude bot commented Nov 6, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

@sherpa-sh
Copy link

sherpa-sh bot commented Nov 6, 2025

Latest status for build:
118976ca-e73b-4d00-9339-865d5703bac0

Status Output Updated (UTC) Visit
Complete ✅ View Logs ↗︎ 2025-11-06T07:51:19.260Z Visit ↗︎

Learn more: sherpa.sh docs ↗︎

Previously, the line numbers feature (including the recent height
constraint fix) was not unit tested at all.

Added 6 new tests covering:
1. ✓ Line numbers shown by default
2. ✓ Toggle line numbers on/off
3. ✓ Height constraint (h-[600px]) applied correctly
4. ✓ Overflow-hidden class applied correctly
5. ✓ Correct number of line numbers rendered
6. ✓ Line numbers removed when checkbox unchecked
7. ✓ Line numbers count updates when content changes

Test results: 17/17 tests passing (100%)
- Previous: 11 tests (validation logic only)
- Added: 6 tests (line numbers functionality)

This ensures the line numbers height constraint fix in commit 2778661
is properly tested and prevents regressions.
@sherpa-sh
Copy link

sherpa-sh bot commented Nov 6, 2025

Latest status for build:
c2de4d0a-2410-468a-baa9-35f844332677

Status Output Updated (UTC)
Building ⏳ View Logs ↗︎ 2025-11-06T08:03:56.385Z

Learn more: sherpa.sh docs ↗︎

@claude
Copy link
Contributor

claude bot commented Nov 6, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

@sherpa-sh
Copy link

sherpa-sh bot commented Nov 6, 2025

Latest status for build:
c2de4d0a-2410-468a-baa9-35f844332677

Status Output Updated (UTC) Visit
Complete ✅ View Logs ↗︎ 2025-11-06T08:04:51.302Z Visit ↗︎

Learn more: sherpa.sh docs ↗︎

Updated README.md to document the new Makefile Validator tool:

Changes:
- Renamed section from "Code Formatting & Beautification" to
  "Code Formatting & Validation" to better reflect the tools
- Added "Makefile Validator" entry with description:
  "Validate Makefile syntax and detect common errors"
- Also added "YAML Formatter & Validator" which was missing

The Makefile Validator provides:
- Real-time syntax validation
- Detection of common errors (tabs vs spaces, empty targets, etc.)
- Two view modes: Issues and Structure
- Line numbers with proper height constraints
- Sample Makefile loader
- Copy and download functionality

Fully tested with 17 unit tests (100% passing).
@sherpa-sh
Copy link

sherpa-sh bot commented Nov 6, 2025

Latest status for build:
f7a0f4f0-3c49-4d39-9fdb-35cd01ef36c7

Status Output Updated (UTC)
Building ⏳ View Logs ↗︎ 2025-11-06T08:09:45.789Z

Learn more: sherpa.sh docs ↗︎

@claude
Copy link
Contributor

claude bot commented Nov 6, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

@sherpa-sh
Copy link

sherpa-sh bot commented Nov 6, 2025

Latest status for build:
f7a0f4f0-3c49-4d39-9fdb-35cd01ef36c7

Status Output Updated (UTC) Visit
Complete ✅ View Logs ↗︎ 2025-11-06T08:10:38.394Z Visit ↗︎

Learn more: sherpa.sh docs ↗︎

@nadimtuhin nadimtuhin merged commit f268564 into main Nov 6, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants