Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Enable ruff exception rules (TRY, EM, BLE)

Aberta
#3,912 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

@anth-volk já está trabalhando nisso.

Desde 13/10/2026.

  • #3913 de @anth-volk — aberto

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
38/100
Tipo de issue
Refatoração
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
python
Domínio
backend

Direção de pesquisa

The issue names no specific files. Start by enabling the TRY, EM and BLE rule groups in the ruff lint configuration and listing the violations they report. Each fix needs a judgment call: narrowing a broad except, moving raises out of try blocks, or keeping a Pydantic validator's exception type unchanged. Done when ruff passes with these rules on and the existing tests pass, with message text and published schemas unchanged.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Phase 1 step 1.8, group 5 of the rules workstream: enable ruff's exception rules (TRY, EM, BLE).

  • Messages: build each exception message before the raise (EM, TRY003).
  • Raises inside try blocks: move them into helpers so a handler can't catch its own raise (TRY301, TRY300).
  • Broad catches: decide each except Exception (BLE001). Narrow it where the possible errors are known; otherwise keep it with an inline reason.
  • Exception types: use TypeError for type checks (TRY004) unless a caller, a boundary or a test depends on the current type. Never change the type raised inside a Pydantic validator, where TypeError turns a validation error into a 500.

Message text and published schemas must not change.

Linguagem predominante
Python
Estrelas
18
Forks
33
Merge médio
1d 18h
PRs com merge (30d)
23

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de PolicyEngine/policyengine-api

Todas as issues de PolicyEngine/policyengine-api

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.