mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
refactor: update important files list and make it global
This commit is contained in:
parent
f9afa1c9f8
commit
e629971138
1 changed files with 61 additions and 124 deletions
185
aider/special.py
185
aider/special.py
|
@ -1,129 +1,66 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
IMPORTANT_FILES = [
|
||||||
def filter_important_files(file_paths):
|
# Version Control
|
||||||
"""
|
".gitignore", ".gitattributes",
|
||||||
Filter a list of file paths to return only those that are commonly important in codebases.
|
# Documentation
|
||||||
|
"README.md", "CONTRIBUTING.md", "LICENSE", "CHANGELOG.md", "SECURITY.md", "CODEOWNERS",
|
||||||
:param file_paths: List of file paths to check
|
# Package Management and Dependencies
|
||||||
:return: List of file paths that match important file patterns
|
"requirements.txt", "Pipfile", "pyproject.toml", "setup.py",
|
||||||
"""
|
"package.json", "package-lock.json", "yarn.lock", "npm-shrinkwrap.json",
|
||||||
important_files = [
|
"Gemfile", "Gemfile.lock", "composer.json", "composer.lock",
|
||||||
# Version Control
|
"pom.xml", "build.gradle", "build.sbt", "go.mod", "go.sum",
|
||||||
".gitignore",
|
"Cargo.toml", "Cargo.lock", "mix.exs", "rebar.config", "project.clj",
|
||||||
".gitattributes",
|
"Podfile", "Cartfile", "dub.json", "dub.sdl",
|
||||||
# Documentation
|
# Configuration and Settings
|
||||||
"README.md",
|
".env", ".env.example", ".editorconfig", "tsconfig.json", "jsconfig.json",
|
||||||
"CONTRIBUTING.md",
|
".babelrc", "babel.config.js", ".eslintrc", ".eslintignore",
|
||||||
"LICENSE",
|
".prettierrc", ".stylelintrc", "tslint.json", ".pylintrc", ".flake8",
|
||||||
"CHANGELOG.md",
|
".rubocop.yml", ".scalafmt.conf", ".dockerignore", ".gitpod.yml",
|
||||||
"SECURITY.md",
|
"sonar-project.properties", "renovate.json", "dependabot.yml",
|
||||||
"CODEOWNERS",
|
# Build and Compilation
|
||||||
# Package Management and Dependencies
|
"Makefile", "CMakeLists.txt", "webpack.config.js", "rollup.config.js",
|
||||||
"requirements.txt",
|
"parcel.config.js", "gulpfile.js", "Gruntfile.js",
|
||||||
"Pipfile",
|
"build.xml", "build.boot", "project.json", "build.cake",
|
||||||
"pyproject.toml",
|
# Testing
|
||||||
"setup.py",
|
"pytest.ini", "phpunit.xml", "karma.conf.js", "jest.config.js", "cypress.json",
|
||||||
"package.json",
|
# CI/CD
|
||||||
"package-lock.json",
|
".travis.yml", ".gitlab-ci.yml", "Jenkinsfile", "azure-pipelines.yml",
|
||||||
"yarn.lock",
|
"bitbucket-pipelines.yml", "appveyor.yml", "circle.yml", ".circleci/config.yml",
|
||||||
"npm-shrinkwrap.json",
|
# Docker and Containers
|
||||||
"Gemfile",
|
"Dockerfile", "docker-compose.yml", "docker-compose.override.yml",
|
||||||
"Gemfile.lock",
|
# Cloud and Serverless
|
||||||
"composer.json",
|
"serverless.yml", "firebase.json", "now.json", "netlify.toml", "vercel.json", "app.yaml",
|
||||||
"composer.lock",
|
"terraform.tf", "main.tf", "cloudformation.yaml", "cloudformation.json",
|
||||||
"pom.xml",
|
"ansible.cfg", "kubernetes.yaml", "k8s.yaml",
|
||||||
"build.gradle",
|
# Database
|
||||||
"build.sbt",
|
"schema.sql", "liquibase.properties", "flyway.conf",
|
||||||
"go.mod",
|
# Framework-specific
|
||||||
"go.sum",
|
"manage.py", "settings.py", # Django
|
||||||
"Cargo.toml",
|
"config/routes.rb", "Rakefile", # Ruby on Rails
|
||||||
"Cargo.lock",
|
"next.config.js", "nuxt.config.js", # Next.js, Nuxt.js
|
||||||
"mix.exs",
|
"vue.config.js", "angular.json", # Vue.js, Angular
|
||||||
"rebar.config",
|
"gatsby-config.js", "gridsome.config.js", # Gatsby, Gridsome
|
||||||
"project.clj",
|
# API Documentation
|
||||||
# Configuration and Settings
|
"swagger.yaml", "swagger.json", "openapi.yaml", "openapi.json",
|
||||||
".env",
|
# Language-specific
|
||||||
".env.example",
|
"__init__.py", # Python
|
||||||
".editorconfig",
|
"stack.yaml", "package.yaml", # Haskell
|
||||||
"tsconfig.json",
|
".htaccess", # Apache
|
||||||
"jsconfig.json",
|
# Development environment
|
||||||
".babelrc",
|
".nvmrc", ".ruby-version", ".python-version", "Vagrantfile",
|
||||||
"babel.config.js",
|
# Quality and metrics
|
||||||
".eslintrc",
|
".codeclimate.yml", ".coveragerc", "codecov.yml",
|
||||||
".eslintignore",
|
# Documentation
|
||||||
".prettierrc",
|
"mkdocs.yml", "_config.yml", "book.toml",
|
||||||
".stylelintrc",
|
# Package registries
|
||||||
"tslint.json",
|
".npmrc", ".yarnrc",
|
||||||
".pylintrc",
|
# IDE and Editor
|
||||||
".flake8",
|
".vscode/settings.json", ".idea/workspace.xml",
|
||||||
".rubocop.yml",
|
".sublime-project", ".vim", "_vimrc",
|
||||||
".scalafmt.conf",
|
# Misc
|
||||||
# Build and Compilation
|
"CODEOWNERS", ".pypirc",
|
||||||
"Makefile",
|
]
|
||||||
"CMakeLists.txt",
|
|
||||||
"webpack.config.js",
|
|
||||||
"rollup.config.js",
|
|
||||||
"parcel.config.js",
|
|
||||||
"gulpfile.js",
|
|
||||||
"Gruntfile.js",
|
|
||||||
# Testing
|
|
||||||
"pytest.ini",
|
|
||||||
"phpunit.xml",
|
|
||||||
"karma.conf.js",
|
|
||||||
"jest.config.js",
|
|
||||||
"cypress.json",
|
|
||||||
# CI/CD
|
|
||||||
".travis.yml",
|
|
||||||
".gitlab-ci.yml",
|
|
||||||
"Jenkinsfile",
|
|
||||||
"azure-pipelines.yml",
|
|
||||||
"bitbucket-pipelines.yml",
|
|
||||||
# Docker and Containers
|
|
||||||
"Dockerfile",
|
|
||||||
"docker-compose.yml",
|
|
||||||
"docker-compose.override.yml",
|
|
||||||
# Cloud and Serverless
|
|
||||||
"serverless.yml",
|
|
||||||
"firebase.json",
|
|
||||||
"now.json",
|
|
||||||
"netlify.toml",
|
|
||||||
"vercel.json",
|
|
||||||
"app.yaml",
|
|
||||||
# Database
|
|
||||||
"schema.sql",
|
|
||||||
"liquibase.properties",
|
|
||||||
"flyway.conf",
|
|
||||||
# Framework-specific
|
|
||||||
"manage.py",
|
|
||||||
"settings.py", # Django
|
|
||||||
"config/routes.rb",
|
|
||||||
"Rakefile", # Ruby on Rails
|
|
||||||
"next.config.js",
|
|
||||||
"nuxt.config.js", # Next.js, Nuxt.js
|
|
||||||
"vue.config.js",
|
|
||||||
"angular.json", # Vue.js, Angular
|
|
||||||
"gatsby-config.js",
|
|
||||||
"gridsome.config.js", # Gatsby, Gridsome
|
|
||||||
# API Documentation
|
|
||||||
"swagger.yaml",
|
|
||||||
"swagger.json",
|
|
||||||
"openapi.yaml",
|
|
||||||
"openapi.json",
|
|
||||||
# Language-specific
|
|
||||||
"__init__.py", # Python
|
|
||||||
"stack.yaml",
|
|
||||||
"package.yaml", # Haskell
|
|
||||||
".htaccess", # Apache
|
|
||||||
# IDE and Editor
|
|
||||||
".vscode/settings.json",
|
|
||||||
".idea/workspace.xml",
|
|
||||||
# Misc
|
|
||||||
"CODEOWNERS",
|
|
||||||
".npmrc",
|
|
||||||
".yarnrc",
|
|
||||||
".pypirc",
|
|
||||||
]
|
|
||||||
|
|
||||||
def is_important(file_path):
|
def is_important(file_path):
|
||||||
file_name = os.path.basename(file_path)
|
file_name = os.path.basename(file_path)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue