8000 fix(init): stop naming a language from files inside dependency directories by tuyentran4992 · Pull Request #201 · habit-hooks/habit-hooks · GitHub
[go: up one dir, main page]

Skip to content

fix(init): stop naming a language from files inside dependency directories - #201

Open
tuyentran4992 wants to merge 1 commit into
habit-hooks:mainfrom
tuyentran4992:fix-init-dependency-directories
Open

tuyentran4992 wants to merge 1 commit into
habit-hooks:mainfrom
tuyentran4992:fix-init-dependency-directories

Conversation

@tuyentran4992
Copy link
Copy Markdown

Closes #136.

init handed the raw git ls-files output straight to language detection, so a single .php file inside a node_modules that .gitignore does not cover (or vendor, site-packages, .venv, venv) was enough to name php — the same files the active plugins' own files globs already leave out.

The init path now drops files inside those directories before detection: no language is named from a file that only sits in one of them, a real PHP source elsewhere in the project still names php, and a file that merely resembles one of the names (src/vendorize.py) still names its language.

Test: tests/test_init_names_no_language_from_dependency_directories.py — one case per dependency directory, a real source file beside it, and both done when cases from the issue. Running alongside the existing init, recommend, report and listing tests: 6 failed / 41 passed before the change, 47 passed after.

…ories

`init` fed the raw `git ls-files` output to language detection, so a single `.php` file inside a `node_modules` that `.gitignore` does not cover was enough to name php. The init path now drops `node_modules`, `vendor`, `site-packages`, `.venv` and `venv` before detection, while a PHP source outside those directories is still named php.

This branch has not been deployed

No deployments
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.

init detects a language from one file inside a dependency directory

1 participant

0