Skip to content

Commit

Permalink
--fix-only in create_baseline_stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Oct 18, 2023
1 parent dafdef9 commit 7e57883
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions scripts/create_baseline_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def run_black(stub_dir: str) -> None:


def run_ruff(stub_dir: str) -> None:
print(f"Running ruff: ruff {stub_dir}")
subprocess.run([sys.executable, "-m", "ruff", stub_dir])
print(f"Running Ruff: ruff {stub_dir}")
subprocess.run([sys.executable, "-m", "ruff", stub_dir, "--fix-only"])


async def get_project_urls_from_pypi(project: str, session: aiohttp.ClientSession) -> dict[str, str]:
Expand Down Expand Up @@ -184,7 +184,7 @@ def add_pyright_exclusion(stub_dir: str) -> None:
def main() -> None:
parser = argparse.ArgumentParser(
description="""Generate baseline stubs automatically for an installed pip package
using stubgen. Also run black and ruff. If the name of
using stubgen. Also run black and Ruff. If the name of
the project is different from the runtime Python package name, you may
need to use --package (example: --package yaml PyYAML)."""
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_proto_stubs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ PYTHON_PROTOBUF_DIR="protobuf-$PYTHON_PROTOBUF_VERSION"
VENV=venv
python3 -m venv "$VENV"
source "$VENV/bin/activate"
pip install -r "$REPO_ROOT/requirements-tests.txt" # for black and ruff
pip install -r "$REPO_ROOT/requirements-tests.txt" # for black and Ruff

# Install mypy-protobuf
pip install "git+https://github.com/dropbox/mypy-protobuf@$MYPY_PROTOBUF_VERSION"
Expand Down
2 changes: 1 addition & 1 deletion scripts/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def main() -> None:
pytype_result: subprocess.CompletedProcess[bytes] | None = None

# Run formatters first. Order matters.
print("\nRunning ruff...")
print("\nRunning Ruff...")
subprocess.run([sys.executable, "-m", "ruff", path])
print("\nRunning Black...")
black_result = subprocess.run([sys.executable, "-m", "black", path])
Expand Down

0 comments on commit 7e57883

Please sign in to comment.