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

lint missed something that errored later #37

Open
didibus opened this issue May 2, 2024 · 2 comments
Open

lint missed something that errored later #37

didibus opened this issue May 2, 2024 · 2 comments

Comments

@didibus
Copy link
Contributor

didibus commented May 2, 2024

I ran clojure -T:build lint and got OK.

But when I ran clojure -T:build java-compile I got:

Execution error (ExceptionInfo) at build-edn.core/validate-config! (core.clj:40).
Invalid config: {:java-paths ["missing required key"]}

Full report:

{:clojure.main/message
 "Execution error (ExceptionInfo) at build-edn.core/validate-config! (core.clj:40).\nInvalid config: {:java-paths [\"missing required key\"]}\n",
 :clojure.main/triage
 {:clojure.error/class clojure.lang.ExceptionInfo,
  :clojure.error/line 40,
  :clojure.error/cause
  "Invalid config: {:java-paths [\"missing required key\"]}",
  :clojure.error/symbol build-edn.core/validate-config!,
  :clojure.error/source "core.clj",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type clojure.lang.ExceptionInfo,
    :message
    "Invalid config: {:java-paths [\"missing required key\"]}",
    :data {:java-paths ["missing required key"]},
    :at
    [build_edn.core$validate_config_BANG_
     invokeStatic
     "core.clj"
     40]}],
  :trace
  [[build_edn.core$validate_config_BANG_ invokeStatic "core.clj" 40]
   [build_edn.core$validate_config_BANG_ invoke "core.clj" 34]
   [build_edn.core$java_compile invokeStatic "core.clj" 136]
   [build_edn.core$java_compile invoke "core.clj" 131]
   [build_edn.main$java_compile invokeStatic "main.clj" 36]
   [build_edn.main$java_compile invoke "main.clj" 31]
   [clojure.lang.Var invoke "Var.java" 384]
   [clojure.run.exec$exec invokeStatic "exec.clj" 89]
   [clojure.run.exec$exec invoke "exec.clj" 78]
   [clojure.run.exec$_main$fn__220 invoke "exec.clj" 228]
   [clojure.run.exec$_main invokeStatic "exec.clj" 224]
   [clojure.run.exec$_main doInvoke "exec.clj" 192]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.core$apply invokeStatic "core.clj" 667]
   [clojure.main$main_opt invokeStatic "main.clj" 514]
   [clojure.main$main_opt invoke "main.clj" 510]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.main main "main.java" 40]],
  :cause "Invalid config: {:java-paths [\"missing required key\"]}",
  :data {:java-paths ["missing required key"]}}}
@liquidz
Copy link
Owner

liquidz commented May 3, 2024

@didibus Thanks for your report!

In the build.edn, the required configurations are different for each task, and in the lint task, it checks for required settings that can be identified from the configuration file.

java-paths is only required in the java-compile task, so currently it is not checked in the lint task because it would cause errors for users who do not use the java-compile task.

However, I understand the inconvenience, so I would like to consider making adjustments to issue warnings like "There are no required settings for this task" in the future.

@didibus
Copy link
Contributor Author

didibus commented May 4, 2024

Ah, that makes sense. You can't tell if that's a task the user will run or not, so you can't fail the lint, because if they are not going to use the task it makes sense for them not to have the required fields for it.

I'm thinking here as well, maybe the build.edn can take options of the list of tasks to lint for ? That way I know I'm using java-compile and want to make sure it gets linted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants