realpython / realpython/materials
Ruff lints the whole repo
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Jupyter Notebook
- Estrellas
- 5.2k
- Forks
- 5.3k
- Merge medio
- 4 d 10 h
- PR fusionados (30 d)
- 10
Descripción
ℹ️ Please note that the best way to get support for Real Python courses & articles is to join one of our weekly Office Hours calls or in the RP Community Slack.
You can report issues and problems here, but we typically won't be able to provide 1:1 support outside the channels listed above.
Describe the bug
Currently, Ruff lints all the files in the repo, which can be inefficient.
To Reproduce
Steps to reproduce the behavior:
- Open a PR and take a look at the Ruff check details.
Expected behavior
Lint only the modified Python files.
Additional context
Proposed update to file .github/workflows/linters.yaml
- name: Check code style
run: |
. venv/bin/activate
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
git fetch origin ${{ github.base_ref }}
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.sha }} -- '*.py')
else
CHANGED_FILES=$(git diff --name-only HEAD^ -- '*.py')
fi
if [ -n "$CHANGED_FILES" ]; then
python -m ruff format --check $CHANGED_FILES
python -m ruff check $CHANGED_FILES
fi
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con .github/workflows/linters.yaml e inspecciona el paso existente Check code style; después, abre un pull request para verificar qué archivos comprueba actualmente Ruff. Actualiza el workflow para que los comandos de formato y lint de Ruff reciban únicamente archivos Python modificados, y confirma que la comprobación se omite correctamente cuando no se han modificado archivos Python.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- github-actions, python
- Área
- ci-cd, tooling
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 68/100