Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Filter out non-Python source files

Aperta
#3,848 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
cli

Direzione di ricerca

Start by tracing how the command selects files and applies skip; the issue does not name specific files or tests. Check how a global *.py restriction should interact with explicitly passed Python files and skip. Done means the option checks only Python files while preserving both behaviors.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I utilize CodeSpell to enforce US spelling as part of an internal Python coding standard. Most of the code bases it checks live inside mono repos where there'll be a lot of CPP source files and configuration. When I invoke CodeSpell it will find issues across all files, but I would like the ability for it to only check Python files.

What I've tried

Filtering out patterns using skip - not really practical since it expects me to know which files might exist in a repo ahead of time. I did notice that CodeSpell uses fnmatch under the hood which claims to support negative matches using !, but I wasn't able get this to work for matching non *.py patterns.

Passing a list of Python files - messy since I need to do a glob first and then filter out the Python files I want to skip (tests, files under .venv etc.)

What I would like to see

A global option to restrict checks to *.py files. It would respect both skip and any Python files I pass to the command.


Any pointers on how this could be achieved currently would be welcome! If it's not I would be open to pushing a PR if an approach could be agreed on.

Lingua principale
Python
Stelle
2.4k
Fork
531
Merge medio
15h 55m
PR unite (30g)
17

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codespell-project/codespell

Tutte le issue di codespell-project/codespell

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.