Exclude prose/data from language stats; documentation exclusion; programming-only dominant language#12
Merged
Merged
Conversation
…ramming-only dominant language
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the three language-statistics accuracy suggestions for github-linguist parity. All three parts are done (none deferred).
Part 1 — Exclude prose + data from language statistics
LanguageAggregator.Aggregatenow skipsLanguageType.ProseandLanguageType.Dataentirely (rows and denominator), so percent is the share of programming + markup bytes only. XML-doc updated. (Ref:language-aggregator-exclude-prose-data.md)Part 2 — Documentation/example exclusion
src/Ivy.StackAnalyzer/data/documentation.yml(seeded from linguistdocumentation.yml: examples/samples/demos/docs/documentation/changelog/README/license path patterns).DataStore.LoadDocumentation(resource suffix.data.documentation.yml) mirroringLoadVendor, exposed asDataStore.DocumentationPatterns, with user-directory overlay support.ScannedFile.IsDocumentation, set inFileSystemScannerthe same way asIsVendoredbut WITHOUT pruning the directory from the walk (example/doc dirs still surface as[auxiliary]components;ComponentDetectorstill reads the unfiltered list).Aggregateguard extended with|| f.File.IsDocumentation.(Ref:
language-examples-overcount.md)Part 3 — Programming-only dominant language
Added
LanguageAggregator.DominantProgrammingLanguage, restricting the dominant/headline language pick totype == Programming(linguist parity), so adata(JSON) orprose(Text) language can never out-rank the real code language. After Part 1 the per-componentLanguageslist (consumed for the hash language slot) is already free of data/prose; this helper makes the rule explicit and also excludes markup. (Ref:dominant-language-includes-data-prose.md)Tests
dotnet test: 97 passed / 0 failed (95 baseline + 2 new aggregator tests).LanguageAggregatorTests.cs: rewroteAggregate_excludes_*to assert prose/data exclusion + re-percent; addedAggregate_excludes_documentation_filesandDominantProgrammingLanguage_ignores_markup_data_and_prose.go-service(drops Go Module data row),numpy-style-lib(drops TOML),django-spa(drops JSON/Markdown/Pip Requirements),next-dotnet-monorepo(drops XML/JSON/YAML/Markdown). Percentages re-computed over programming+markup; docs-only auxiliary subtrees now showlanguages: [].Note: no test fixture contains an example/docs subtree of real code, so Part 2's path exclusion is covered by the dedicated unit test rather than a snapshot.