tbillington / kondo

Cleans dependencies and build artifacts from your projects.
MIT License
1.8k stars 52 forks source link

Does not recurse through directories with python scripts present #117

Open rivnakm opened 10 months ago

rivnakm commented 10 months ago

I have a project where I use python to script some misc tasks like testing. It seems that once a .py file is detected it'll stop searching any other subdirectories since it marks the project as Python. This might have to get filed under the discovery rework since it might need project types to be non-exclusive which could take some extra refactoring.

Example: since the project root has a run.py file, the cargo and nodejs projects aren't detected

project/
├── api/
│   ├── src/
│   ├── target/
│   ├── tests/
│   ├── Cargo.toml
│   └── test.py
├── web/
│   ├── node_modules/
│   ├── src/
│   └── package.json
└── run.py
tbillington commented 10 months ago

You're correct that resolving this falls under the rework described in #111 and is an example of #29.

It does poke at an issue that I've been struggling to come up with a solid answer for.

Given the nested project structure you've described, would you expect/prefer that kondo treat project/ as a singular project, or as 3 separate projects?

rivnakm commented 10 months ago

I think I'd prefer it to be detected as one project of multiple types (so a single delete prompt). But how do we determine that the subfolders are part of a single project? I'd imagine checking for a .git folder is a good option there.

tbillington commented 10 months ago

I hadn't thought of .git but it is a strong indicator.