Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix expression language warnings #1364

Open
copumpkin opened this issue Apr 27, 2017 · 2 comments
Open

Nix expression language warnings #1364

copumpkin opened this issue Apr 27, 2017 · 2 comments
Assignees
Labels
error-messages Confusing messages and better diagnostics feature Feature request or proposal language The Nix expression language; parser, interpreter, primops, evaluation, etc

Comments

@copumpkin
Copy link
Member

It'd be nice if I could opt into warnings, like I can with many compilers (e.g., -Wall, -Werror, etc. in C compilers).

The most obvious warning that comes to mind would look something like this:

warning: suspicious shadowing between `with` binding for <varname> and external context at <loc>

That would indicate if you have a with binding in scope while also having the same binding from the outer scope. I'm sure there are a few other "likely programmer errors" we could catch this way.

Another implementation could be to have a nix lint subcommand in the new UI, but I'm afraid of branching the expression language handling too much from the actual evaluation of the language, so it seems like it would need to be integrated into libexpr somehow.

Related to #1361.

@thufschmitt
Copy link
Member

Having static warnings would probably be quite hard[1] because the language is too dynamic, but having an evaluation mode where those warnings are thrown at runtime should be easier, and already really nice.

[1]: although some errors could probably be caught by the type-checker I'm writing

@stale
Copy link

stale bot commented Feb 15, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 15, 2021
@fricklerhandwerk fricklerhandwerk added error-messages Confusing messages and better diagnostics language The Nix expression language; parser, interpreter, primops, evaluation, etc feature Feature request or proposal labels Sep 12, 2022
@stale stale bot removed stale labels Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error-messages Confusing messages and better diagnostics feature Feature request or proposal language The Nix expression language; parser, interpreter, primops, evaluation, etc
Projects
None yet
Development

No branches or pull requests

6 participants