Commit graph

5 commits

Author SHA1 Message Date
Paul Gauthier
d5f59d72e4 build: Update pyproject.toml to exclude additional website files 2024-08-13 09:47:20 -07:00
Paul Gauthier (aider)
5d14d93594 feat: use cog to import exclude_website_pats and emit it into the toml 2024-08-13 09:36:31 -07:00
Branch Vincent
aa6a538992
migrate to pyproject.toml 2024-08-12 19:49:59 -07:00
Paul Gauthier
6fe656c093 removed 2023-05-10 20:03:30 -07:00
Paul Gauthier
c9efc43c98 aider: Added pyproject.toml file to configure black to use a maximum line length of 100 characters.
# Context:
USER: can i tell black to fix these automatically?
ASSISTANT: Yes, you can use the `black` code formatter to automatically fix formatting issues in your Python files. To do this, you need to have `black` installed. If you don't have it installed, you can install it using pip:

```
pip install black
```

Once `black` is installed, you can run it on a specific file or directory to automatically format the code:

```
black aider/coder.py
```

This command will format the `aider/coder.py` file according to the `black` code style. If you want to format all the Python files in your project, you can run `black` on the project directory:

```
black .
```

This command will format all the Python files in the current directory and its subdirectories.
USER: Please note that I shared content of these additional files: .pre-commit-config.yaml
ASSISTANT: Yes, I see the content of the .pre-commit-config.yaml file. It shows that you have already configured pre-commit hooks for `black` and `flake8`.

When you commit your changes, the pre-commit hooks will automatically run `black` to format your code and `flake8` to check for any linting issues. If there are any issues, the commit will be blocked, and you'll need to fix them before committing again.

To run the pre-commit hooks manually without committing, you can use the following command:

```
pre-commit run --all-files
```

This command will run all the configured hooks on all the files in your repository. If there
^C KeyboardInterrupt
USER: can we configure black to shorten lines to less than 100 chars so flake8 doesn't complain about E501
ASSISTANT: Yes, you can configure `black` to use a specific line length by adding a `pyproject.toml` file to your project's root directory with the desired line length setting. Here's how to create and configure the `pyproject.toml` file:

```toml
pyproject.toml
<<<<<<< ORIGINAL
=======
[tool.black]
line-length = 100
>>>>>>> UPDATED
```

This configuration sets the maximum line length for `black` to 100 characters, which will match the line length requirement of `flake8`. After adding this configuration, `black` will automatically format your code to keep lines within the specified limit.
2023-05-10 19:54:45 -07:00