Skip to content

feat(core): add EtaReduce rule#7

Draft
jamesjwood wants to merge 13 commits intocollegevine:mainfrom
Cambridge-Vision-Technology:issue-2-eta-reduce
Draft

feat(core): add EtaReduce rule#7
jamesjwood wants to merge 13 commits intocollegevine:mainfrom
Cambridge-Vision-Technology:issue-2-eta-reduce

Conversation

@jamesjwood
Copy link
Copy Markdown

Summary

  • Adds EtaReduce rule to detect function bindings where the last parameter is redundantly applied and could be eta-reduced to point-free style
  • Flags patterns like f a = g a (suggest f = g) and f a = h $ g a
  • Skips type class instance methods per issue discussion

closes #2

🤖 Generated with Claude Code

Build Service and others added 13 commits November 9, 2025 13:07
Replace legacy build.yml workflow with modern Determinate Nix CI.

Changes:
- New ci.yml: Runs nix flake check on ubuntu-latest and macos-latest
- FlakeHub publishing: Private visibility for releases and rolling updates
- update-flake-lock.yml: Weekly automated dependency updates
- dependabot.yml: Keep GitHub Actions up to date

The flake.nix already uses flake-parts and works in pure evaluation mode,
so no changes needed there.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The bundled index.js had a `#!/usr/bin/env node` shebang that broke
in pure Nix builds on Linux (no /usr/bin/env). The wrapper script
already provides the node interpreter, so the shebang is unnecessary.

This allows consumers to use whine without adding nodejs to
nativeBuildInputs as a workaround.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Use `${pkgs.bash}/bin/bash` instead of `#!/usr/bin/env bash` in the
wrapper script to ensure it works in pure Nix builds on Linux where
/usr/bin/env is not available.

This completes the Linux compatibility fixes:
1. Removed shebang from bundled index.js (previous commit)
2. Fixed wrapper script shebang (this commit)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ific)

Split custom rules into two packages for better organization:

**aykua** (company-wide rules):
- QualifiedImportsOnly, MatchingAliases, NoDuplicateImports
- UndesirableConsole - Effect.Console.* functions
- UndesirableLiftEffect - liftEffect/liftAff
- UndesirableUnsafe - Never-allow unsafe functions

**oz** (project-specific rules):
- UndesirableNdjson - Logger.Ndjson.* functions
- UndesirableViewSend - View.Send.* functions

Each rule can be independently disabled with `-- #disable RuleName`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive test suite for the FunctionComplexity rule that will
detect large, complex functions needing refactoring.

Tests cover:
- Lines of Code (LOC) threshold detection with configurable limits
- Nesting depth analysis for case/do/if/let expressions
- Cyclomatic complexity calculation (branches + guards + ifs)
- Configuration parsing with defaults
- Violation reporting with source ranges and function names
- Edge cases: type declarations, multi-clause functions, where clauses

Tests are designed to fail until the rule is implemented, ensuring
the implementer cannot take shortcuts. Each test verifies:
- Correct violation detection with source ranges
- Proper message content with metric values
- Threshold configuration is respected

Refs: #243

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds a rule to detect functions that may need refactoring based on:
- Lines of code (default threshold: 50)
- Nesting depth of case/do/if/let expressions (default threshold: 4)
- Cyclomatic complexity counting branches, guards, and ifs (default threshold: 10)

Configuration example:
  FunctionComplexity:
    maxLines: 50
    maxNestingDepth: 4
    maxCyclomaticComplexity: 10

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…patterns #247

Add a new linting rule that detects string literal comparisons in:
- Case expression patterns (BinderString)
- Equality comparisons (== and /=) with string literals

This helps identify code that should use ADTs instead of strings for
type-safe pattern matching.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…isons

Changed rule to be more targeted:
- Only flags: record.field == "string" patterns
- Ignores: case patterns, variable comparisons, function results

This dramatically reduces false positives from boundary parsing while
still catching the real anti-pattern of using strings instead of ADTs
for internal record fields.

Before: 133+ violations (mostly legitimate parsing)
After: 24 violations (real issues to fix)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

rule proposal: explicit function application could be point-free

1 participant