Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/autodev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: "AutoDev"
run-name: "AutoDev: ${{ inputs.task_title }}"

on:
workflow_dispatch:
inputs:
prompt:
description: "Instructions for AutoDev. Can be a direct prompt or custom template."
type: string
required: true

base_branch:
description: "The branch to use as the base/source when creating new branches (defaults to repository default branch)"
type: string
required: false
default: "main"

agent:
description: "The agent to use for the action. Can be 'claude_code', 'gemini_cli', 'codex_cli' or 'opencode'"
type: choice
default: "claude_code"
options:
- claude_code
- gemini_cli
- codex_cli
- opencode
- crush_cli
- github_copilot_cli

agent_model:
description: "The (optional) model to use for the agent"
type: string
required: false
default: ""

autodev_workflow_execution_token:
description: "The token to use for the AutoDev task"
type: string
required: false
default: ""

autodev_mode:
description: "The AutoDev execution mode. Can be 'develop' (default) or 'plan' (for task graph planning)"
type: choice
default: "develop"
options:
- develop
- plan

task_title:
description: "The title of the AutoDev task"
type: string
required: false
default: ""

jobs:
autodev:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout code
uses: actions/checkout@v5

- uses: pnpm/action-setup@v4

- name: Run AutoDev
uses: delinoio/autodev-action@main
with:
agent: ${{ inputs.agent }}
agent_model: ${{ inputs.agent_model }}
autodev_mode: ${{ inputs.autodev_mode }}
autodev_workflow_execution_token: ${{ inputs.autodev_workflow_execution_token }}
prompt: ${{ inputs.prompt }}
base_branch: ${{ inputs.base_branch }}
delino_access_token: ${{ secrets.DELINO_ACCESS_TOKEN }}
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
openai_api_key: ${{ secrets.AUTODEV_OPENAI_API_KEY }}
57 changes: 57 additions & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Claude Code Review

on:
pull_request:
types: [opened, synchronize]
# Optional: Only run on specific file changes
# paths:
# - "src/**/*.ts"
# - "src/**/*.tsx"
# - "src/**/*.js"
# - "src/**/*.jsx"

jobs:
claude-review:
# Optional: Filter by PR author
# if: |
# github.event.pull_request.user.login == 'external-contributor' ||
# github.event.pull_request.user.login == 'new-developer' ||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}
Please review this pull request and provide feedback on:
- Code quality and best practices
- Potential bugs or issues
- Performance considerations
- Security concerns
- Test coverage
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'

50 changes: 50 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Claude Code

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]

jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'

# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
# claude_args: '--allowed-tools Bash(gh pr:*)'

50 changes: 50 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.PHONY: help
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Available targets:'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'

.PHONY: test
test: ## Run all tests
go test ./internal/...

.PHONY: test-typescript-estree
test-typescript-estree: ## Run typescript-estree module tests
go test ./internal/typescript-estree/...

.PHONY: test-coverage
test-coverage: ## Run tests with coverage
go test -coverprofile=coverage.out ./internal/...
go tool cover -html=coverage.out -o coverage.html

.PHONY: test-coverage-typescript-estree
test-coverage-typescript-estree: ## Run typescript-estree tests with coverage
go test -coverprofile=coverage-typescript-estree.out ./internal/typescript-estree/...
go tool cover -html=coverage-typescript-estree.out -o coverage-typescript-estree.html

.PHONY: lint
lint: ## Run linters
golangci-lint run ./cmd/... ./internal/...

.PHONY: lint-typescript-estree
lint-typescript-estree: ## Run linters on typescript-estree module
golangci-lint run ./internal/typescript-estree/...

.PHONY: fmt
fmt: ## Format Go code
golangci-lint fmt ./cmd/... ./internal/...

.PHONY: build
build: ## Build the project
go build ./cmd/...

.PHONY: tidy
tidy: ## Run go mod tidy on all modules
go mod tidy
cd internal/typescript-estree && go mod tidy

.PHONY: clean
clean: ## Clean build artifacts
rm -f coverage.out coverage.html coverage-typescript-estree.out coverage-typescript-estree.html
go clean -cache
137 changes: 137 additions & 0 deletions TYPESCRIPT_ESTREE_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# TypeScript ESTree Infrastructure Setup

This document describes the infrastructure setup for the TypeScript ESTree port in rslint.

## Overview

This PR sets up the foundational infrastructure needed for porting [@typescript-eslint/typescript-estree](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/typescript-estree) to Go as part of the rslint project.

**⚠️ Important**: This PR contains **only infrastructure and scaffolding** - no actual parser implementation. The parser functionality will be added in subsequent PRs.

## What's Included

### 1. Module Structure

Created a new Go module at `internal/typescript-estree/` with the following structure:

```
internal/typescript-estree/
├── parser/ # Main parsing logic (placeholder)
├── converter/ # AST conversion logic (placeholder)
├── types/ # Type definitions for ESTree nodes
├── utils/ # Utility functions
├── testutils/ # Testing utilities
├── go.mod # Module dependencies
└── README.md # Module documentation
```

### 2. Build Configuration

- **Go Module**: Created `internal/typescript-estree/go.mod` with dependencies on typescript-go shim packages
- **Workspace**: Updated `go.work` to include the new module
- **Makefile**: Added targets for building and testing the module:
- `make test-typescript-estree` - Run tests
- `make test-coverage-typescript-estree` - Run tests with coverage
- `make lint-typescript-estree` - Run linters

### 3. CI/CD Integration

The existing CI workflows in `.github/workflows/ci.yml` already cover:
- Running tests for all packages under `internal/` (line 57)
- Running golangci-lint on `internal/...` (line 80)
- Code formatting checks

The new module will be automatically included in these checks.

### 4. Type Definitions

Basic ESTree type definitions in `types/types.go`:
- `Node` interface - base interface for all AST nodes
- `SourceLocation` and `Position` - location tracking
- `BaseNode` - common node implementation
- `Program` and `Identifier` - example concrete nodes

These are minimal scaffolding types that will be expanded during implementation.

### 5. Test Infrastructure

- Test files for each package (`*_test.go`)
- `testutils` package with helper functions
- All tests pass and can run in parallel
- Example tests demonstrate the testing approach

### 6. Documentation

- Module README at `internal/typescript-estree/README.md`
- This setup document
- Inline code documentation

## Verification Steps

All infrastructure is verified to work:

1. **Tests Run Successfully**:
```bash
go test ./internal/typescript-estree/...
# All tests pass
```

2. **Module Dependencies Resolve**:
```bash
cd internal/typescript-estree && go mod tidy
# No errors
```

3. **Workspace Configuration Valid**:
```bash
go work sync
# Module included in workspace
```

## Next Steps

With infrastructure in place, the next phases are:

1. **Parser Implementation**:
- Port core parsing logic from TypeScript ESTree
- Integrate with typescript-go shim
- Handle source type and ECMAScript version options

2. **Converter Implementation**:
- Convert TypeScript AST to ESTree format
- Handle TypeScript-specific extensions
- Preserve location information

3. **Testing**:
- Add comprehensive test cases
- Port test fixtures from TypeScript ESTree
- Achieve high code coverage

4. **JSX Support**:
- Add JSX parsing capabilities
- Handle JSX-specific node types

## Development Workflow

To work on the typescript-estree module:

```bash
# Run tests
make test-typescript-estree

# Run with coverage
make test-coverage-typescript-estree

# Run linting
make lint-typescript-estree

# Format code
make fmt
```

## References

- [TypeScript ESTree](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/typescript-estree)
- [ESTree Spec](https://github.com/estree/estree)
- [TypeScript-Go](https://github.com/microsoft/typescript-go)
- [Main README](internal/typescript-estree/README.md)
1 change: 0 additions & 1 deletion cmd/rslint/signal_wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package main

import (

"time"
)

Expand Down
Loading