Commit graph

88 commits

Author SHA1 Message Date
Aaron Weisberg
acf654c984 fix: lint command with nested spaced strings 2025-01-02 17:27:33 +01:00
Paul Gauthier (aider)
415652d38e style: reorder subprocess args to keep cwd consistent 2024-11-26 19:55:07 -08:00
Paul Gauthier
af7aaad903 fix: handle RecursionError during tree traversal in linter 2024-10-31 14:55:54 -07:00
Paul Gauthier
75e1d519da fix: Handle all exceptions when loading parser in linter 2024-09-24 16:49:29 -07:00
Paul Gauthier
212e22b2b7 fix: Handle file read errors in linter 2024-09-21 18:55:24 -07:00
Paul Gauthier
1a6284cb24 feat: add error handling for parser loading in basic_lint function 2024-09-09 13:28:04 -07:00
fry69
e526d2890c fix: handle OSError when executing lint command 2024-09-08 13:15:31 +02:00
Paul Gauthier
e4cbbb1fa8 remove eslint as default linter 2024-09-05 12:45:12 -07:00
Paul Gauthier (aider)
6152a82513 fix: handle ValueError in os.path.relpath calls 2024-09-04 14:10:56 -07:00
Paul Gauthier
937a1cd847 fix: correct string handling in ESLint file path check 2024-09-04 14:06:30 -07:00
Paul Gauthier
867d19952c fix: handle spaces in ESLint file path for TypeScript linting 2024-09-04 14:05:44 -07:00
Paul Gauthier
7c5d999032 fix: correct eslint path in node_modules directory 2024-09-04 14:02:56 -07:00
Paul Gauthier
6d23b22e6f refactor: Remove redundant TypeScript linter fallback 2024-09-04 14:02:02 -07:00
Paul Gauthier (aider)
d8027030b0 fix: update ESLint check and test expectations 2024-09-04 13:57:09 -07:00
Paul Gauthier (aider)
bb5bca5227 feat: support Windows ESLint executables in linter detection 2024-09-04 13:53:18 -07:00
Paul Gauthier (aider)
e98645698b refactor: make ESLint path detection cross-platform compatible 2024-09-04 13:52:41 -07:00
Paul Gauthier (aider)
376e8617f3 style: format eslint paths and remove trailing whitespace 2024-09-04 13:51:57 -07:00
Paul Gauthier (aider)
a3d585a4b4 feat: add ESLint detection for TypeScript linting 2024-09-04 13:51:53 -07:00
Paul Gauthier
53fefa0246 disable built in linter for typescript #1132 2024-09-03 12:28:08 -07:00
Paul Gauthier
301c4265b7 refactor: simplify file reading in Linter.lint method 2024-08-29 19:21:41 -07:00
Paul Gauthier (aider)
91cd9d6b51 style: Use double quotes for string literal in read_text() call 2024-08-29 19:21:15 -07:00
Paul Gauthier (aider)
8d4d7af7d0 refactor: handle file read errors in linter 2024-08-29 19:21:11 -07:00
Paul Gauthier
59ad370611 Improve linter error handling by replacing invalid characters and adding error handling for subprocess. 2024-07-30 15:21:01 -03:00
Paul Gauthier (aider)
9b129a7f03 Update the subprocess calls to use the specified encoding. 2024-07-30 15:18:51 -03:00
Paul Gauthier (aider)
167abdf851 Remove unused imports in linter.py 2024-07-29 20:29:14 -03:00
Paul Gauthier
5edce8ae1b Add linter output to the dump for debugging 2024-07-29 20:28:43 -03:00
Paul Gauthier (aider)
b44c24678c Refactored flake8 linting to use subprocess module instead of modifying sys.argv and sys.stdout. 2024-06-23 17:07:55 -07:00
Paul Gauthier
66fadadea1 Improved error handling and logging in the linter module. 2024-06-23 17:07:53 -07:00
Paul Gauthier
4d38dfbb3b Run flake8 from our active py env 2024-06-21 17:43:14 -07:00
Paul Gauthier (aider)
bbac4c72cf Update sys.stdout to use io.TextIOWrapper for utf-8 encoding. 2024-06-21 17:26:15 -07:00
Paul Gauthier
13b7c3e043 Added a new method to run flake8 linter with specific fatal errors and capture the results. 2024-06-21 17:26:14 -07:00
Paul Gauthier
92a28a9b52 wip 2024-06-18 09:59:00 -07:00
Paul Gauthier
ad2312ad7b handle missing end_lineno attr #619 2024-05-29 15:55:55 -07:00
Paul Gauthier
27948cafa6 linter should display rel fname 2024-05-20 16:18:01 -07:00
Paul Gauthier
61165164d8 Run flake8 --isolated 2024-05-20 12:38:41 -07:00
Paul Gauthier
57a2c61386 updated lint cmd descriptions 2024-05-20 09:01:22 -07:00
Paul Gauthier
ee516e3958 Added import statement for regular expressions in linter module. 2024-05-20 08:56:42 -07:00
Paul Gauthier
ce5dabd5f1 Removed unused import statement for 're' module. 2024-05-20 08:56:30 -07:00
Paul Gauthier
a115e594c0 Add import statement for 're' module and fix regex pattern in linter.py. 2024-05-20 08:56:21 -07:00
Paul Gauthier
9c28bbc98e Refactored linting process and error handling in commands. 2024-05-20 08:55:49 -07:00
Paul Gauthier
990dda1122 Added empty lines for better readability. 2024-05-19 07:35:27 -07:00
Paul Gauthier
9ee332f5d9 Added options for automatic linting and testing after changes. 2024-05-19 07:34:19 -07:00
Paul Gauthier
5a6e72a64b Updated linting functionality to only run linting without committing. 2024-05-18 21:00:45 -07:00
Paul Gauthier
828e14fd3d Updated Linter to return LintResult if text or lines are present. 2024-05-18 20:48:53 -07:00
Paul Gauthier
1a3ae1fb60 Refactored Linter class to only return LintResult if text is not empty. 2024-05-18 20:48:36 -07:00
Paul Gauthier
553f39a529 Refactored linter to aggregate lint results and return a unified LintResult object. 2024-05-18 20:47:46 -07:00
Paul Gauthier
84edf3039c aider: Add LintResult class to linter.py.
# Aider chat conversation:

USER: create LinkResult

ASSISTANT: To create the `LintResult` class, we need to add it to the `aider/linter.py` file. Here is the *SEARCH/REPLACE* block to add the `LintResult` class:

aider/linter.py
```python
<<<<<<< SEARCH
from pathlib import Path
=======
from pathlib import Path
from dataclasses import dataclass
>>>>>>> REPLACE
```

aider/linter.py
```python
<<<<<<< SEARCH
def lint_python_compile(fname, code):
=======
@dataclass
class LintResult:
    text: str
    lines: list

def lint_python_compile(fname, code):
>>>>>>> REPLACE
```
2024-05-18 20:44:07 -07:00
Paul Gauthier
24e98a4ac2 Refactored linter methods to return LintResult objects. 2024-05-18 20:44:06 -07:00
Paul Gauthier
6f557ace06 Refactored py_lint method to accumulate linting results instead of returning immediately. 2024-05-18 19:55:08 -07:00
Paul Gauthier
e4c1653b2e Fix typo in flake8 command in Linter class. 2024-05-18 19:50:11 -07:00