aider/scripts
Paul Gauthier 293cc6c684 aider: Update main function to list and filter Python files if no filenames are provided.
# Aider chat conversation:

USER: if no files are provided on cmd line, do git ls-files and filter to python files

ASSISTANT: To implement the requested change, we need to modify the `main` function to use `git ls-files` to list all files in the repository and filter them to include only Python files if no filenames are provided on the command line.

Here is the *SEARCH/REPLACE* block:

```python
scripts/blame.py
```python
<<<<<<< SEARCH
    if len(sys.argv) < 2:
        print(f"Usage: {sys.argv[0]} <filename> ...")
        sys.exit(1)
=======
    if len(sys.argv) < 2:
        result = subprocess.run(
            ["git", "ls-files"],
            capture_output=True,
            text=True,
            check=True
        )
        fnames = [fname for fname in result.stdout.splitlines() if fname.endswith('.py')]
        if not fnames:
            print("No Python files found in the repository.")
            sys.exit(1)
    else:
        fnames = sys.argv[1:]
>>>>>>> REPLACE
```

This change ensures that if no filenames are provided on the command line, the script will list all files in the repository, filter them to include only Python files, and then process those files.
2024-05-24 08:41:23 -07:00
..
blame.py aider: Update main function to list and filter Python files if no filenames are provided. 2024-05-24 08:41:23 -07:00
Dockerfile.jekyll moved 2024-05-15 11:00:18 -07:00
jekyll_build.sh renamed dockerfile 2024-05-15 11:29:34 -07:00
jekyll_run.sh moved 2024-05-15 11:00:18 -07:00
versionbump.py aider: Add logic to compare commit dates of main and origin/main and print a message explaining which one is behind. 2023-11-17 15:50:37 -08:00