Galaxy code linting, formatting, and type checking. Run checks, auto-fix formatting, Python lint, client lint, mypy type checks. Use for: ruff, flake8, black, isort, darker, autoflake, pyupgrade, eslint, prettier, mypy, tox, make format, make diff-format, code style, lint failures, CI lint checks, formatting errors, type errors, codespell, redocly, api schema, xsd, config lint.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Galaxy code linting, formatting, and type checking. Run checks, auto-fix formatting, Python lint, client lint, mypy type checks. Use for: ruff, flake8, black, isort, darker, autoflake, pyupgrade, eslint, prettier, mypy, tox, make format, make diff-format, code style, lint failures, CI lint checks, formatting errors, type errors, codespell, redocly, api schema, xsd, config lint.
argument-hint
[check|fix|python|client|mypy|full]
Persona: You are a senior Galaxy developer specializing in code quality, style enforcement, and CI compliance.
"black would reformat" error in CI → Run black . locally
String formatting → Black enforces double quotes
Multiline expressions → Black has strong opinions on line breaks
isort (Import Sorter)
Sorts and organizes imports into groups.
Check import order:
isort --check .
Fix import order:
isort .
Configuration:pyproject.toml under [tool.isort]
Profile: "black" (compatible with black formatting)
Line length: 120
Import groups (in order):
Standard library imports
Third-party imports
Local application imports
Example:
# Standard libraryimport os
from typing importOptional# Third-partyfrom fastapi import APIRouter
from pydantic import BaseModel
# Localfrom galaxy.managers.workflows import WorkflowsManager
from galaxy.schema.schema import WorkflowSummary
Flake8 (Legacy Linter)
Traditional Python linter - still used alongside ruff.
Run flake8:
flake8 .
Configuration:.flake8 file in repository root
Note: Ruff covers most flake8 checks. Galaxy maintains flake8 for specific rules not yet in ruff.
Darker (Incremental Formatter)
Applies black/isort only to changed lines.
Format changed code:
make diff-format
How it works:
Compares working tree to origin/dev
Runs black and isort only on modified lines
Much faster than full formatting
Ideal for daily development
Use when:
Working on large files with many unchanged lines
Want fast formatting feedback
Developing features incrementally
CI Integration
GitHub Actions runs these checks:
.github/workflows/lint.yaml defines CI linting pipeline
Four tox environments: format, lint, mypy, lint_docstring_include_list
Formatting first - Cheapest to fix, may resolve some lint issues
Linting second - Many auto-fixable issues
Type checking third - Requires manual fixes, benefits from clean lint
Docstring check last - Specific to certain files
Tox Environment Details
tox -e format:
Runs: black --check, isort --check
Purpose: Verify formatting compliance
Fix with: make format or make diff-format
tox -e lint:
Runs: ruff check, flake8
Purpose: Catch code style violations
Fix with: ruff check --fix . + manual fixes
tox -e mypy:
Runs: mypy on selected directories
Purpose: Type checking
Fix with: Add type hints manually
tox -e lint_docstring_include_list:
Runs: ruff on docstring_include_list modules
Purpose: Enforce docstring standards on core modules
Fix with: Add/improve docstrings
CI Workflow File
See the full CI setup:
cat .github/workflows/lint.yaml
This shows exactly what CI runs. Match these checks locally to avoid CI failures.
Other Lint Targets
Galaxy's Makefile includes additional linting targets for specialized use cases:
API Schema Linting
Lint OpenAPI schema:
make lint-api-schema
Builds the OpenAPI schema, then lints it with Redocly CLI and checks spelling with codespell. Useful when modifying API endpoints or Pydantic schemas.
XSD Schema Formatting
Format Galaxy's tool XSD schema:
make format-xsd
Formats Galaxy's tool XSD schema (lib/galaxy/tool_util/xsd/galaxy.xsd) with xmllint. Use when modifying tool schema definitions.
Configuration File Linting
Lint Galaxy configuration files:
make config-lint # Lint galaxy.yml
make tool-shed-config-lint # Lint tool_shed.yml
make reports-config-lint # Lint reports.yml
Validates YAML configuration files for syntax and structure issues. Run these when modifying Galaxy configuration schemas.
File Sources Validation
Validate file sources configuration:
make files-sources-lint # Validate file sources config
make files-sources-lint-verbose # Verbose output with details
Use when working with file sources plugins or configuration.
Update Lint Requirements
Update pinned lint dependency versions:
make update-lint-requirements
Updates pinned lint dependency versions in lib/galaxy/dependencies/. Run this when upgrading linting tools or resolving dependency conflicts.
Troubleshooting
"black would reformat" Error
Symptom: CI fails with "would reformat X files"
Solution:
# Run black locally
black .
# Or for changed files only
make diff-format
# Commit the formatting changes
git add -u
git commit -m "Apply black formatting"
Type hints guide: doc/source/dev/type_hints.md (if exists)
Quick Command Reference
Most common workflows:
# Quick check before committing
tox -e format && tox -e lint
# Fix formatting issues
make diff-format # Incremental (fast)
make format # Full (thorough)# Fix auto-fixable lint issues
ruff check --fix .
# Modernize Python syntax
make pyupgrade
# Full CI simulation
tox -e format && tox -e lint && tox -e mypy && tox -e lint_docstring_include_list
# Client-side
make client-lint
make client-format
# Client-side (granular)
make client-eslint # ESLint only
make client-format-check # Prettier check only
make client-lint-autofix # Auto-fix ESLint# Lint API schema (after endpoint changes)
make lint-api-schema
# Lint config files
make config-lint
make tool-shed-config-lint
make reports-config-lint
Remember: Run make diff-format frequently during development to keep code formatted incrementally!