Skip to content

--ignored seems not to work #84

@Masynchin

Description

@Masynchin

Problem

I want to patch code of ignored files (dependencies of my python project). But there is no difference with or without --ignored - Error: nothing found to replace. At the same time ripgrep correctly finds provided pattern.

To reproduce

Libs used:

  • python==3.10.2
  • ripgrep==13.0.0 (or rg)
  • ruplacer==0.6.4

It might be overcomplicated, but it is my real situation. Steps to reproduce:

mkdir reproduce
cd reproduce

git init
echo venv/ > .gitignore

python3 -m venv venv
source venv/bin/activate
pip install "Django==1.11.29"

# no any output since all files ignored by gitignore:
rg 'from collections import Iterable'
ruplacer 'from collections import Iterable' 'from collections.abc import Iterable'

# shows expected
rg 'from collections import Iterable' --no-ignore

# doesn't shows expected
ruplacer 'from collections import Iterable' 'from collections.abc import Iterable' --ignored

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions