refactor: update important files list and make it global

This commit is contained in:
Paul Gauthier (aider) 2024-08-30 14:34:47 -07:00
parent f9afa1c9f8
commit e629971138

View file

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