Skip to content

Commit

Permalink
fixed python indexing
Browse files Browse the repository at this point in the history
Signed-off-by: san-zrl <[email protected]>
  • Loading branch information
san-zrl committed Jan 22, 2025
1 parent d57f319 commit 10d9242
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private List<ProjectModule> detectModules(
for (File file : filesInDir) {
if (isModule(filesInDir)) {
if (file.isDirectory() && !".git".equals(file.getName())) {
LOGGER.debug("Extracting files from project: {}", file.getPath());
LOGGER.debug("Extracting projects from module: {}", file.getPath());
this.detectModules(file, projectModules);
}
} else {
Expand All @@ -97,6 +97,7 @@ public List<InputFile> getFiles(
if (filesInDir != null) {
for (File file : filesInDir) {
if (file.isDirectory() && !".git".equals(file.getName())) {
LOGGER.debug("Extracting files from directory: {}", file.getPath());
getFiles(new File(directory + File.separator + file.getName()), inputFiles);
} else if (file.isFile()
&& file.getName().endsWith(this.languageFileExtension)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ public PythonIndexService(@Nonnull IProgressDispatcher progressDispatcher) {

@Override
boolean isModule(@Nonnull File[] files) {
return Arrays.stream(files)
.anyMatch(
f ->
f.getName().equals("pyproject.toml")
|| f.getName().equals("setup.cfg")
|| f.getName().equals("setup.py"));
return Arrays.stream(files).anyMatch(f -> f.isDirectory() && f.getName().equals("src"));
// f.getName().equals("pyproject.toml")
// || f.getName().equals("setup.cfg")
// || f.getName().equals("setup.py"));
}

@Override
boolean excludeFromIndexing(@Nonnull File file) {
return file.getPath().contains("test/");
return file.getPath().contains("tests/");
}
}

0 comments on commit 10d9242

Please sign in to comment.