jlevy / jlevy/repren

Consider making --at-once the default processing mode

Open
#46 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
374
Forks
39
Avg merge
3m
Merged PRs (30d)
1

Description

## Summary

The current default is line-by-line processing, requiring `--at-once` for multi-line regex patterns. There is a TODO at line 1639 asking whether `--at-once` should be the default.

## Discussion

**Arguments for `--at-once` as default:**
- Multi-line patterns are a common use case (matching across line boundaries)
- `--dotall` is useless without `--at-once`, which is a confusing interaction
- Modern systems have abundant memory; the "files might be too large" concern is rarely relevant
- Users who want multi-line matching must remember to add `--at-once`, which is a common source of confusion

**Arguments for keeping line-by-line as default:**
- Predictable memory usage for very large files
- Preserves backward compatibility
- Line-by-line is the traditional behavior (matches `sed` conventions)

## Suggestion

Consider either:
1. Making `--at-once` the default with a `--line-by-line` flag for the old behavior
2. At minimum, adding a warning when `--dotall` is used without `--at-once` (since the combination is almost certainly a mistake)

Option 2 is lower-risk and addresses the most common confusion.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.