Make `max_tree_size` configurable per-repository by issyl0 · Pull Request #6806 · github-linguist/linguist · GitHub
Skip to content

Make max_tree_size configurable per-repository#6806

Merged
lildude merged 2 commits into
masterfrom
configurable-repository-max-tree-size
May 10, 2024
Merged

Make max_tree_size configurable per-repository#6806
lildude merged 2 commits into
masterfrom
configurable-repository-max-tree-size

Conversation

@issyl0

@issyl0 issyl0 commented May 1, 2024

Copy link
Copy Markdown
Collaborator

Supersedes #6805 since that was from my personal fork.

Description

  • For GitHub Code Scanning functionality, we want to be able to enable Default Setup on more repos. That relies on Linguist for the language detection.
  • We found that in very large repos, the MAX_TREE_SIZE constant was not high enough.
  • This makes the max_tree_size value configurable in both initialize and incremental methods, with a default value of 100,000.
  • ❓ This is my first contribution to Linguist and I have no idea if this is "the way".

Checklist:

  • I am adding new or changing current functionality
    • I have added or updated the tests for the new or changed functionality.

- We want to make Linguist better at detecting all possible languages in very large repos.
- This makes a repository's `max_tree_size` value configurable, with the default still set at 100,000.
@issyl0 issyl0 requested a review from a team as a code owner May 1, 2024 16:47
@lildude

lildude commented May 1, 2024

Copy link
Copy Markdown
Member

@Alhadis Alhadis changed the title Allow configuring a repository's max_tree_size value Make max_tree_size configurable per-repository May 1, 2024
Comment thread lib/linguist/repository.rb
- So that we only have to update the `100_000` tree size value once if we do need to change it.

@Pea1594 Pea1594 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.

🥰

@lildude

lildude commented May 10, 2024

Copy link
Copy Markdown
Member

@lildude lildude added this pull request to the merge queue May 10, 2024
Merged via the queue into master with commit 4cc5ef6 May 10, 2024
@lildude lildude deleted the configurable-repository-max-tree-size branch May 10, 2024 08:37
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Aug 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants