repowise-dev / repowise-dev/repowise

Classify `.env` dotfiles as config paths

Open Beginner friendly
#2,379 0 comments 0 reactions 0 assignees View on GitHub

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, and file_population('.env', is_test=False)"doc".
  • Actual: False, False, True (for foo.env), and file_population('.env', …)"production" — so .env files 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-80CONFIG_EXTENSIONS contains ".env".
  • packages/core/src/repowise/core/support_paths.py:84-87is_doc_or_config_path checks only .suffix, which is '' for .env.
  • packages/core/src/repowise/core/analysis/knowledge_graph.py:167-172_classify_file_type repeats the suffix-only check (ext in _CONFIG_EXTENSIONS), so .env falls through to "file".
  • Observed output: [('.env', False), ('proj/.env', False), ('foo.env', True), ('README.md', True)] and file_population('.env') == 'production' vs file_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 only dotfile hits are unrelated feature/semantic matches).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.