repowise-dev / repowise-dev/repowise
Classify `.env` dotfiles as config paths
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 711
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 439
Description
Summary
CONFIG_EXTENSIONS in packages/core/src/repowise/core/support_paths.py explicitly lists ".env" as a config extension, but is_doc_or_config_path() matches on PurePosixPath(path).suffix only — and pathlib reports an empty suffix for dotfiles (PurePosixPath('.env').suffix == ''). As a result the file literally named .env (at any depth) is never recognised as config, while foo.env is.
The same suffix-only idiom is duplicated in the knowledge-graph node classifier (_classify_file_type in packages/core/src/repowise/core/analysis/knowledge_graph.py), which therefore labels .env a generic "file" instead of "config".
Steps to reproduce
PYTHONPATH=packages/core/src python3 -c 'from repowise.core.support_paths import is_doc_or_config_path as f, file_population; print(is_doc_or_config_path(".env"), is_doc_or_config_path("proj/.env"), is_doc_or_config_path("foo.env")); print(file_population(".env", is_test=False))'
Expected vs actual
- Expected:
is_doc_or_config_path('.env')→True(it is the canonical file the".env"entry names),is_doc_or_config_path('proj/.env')→True, andfile_population('.env', is_test=False)→"doc". - Actual:
False,False,True(forfoo.env), andfile_population('.env', …)→"production"— so.envfiles are treated as production code by every surface that hides non-production (entry points, tours, module grouping).
Evidence
packages/core/src/repowise/core/support_paths.py:75-80—CONFIG_EXTENSIONScontains".env".packages/core/src/repowise/core/support_paths.py:84-87—is_doc_or_config_pathchecks only.suffix, which is''for.env.packages/core/src/repowise/core/analysis/knowledge_graph.py:167-172—_classify_file_typerepeats the suffix-only check (ext in _CONFIG_EXTENSIONS), so.envfalls through to"file".- Observed output:
[('.env', False), ('proj/.env', False), ('foo.env', True), ('README.md', True)]andfile_population('.env') == 'production'vsfile_population('foo.env') == 'doc'. - Dedup: searched existing issues and PRs (open and closed) for
is_doc_or_config_path,CONFIG_EXTENSIONS,.env config classification,dotfile suffix,file_population— no plausibly related report (the onlydotfilehits are unrelated feature/semantic matches).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with CONFIG_EXTENSIONS and is_doc_or_config_path() in packages/core/src/repowise/core/support_paths.py, then inspect _classify_file_type in packages/core/src/repowise/core/analysis/knowledge_graph.py. Run the reproduction command from the issue and verify that .env and proj/.env are recognised as config, file_population returns "doc", and the knowledge graph classifies .env as "config".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 86/100