Skip to content
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ Code Buddy Assist is a powerful tool designed to enhance your coding experience

Code Buddy Assist transforms the way developers interact with AI, creating a personalized coding companion that understands the nuances of your project and can assist at every stage of development.

## Benefits of LLM Independence

Some LLM-based code assistants run into usage limits or restrictions, which can interrupt the development workflow. Since Code Buddy Assist is LLM-independent, it allows you to easily switch to another LLM when running into usage limits or when specific LLM features are needed. This flexibility ensures continuous and uninterrupted coding assistance, adapting to your evolving needs.

## Installation

To install Code Buddy Assist, run the following command:
Expand Down
24 changes: 22 additions & 2 deletions code_buddy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,34 @@ def get_all_files(repo):

def is_image_file(filename):
"""Check if a file is an image based on its extension."""
image_extensions = {'.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.webp', '.svg', '.ico', '.yaml'}
image_extensions = {'.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.webp', '.svg', '.ico', '.yaml', '.woff'}
return Path(filename).suffix.lower() in image_extensions

# is_file_name: takes a path to a file and returns False if file is excluded, file can be a relative path
def is_excluded_file_name(file):
# List of file names or directories to exclude
excluded_files = [
'node_modules', 'package-lock.json', 'yarn.lock', '.DS_Store', '.gitignore', '.gitattributes', '.gitmodules',
'.git', '.idea', '.vscode', '.env', '.env.local', '.env.development', '.env.test', '.env.production',
'.env.staging', '.env.local', '.env.*.local', 'npm-debug.log', 'yarn-debug.log', 'yarn-error.log', 'yarn-integrity'
]

# Check if the file is in the list of excluded files or in an excluded directory
file_name = os.path.basename(file) # Get the base name of the file
for excluded in excluded_files:
# Match either the exact file name or a wildcard match (for .env.*)
if excluded.startswith('.env.*') and file_name.startswith('.env.') or file_name == excluded:
return True

# If it's not excluded, return False
return False


def build_structure(root_path, files):
"""Build a nested dictionary structure representing the project files."""
structure = {}
for file_path in files:
if is_image_file(file_path):
if is_image_file(file_path) or is_excluded_file_name(file_path):
continue # Skip image files
full_path = Path(root_path) / file_path
# Ensure the file exists
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# version.py
__version__ = "0.4.0"
__version__ = "0.5.0"
Loading