Skip to content

Remove cached files and remove Lint from CI #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .github/workflows/pylint.yml

This file was deleted.

9 changes: 5 additions & 4 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ jobs:
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

Comment on lines +36 to +37
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

⚠️ Potential issue

Linting is properly configured with Ruff, but workflow needs updating

The commented-out flake8 checks are actually replaced by Ruff (as seen in ruff.toml), which provides more comprehensive linting including pycodestyle, Pyflakes, flake8-bugbear, and flake8-simplify rules. However, the GitHub Actions workflow hasn't been updated to use Ruff instead of flake8.

  • The workflow should be updated to install and run Ruff instead of flake8
  • The basic syntax checks (E9,F63,F7,F82) currently run with flake8 are already covered by Ruff's E9 and F selections
🔗 Analysis chain

Reconsider commenting out extended linting checks

The removal of extended flake8 checks (complexity, line length) combined with the deletion of the Pylint workflow significantly reduces code quality enforcement. Consider keeping these checks to maintain code quality standards.

Let's check if there are any other linting configurations in the project:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other linting configurations
echo "Searching for other linting configuration files..."
fd -e cfg -e ini -e toml -e yaml -e yml | grep -iE 'lint|flake8|pylint|pycodestyle'

Length of output: 196


Script:

#!/bin/bash
# Let's try a broader search for Python-related configuration files and content
echo "=== Searching for Python config files ==="
fd -e cfg -e ini -e toml -e yml -e yaml -e py

echo -e "\n=== Searching for linting configurations in Python files ==="
rg -i "flake8|pylint|pycodestyle" --type py

echo -e "\n=== Checking setup.py/pyproject.toml for linting configs ==="
if [ -f "setup.py" ]; then
    echo "=== setup.py content ==="
    cat setup.py
fi
if [ -f "pyproject.toml" ]; then
    echo "=== pyproject.toml content ==="
    cat pyproject.toml
fi

echo -e "\n=== Checking tox.ini for linting configs ==="
if [ -f "tox.ini" ]; then
    echo "=== tox.ini content ==="
    cat tox.ini
fi

Length of output: 2527


Script:

#!/bin/bash
# Let's check the ruff.toml configuration since we found it in the files
echo "=== Checking ruff.toml content ==="
cat ruff.toml

# Let's also check if ruff is used in the workflow file
echo -e "\n=== Checking workflow file for ruff ==="
cat .github/workflows/python-app.yml

Length of output: 1695

🧰 Tools
🪛 yamllint (1.35.1)

[error] 37-37: trailing spaces

(trailing-spaces)

# - name: Test with pytest
# run: |
# pytest
Comment on lines +38 to +40
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

⚠️ Potential issue

Critical: Re-enable pytest in the CI workflow

The codebase contains a comprehensive test suite with 14 test files covering various components (endpoints, analyzers, git operations, etc.). The test file examined shows proper unit tests using the unittest framework. Disabling pytest in the CI workflow means these tests are not being executed during integration, which could indeed lead to undetected issues.

  • .github/workflows/python-app.yml: Uncomment lines 38-40 to re-enable test execution
  • No alternative test execution workflow was found in .github/workflows/
🔗 Analysis chain

Critical: Test execution has been disabled

Commenting out the pytest step removes all automated testing, which could lead to undetected bugs and regressions. This is a significant concern for code quality and reliability.

Let's verify the presence of tests in the codebase:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for test files and their count
echo "Searching for test files..."
fd -e py | grep -i test

Length of output: 522


Script:

#!/bin/bash
# Check if there are any other CI/CD workflow files that might be running tests
echo "Checking for other workflow files..."
fd workflow .github/

# Check the content of pytest configuration
echo -e "\nChecking for pytest configuration..."
fd pytest.ini
fd conftest.py

# Let's also check the content of a sample test file to verify they are actual tests
echo -e "\nChecking content of a test file..."
cat tests/test_py_analyzer.py

Length of output: 2512


Script:

#!/bin/bash
# Let's check if there are any other workflow files that might be running tests
echo "Checking contents of workflow directory..."
ls -la .github/workflows/

# And check the content of python-app.yml to see the complete context
echo -e "\nChecking content of python-app.yml..."
cat .github/workflows/python-app.yml

Length of output: 1628

75 changes: 75 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,77 @@
# Python
*.pyc
*.pyo
*.pyd
__pycache__/
*.env
.venv/
env/
venv/
ENV/
*.egg-info/
*.egg
pip-log.txt

# Flask
instance/
*.sqlite3
*.db
*.bak
instance/config.py
instance/*.secret

# Environment Variables
.env
.env.*

# Logs
logs/
*.log
*.out
*.err

# Pytest and Coverage
.pytest_cache/
.coverage
.tox/
nosetests.xml
coverage.xml
*.cover
.cache

# IDEs and Editors
.vscode/
.idea/.env
.vercel

# ignore the .pyc files
*.pyc

dist/
# Node (if using npm/yarn for assets)
node_modules/
*.lock

# Static assets (if generated)
static/
dist/
build/

# Docker
*.pid
docker-compose.override.yml

# Heroku
*.buildpacks
*.env.local
*.env.production
*.env.*.local

# Miscellaneous
*.bak
*.tmp
*.log.*
Thumbs.db

# Vercel
.vercel
Binary file removed api/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed api/__pycache__/app.cpython-312.pyc
Binary file not shown.
Binary file removed api/__pycache__/auto_complete.cpython-312.pyc
Binary file not shown.
Binary file removed api/__pycache__/graph.cpython-312.pyc
Binary file not shown.
Binary file removed api/__pycache__/info.cpython-312.pyc
Binary file not shown.
Binary file removed api/__pycache__/llm.cpython-312.pyc
Binary file not shown.
Binary file removed api/__pycache__/project.cpython-312.pyc
Binary file not shown.
Binary file removed api/analyzers/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed api/analyzers/__pycache__/analyzer.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file removed api/analyzers/__pycache__/utils.cpython-312.pyc
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion api/analyzers/c/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pathlib import Path
from ...entities import *
from ...graph import Graph
from typing import Union, Optional
from typing import Optional
from ..analyzer import AbstractAnalyzer

import tree_sitter_c as tsc
Expand Down
Binary file not shown.
Binary file removed api/code_coverage/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion api/entities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
from .function import Function
from .argument import Argument
from .entity_encoder import *

Binary file removed api/entities/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed api/entities/__pycache__/argument.cpython-312.pyc
Binary file not shown.
Binary file removed api/entities/__pycache__/cls.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file removed api/entities/__pycache__/file.cpython-312.pyc
Binary file not shown.
Binary file removed api/entities/__pycache__/function.cpython-312.pyc
Binary file not shown.
Binary file removed api/entities/__pycache__/struct.cpython-312.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions api/entities/struct.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import List, Optional

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix type annotations and improve id attribute handling

  1. The type annotation List[List[str, str]] is invalid syntax
  2. Using # type: ignore masks potential type system issues

Apply these fixes:

-from typing import List, Optional
+from typing import List, Optional, Union

 class Struct():
     def __init__(self, path: str, name: str, doc: Optional[str],
                  src_start: int, src_end: int) -> None:
-        self.fields: List[List[str, str]] = []
+        self.fields: List[List[str]] = []
+        self.id: Optional[str] = None

     def __str__(self) -> str:
         return f"""
-            id:        {self.id if hasattr(self, 'id') else 'Unknown'} # type: ignore
+            id:        {self.id or 'Unknown'}

Also applies to: 31-31

class Struct():
"""
Expand Down Expand Up @@ -28,7 +28,7 @@ def __init__(self, path: str, name: str, doc: Optional[str],

def __str__(self) -> str:
return f"""
id: {self.id if hasattr(self, 'id') else 'Unknown'}
id: {self.id if hasattr(self, 'id') else 'Unknown'} # type: ignore
path: {self.path}
name: {self.name}
doc: {self.doc}
Expand Down
4 changes: 3 additions & 1 deletion tests/source_files/py/src.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Self

def log(msg: str) -> None:
print(f'msg: {msg}')

Expand All @@ -7,7 +9,7 @@ def __init__(self, name: str, duration: int):
self.duration = duration
print(f'name: {name}, duration: {duration}')

def abort(self, delay:float) -> Task:
def abort(self, delay:float) -> Self:
log(f'Task {self} aborted')
return self

Loading