PyCQA / PyCQA/flake8-bugbear

Proposed opinionated warning against re.match

Open
#132 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted question
Dominant language
Python
Stars
1.1k
Forks
123
Avg merge
2d 5h
Merged PRs (30d)
5

Description

Technically, using re.match is valid. Realistically, the author probably meant .search and is going to lose a ton of time trying to figure out why her regex isn't working.

I'm speaking purely in compassion toward more junior developers; I would obviously never make such an elementary mistake myself. https://twitter.com/catherinedevlin/status/1257507010041520139

If you think you're likely to accept it, I'd be interested in authoring such a warning.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue proposes an opinionated warning for uses of Python's re.match where re.search may have been intended, but names no files, tests, or entry points. First review the project's existing warning implementations and decide the warning's precise scope and behavior. Done means the proposal is implemented with appropriate validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.