Skip to content

Expose config files from ProjectFiles#143

Merged
Zir0-93 merged 2 commits into
masterfrom
feature/project-files-expose-config-files
Apr 18, 2026
Merged

Expose config files from ProjectFiles#143
Zir0-93 merged 2 commits into
masterfrom
feature/project-files-expose-config-files

Conversation

@Zir0-93

@Zir0-93 Zir0-93 commented Apr 18, 2026

Copy link
Copy Markdown
Member

The change makes ProjectFiles expose config/support files through files(), and also:

  • loads them from directories
  • allows insertFile() for them
  • allows removeFile() for them
  • includes them in matchingFilesByName()

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17cdd8117a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +181 to +183
if (nextFile.isFile()) {
String content = FileUtils.readFileToString(nextFile, StandardCharsets.UTF_8);
this.insertFile(new ProjectFile(nextFile.getAbsolutePath(), content));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Check file type before reading directory file content

ProjectFiles.initFilesFromDir now reads every file into memory (readFileToString) before insertFile decides whether it is a supported source/config file, so large binaries and unrelated assets in a repo are fully loaded even though they are immediately skipped. On real projects (e.g., node_modules, media files, build artifacts), this can cause major slowdowns or OOMs that did not occur when filtering by extension first.

Useful? React with 👍 / 👎.

Comment on lines +355 to +356
this.size -= 1;
LOGGER.debug("Removed config file at path: " + normalizedConfigPath + ".");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Prevent size underflow when removing zip-loaded config files

This decrement assumes every config entry was counted in size, but zip config files are still inserted via handlePotentialConfigFile without incrementing size. After this commit exposed config files/removal paths, a zip containing only tsconfig.json can produce size()==0 initially and then removeFile(...) drives it to -1, making size() inconsistent and incorrect.

Useful? React with 👍 / 👎.

@codecov

codecov Bot commented Apr 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.15094% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.16%. Comparing base (d0f801e) to head (02f6cc7).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...n/java/com/hadi/clarpse/compiler/ProjectFiles.java 64.15% 7 Missing and 12 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #143      +/-   ##
============================================
- Coverage     70.26%   70.16%   -0.11%     
- Complexity      625      642      +17     
============================================
  Files            59       59              
  Lines          3000     3043      +43     
  Branches        424      442      +18     
============================================
+ Hits           2108     2135      +27     
- Misses          620      623       +3     
- Partials        272      285      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Zir0-93 Zir0-93 merged commit 6191127 into master Apr 18, 2026
7 checks passed
@Zir0-93 Zir0-93 deleted the feature/project-files-expose-config-files branch April 18, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant