Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Display warnings if certain well-known directories (e.g. .git) are imported #85

Open
Profpatsch opened this issue May 27, 2019 · 3 comments
Labels
feature request Request for new functionality good first issue Good for newcomers user-facing Improvement that increases user experience

Comments

@Profpatsch
Copy link
Collaborator

Profpatsch commented May 27, 2019

Lorri should make an effort to help the user prevent common mistakes, by displaying (silence-able?) warnings.

  • .git directories
  • Directories that are very large

In another step, if we know what kind of project the user has, we can check for language-specific directories (e.g. target/ for Rust/cargo projects). Or even implement that logic for them with our own library of mkShell-like functions (lorriRustProject, lorriGoProject …).

This is a step towards #84

@Profpatsch Profpatsch added the feature request Request for new functionality label May 27, 2019
@Profpatsch Profpatsch added good first issue Good for newcomers user-facing Improvement that increases user experience labels Oct 3, 2019
@Profpatsch
Copy link
Collaborator Author

Profpatsch commented Oct 3, 2019

A first step is to collect a series of directories which should be linted.

An idea is to use .gitignore to find ignored files and print a warning if one of those is added to the watcher.

New files are currently added here:

lorri/src/ops/daemon.rs

Lines 60 to 72 in ae95c4d

pool.spawn("build-instruction-handler", move || {
// For each build instruction, add the corresponding file
// to the watch list.
for start_build in accept_messages_rx {
let project = ::project::Project::new(
start_build.nix_file,
paths.gc_root_dir(),
paths.cas_store().clone(),
)
// TODO: the project needs to create its gc root dir
.unwrap();
daemon.add(project)
}

so that’s the place where the linter should hook into.

@0mbi
Copy link

0mbi commented Oct 4, 2019

I take that one.

@0mbi
Copy link

0mbi commented Oct 19, 2019

First draft PR, looking for your comments.

Next steps would be:

  • add cli flag to add some file like .gitignore and add the regexps from it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request Request for new functionality good first issue Good for newcomers user-facing Improvement that increases user experience
Projects
None yet
Development

No branches or pull requests

2 participants