Comments (5)
I run into that even on this project :) the kondo-ui
subdirectory is not part of the workspace so it has it's own target directory, which is skipped because it's inside a project.
The code causing this is here
Lines 224 to 225 in 7a549b6
Perhaps this decision should be on a project type basis.
from kondo.
Or a project type basis. With node_modules
you either want to delete the whole tree, including transient dependencies, or you want to keep all of it.
But with Rust target
, the other target
s are not under the top target
. In fact both specifically examples
and any other workspace/non-workspace nested projects are whole projects, precisely because they are source projects and not just published dependencies.
So, should it ask for each nested project, or just once for the topmost project and apply that ruling to all nested projects? 🤔
Also sometimes you have node_modules
in Rust projects and Rust target
in npm module projects...
from kondo.
That's a good point, I hadn't considered directories that are more than one type of project, eg cargo and node project. Hmm... I'll have to think on that, also how to recurse directories that are not artifacts of the current project, the implementation now might make that a little tricky.
from kondo.
Still, at least looking at just Rust and nodejs, it seems like differentiating between:
- artifact directories (delete, never enter)
- literally everything else (don't delete, recurse)
should be sufficient?
So:
- get directory listing (actually collect to memory)
, while looking for marker files that signify a project. You can actually collect into twoVec
s byDirEntry::file_type()
which unlikemetadata()
is said not to involve additional syscalls. - look through directory listing, looking for marker files and immediately mark the corresponding artifacts for "deletion".
- recurse on directories that have not been marked.
from kondo.
That makes sense. I'll think through it. I think this might also be a good opportunity to add integration tests for the project, and model these situations.
from kondo.
Related Issues (20)
- is it possible to run kondo recursively? HOT 3
- Option for non-interactive mode HOT 2
- "kondo ." does not work inside $HOME HOT 14
- Binary .exe under Windows 11 does not start HOT 2
- Following symlinks is a questionable default HOT 4
- Only delete old project (skip active project) HOT 7
- Os error NotFound when trying to ignore certain directories with `ls --ignore=...` HOT 4
- Make a new release HOT 6
- Could not compile kondo-ui HOT 1
- kondo doesn't build on FreeBSD HOT 1
- Add .angular folder HOT 1
- No icons in UI (actually, just one). Font needed? HOT 1
- Clean up more Python-related caches
- How to ignore some directory? HOT 14
- Support deleting the Zig cache HOT 1
- `--ignored-dirs` argument ignores the project itself HOT 3
- Support system level cleaning
- Support moving artifacts to system trash
- Issues deleting directories. Error: "Directory not empty" HOT 4
- 72 years ago HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kondo.