Skip to content

Conversation

@ccoVeille
Copy link
Contributor

@ccoVeille ccoVeille commented Jul 9, 2024

  • chore: use field name for setting struct
  • feat: add support for well known files

Related to #135

@ccoVeille ccoVeille force-pushed the known-files branch 2 times, most recently from ec013c7 to 7cab4c9 Compare July 9, 2024 22:16
@ccoVeille
Copy link
Contributor Author

My approach is somehow naive, I wish I could have supported things like ssh/config file.

But, that's not my today's fight

@kehoecj kehoecj self-requested a review July 10, 2024 14:18
@kehoecj kehoecj added the waiting-on-maintainer-review PR is waiting to be reviewed and functionally tested by the maintainers label Jul 10, 2024
@kehoecj kehoecj requested a review from jackswiney July 19, 2024 14:39
@kehoecj
Copy link
Collaborator

kehoecj commented Aug 3, 2024

@ccoVeille Need to think about this a bit. I like the idea but I'm not sure I want to maintain a list of well-known files within this project.

@ccoVeille
Copy link
Contributor Author

I understand, no rush

@ccoVeille
Copy link
Contributor Author

@kmk142789 reactivated this old PR.

thanks. I had forgotten it

@kehoecj is there anything blocking on this?

@kehoecj
Copy link
Collaborator

kehoecj commented Dec 17, 2025

@ccoVeille No, just a couple merge conflicts since it's so old. I think it's ready to get merged after those are resolved

@kehoecj kehoecj added pr-action-requested PR is awaiting feedback from the submitting developer OSS Community Contribution Contributions from the OSS Community and removed waiting-on-maintainer-review PR is waiting to be reviewed and functionally tested by the maintainers labels Dec 18, 2025
Copilot AI review requested due to automatic review settings December 18, 2025 18:46
@ccoVeille ccoVeille requested a review from a team as a code owner December 18, 2025 18:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for identifying configuration files by their well-known filenames (e.g., .editorconfig, Cargo.lock) in addition to file extensions, and refactors FileType struct initialization to use explicit field names for better readability.

  • Adds KnownFiles field to FileType struct to support matching files by exact filename
  • Updates file matching logic to check both known filenames and extensions
  • Refactors all FileType instances to use named field initialization
  • Adds known filenames for YAML, TOML, and INI file types

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
test/fixtures/.editorconfig Adds test fixture for validating known file detection
pkg/filetype/file_type.go Adds KnownFiles field to FileType struct and populates known filenames for YAML, TOML, and INI types; refactors struct initialization to use named fields
pkg/finder/fsfinder.go Updates file matching logic to check KnownFiles map before checking Extensions map
pkg/finder/finder_test.go Adds test case to verify known files feature works correctly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 147 to 151
files, err := fsFinder.Find()

if len(files) < 1 {
t.Errorf("Unable to find files")
}
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

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

The test should verify that the correct file (.editorconfig) was found, not just that at least one file was found. Consider adding an assertion to check that the found file's path contains ".editorconfig" or matches the expected file.

Copilot uses AI. Check for mistakes.
@ccoVeille
Copy link
Contributor Author

I'll fix the linting issues later. It's not as if there was an emergency to merge this 1 year old PR

@kehoecj kehoecj added the no changelog Do not require a CHANGELOG update for MR's. Mostly used for dependably label Dec 19, 2025
@ccoVeille
Copy link
Contributor Author

it should be OK now

@kehoecj kehoecj merged commit 50ab8a2 into Boeing:main Jan 5, 2026
12 checks passed
@ccoVeille ccoVeille deleted the known-files branch January 5, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog Do not require a CHANGELOG update for MR's. Mostly used for dependably OSS Community Contribution Contributions from the OSS Community pr-action-requested PR is awaiting feedback from the submitting developer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants