Coverage for integrations / coding_agent / aider_core / special.py: 41.7%

12 statements  

« prev     ^ index     » next       coverage.py v7.14.0, created at 2026-05-12 04:49 +0000

1import os 

2 

3ROOT_IMPORTANT_FILES = [ 

4 # Version Control 

5 ".gitignore", 

6 ".gitattributes", 

7 # Documentation 

8 "README", 

9 "README.md", 

10 "README.txt", 

11 "README.rst", 

12 "CONTRIBUTING", 

13 "CONTRIBUTING.md", 

14 "CONTRIBUTING.txt", 

15 "CONTRIBUTING.rst", 

16 "LICENSE", 

17 "LICENSE.md", 

18 "LICENSE.txt", 

19 "CHANGELOG", 

20 "CHANGELOG.md", 

21 "CHANGELOG.txt", 

22 "CHANGELOG.rst", 

23 "SECURITY", 

24 "SECURITY.md", 

25 "SECURITY.txt", 

26 "CODEOWNERS", 

27 # Package Management and Dependencies 

28 "requirements.txt", 

29 "Pipfile", 

30 "Pipfile.lock", 

31 "pyproject.toml", 

32 "setup.py", 

33 "setup.cfg", 

34 "package.json", 

35 "package-lock.json", 

36 "yarn.lock", 

37 "npm-shrinkwrap.json", 

38 "Gemfile", 

39 "Gemfile.lock", 

40 "composer.json", 

41 "composer.lock", 

42 "pom.xml", 

43 "build.gradle", 

44 "build.gradle.kts", 

45 "build.sbt", 

46 "go.mod", 

47 "go.sum", 

48 "Cargo.toml", 

49 "Cargo.lock", 

50 "mix.exs", 

51 "rebar.config", 

52 "project.clj", 

53 "Podfile", 

54 "Cartfile", 

55 "dub.json", 

56 "dub.sdl", 

57 # Configuration and Settings 

58 ".env", 

59 ".env.example", 

60 ".editorconfig", 

61 "tsconfig.json", 

62 "jsconfig.json", 

63 ".babelrc", 

64 "babel.config.js", 

65 ".eslintrc", 

66 ".eslintignore", 

67 ".prettierrc", 

68 ".stylelintrc", 

69 "tslint.json", 

70 ".pylintrc", 

71 ".flake8", 

72 ".rubocop.yml", 

73 ".scalafmt.conf", 

74 ".dockerignore", 

75 ".gitpod.yml", 

76 "sonar-project.properties", 

77 "renovate.json", 

78 "dependabot.yml", 

79 ".pre-commit-config.yaml", 

80 "mypy.ini", 

81 "tox.ini", 

82 ".yamllint", 

83 "pyrightconfig.json", 

84 # Build and Compilation 

85 "webpack.config.js", 

86 "rollup.config.js", 

87 "parcel.config.js", 

88 "gulpfile.js", 

89 "Gruntfile.js", 

90 "build.xml", 

91 "build.boot", 

92 "project.json", 

93 "build.cake", 

94 "MANIFEST.in", 

95 # Testing 

96 "pytest.ini", 

97 "phpunit.xml", 

98 "karma.conf.js", 

99 "jest.config.js", 

100 "cypress.json", 

101 ".nycrc", 

102 ".nycrc.json", 

103 # CI/CD 

104 ".travis.yml", 

105 ".gitlab-ci.yml", 

106 "Jenkinsfile", 

107 "azure-pipelines.yml", 

108 "bitbucket-pipelines.yml", 

109 "appveyor.yml", 

110 "circle.yml", 

111 ".circleci/config.yml", 

112 ".github/dependabot.yml", 

113 "codecov.yml", 

114 ".coveragerc", 

115 # Docker and Containers 

116 "Dockerfile", 

117 "docker-compose.yml", 

118 "docker-compose.override.yml", 

119 # Cloud and Serverless 

120 "serverless.yml", 

121 "firebase.json", 

122 "now.json", 

123 "netlify.toml", 

124 "vercel.json", 

125 "app.yaml", 

126 "terraform.tf", 

127 "main.tf", 

128 "cloudformation.yaml", 

129 "cloudformation.json", 

130 "ansible.cfg", 

131 "kubernetes.yaml", 

132 "k8s.yaml", 

133 # Database 

134 "schema.sql", 

135 "liquibase.properties", 

136 "flyway.conf", 

137 # Framework-specific 

138 "next.config.js", 

139 "nuxt.config.js", 

140 "vue.config.js", 

141 "angular.json", 

142 "gatsby-config.js", 

143 "gridsome.config.js", 

144 # API Documentation 

145 "swagger.yaml", 

146 "swagger.json", 

147 "openapi.yaml", 

148 "openapi.json", 

149 # Development environment 

150 ".nvmrc", 

151 ".ruby-version", 

152 ".python-version", 

153 "Vagrantfile", 

154 # Quality and metrics 

155 ".codeclimate.yml", 

156 "codecov.yml", 

157 # Documentation 

158 "mkdocs.yml", 

159 "_config.yml", 

160 "book.toml", 

161 "readthedocs.yml", 

162 ".readthedocs.yaml", 

163 # Package registries 

164 ".npmrc", 

165 ".yarnrc", 

166 # Linting and formatting 

167 ".isort.cfg", 

168 ".markdownlint.json", 

169 ".markdownlint.yaml", 

170 # Security 

171 ".bandit", 

172 ".secrets.baseline", 

173 # Misc 

174 ".pypirc", 

175 ".gitkeep", 

176 ".npmignore", 

177] 

178 

179 

180# Normalize the lists once 

181NORMALIZED_ROOT_IMPORTANT_FILES = set(os.path.normpath(path) for path in ROOT_IMPORTANT_FILES) 

182 

183 

184def is_important(file_path): 

185 file_name = os.path.basename(file_path) 

186 dir_name = os.path.normpath(os.path.dirname(file_path)) 

187 normalized_path = os.path.normpath(file_path) 

188 

189 # Check for GitHub Actions workflow files 

190 if dir_name == os.path.normpath(".github/workflows") and file_name.endswith(".yml"): 

191 return True 

192 

193 return normalized_path in NORMALIZED_ROOT_IMPORTANT_FILES 

194 

195 

196def filter_important_files(file_paths): 

197 """ 

198 Filter a list of file paths to return only those that are commonly important in codebases. 

199 

200 :param file_paths: List of file paths to check 

201 :return: List of file paths that match important file patterns 

202 """ 

203 return list(filter(is_important, file_paths))