style: format code with linter

This commit is contained in:
Paul Gauthier (aider) 2024-08-30 14:23:59 -07:00
parent 98884d487f
commit 376e632e16

View file

@ -1,5 +1,6 @@
import os import os
def filter_important_files(file_paths): def filter_important_files(file_paths):
""" """
Filter a list of file paths to return only those that are commonly important in codebases. Filter a list of file paths to return only those that are commonly important in codebases.
@ -9,36 +10,76 @@ def filter_important_files(file_paths):
""" """
important_files = [ important_files = [
# Version Control # Version Control
'.gitignore', '.gitattributes', ".gitignore",
".gitattributes",
# Package Management and Dependencies # Package Management and Dependencies
'requirements.txt', 'Pipfile', 'pyproject.toml', 'package.json', 'package-lock.json', 'yarn.lock', "requirements.txt",
'Gemfile', 'Gemfile.lock', 'composer.json', 'composer.lock', 'pom.xml', 'build.gradle', 'go.mod', 'go.sum', "Pipfile",
"pyproject.toml",
"package.json",
"package-lock.json",
"yarn.lock",
"Gemfile",
"Gemfile.lock",
"composer.json",
"composer.lock",
"pom.xml",
"build.gradle",
"go.mod",
"go.sum",
# Project Configuration # Project Configuration
'.editorconfig', '.eslintrc', '.pylintrc', 'tsconfig.json', ".editorconfig",
".eslintrc",
".pylintrc",
"tsconfig.json",
# Build and Compilation # Build and Compilation
'Makefile', 'webpack.config.js', 'gulpfile.js', "Makefile",
"webpack.config.js",
"gulpfile.js",
# CI/CD # CI/CD
'.travis.yml', '.gitlab-ci.yml', 'Jenkinsfile', ".travis.yml",
".gitlab-ci.yml",
"Jenkinsfile",
# Docker # Docker
'Dockerfile', 'docker-compose.yml', "Dockerfile",
"docker-compose.yml",
# Environment Variables # Environment Variables
'.env', '.env.example', ".env",
".env.example",
# Deployment # Deployment
'Procfile', 'vercel.json', 'netlify.toml', 'app.yaml', "Procfile",
"vercel.json",
"netlify.toml",
"app.yaml",
# Documentation # Documentation
'README.md', 'CONTRIBUTING.md', 'LICENSE', 'CHANGELOG.md', "README.md",
"CONTRIBUTING.md",
"LICENSE",
"CHANGELOG.md",
# Language-specific # Language-specific
'setup.py', '__init__.py', 'Rakefile', '.babelrc', '.npmrc', '.htaccess', "setup.py",
"__init__.py",
"Rakefile",
".babelrc",
".npmrc",
".htaccess",
# Framework-specific # Framework-specific
'manage.py', 'settings.py', 'routes.rb', "manage.py",
"settings.py",
"routes.rb",
# Testing # Testing
'pytest.ini', 'phpunit.xml', 'karma.conf.js', "pytest.ini",
"phpunit.xml",
"karma.conf.js",
# Security # Security
'.npmrc', '.pypirc' ".npmrc",
".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)
return file_name in important_files or any(file_path.endswith(f'/{name}') for name in important_files) return file_name in important_files or any(
file_path.endswith(f"/{name}") for name in important_files
)
return list(filter(is_important, file_paths)) return list(filter(is_important, file_paths))