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

Library with root example file is causing arduino-lint to crash #751

Closed
3 tasks done
umbynos opened this issue Jul 25, 2024 · 0 comments · Fixed by #752
Closed
3 tasks done

Library with root example file is causing arduino-lint to crash #751

umbynos opened this issue Jul 25, 2024 · 0 comments · Fixed by #752
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@umbynos
Copy link
Contributor

umbynos commented Jul 25, 2024

Describe the problem

A library with example root file is crashing the tool

To reproduce

This is the culprit: https://github.com/Arathierl/Home-Automation/blob/98ca53400080f2a2f5ca15cb6d6902c817291c26/example

  export ARDUINO_LINT_OFFICIAL="false"
  
  "/home/runner/work/_temp/arduino-lint/arduino-lint" \
    --compliance=permissive \
    --format=text \
    --library-manager=submit \
    --project-type=library \
    --recursive=false \
    --report-file="/home/runner/work/_temp/report.json" \
    "Home-Automation-using-arduino" > \
      "/home/runner/work/_temp/report.txt"
  shell: /usr/bin/bash -e {0}
  env:
    SUBMISSION_PARSER_VERSION: 1.1.1
    MAINTAINERS: # GitHub user names to request reviews from in cases where PRs can't be managed automatically.
  - per1234
  
    CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT: check-submissions-failed
    ERROR_MESSAGE_PREFIX: :x: **ERROR:** 
    JSON_REPORT_PATH: /home/runner/work/_temp/report.json
    TEXT_REPORT_PATH: /home/runner/work/_temp/report.txt
    ARDUINO_LINT_INSTALLATION_PATH: /home/runner/work/_temp/arduino-lint
    PASS: true
    FAIL_FLAG_PATH: /home/runner/work/_temp/.check-submissions-failed
panic: readdirent Home-Automation-using-arduino/example: not a directory

goroutine 1 [running]:
github.com/arduino/arduino-lint/internal/project.findSubprojects({0xc0003d8e20, 0x0, 0x8}, 0x1)
	/home/build/internal/project/project.go:199 +0x705
github.com/arduino/arduino-lint/internal/project.findProjects(0xc0003d8e20)
	/home/build/internal/project/project.go:109 +0x38b
github.com/arduino/arduino-lint/internal/project.FindProjects()
	/home/build/internal/project/project.go:47 +0xc9
github.com/arduino/arduino-lint/internal/command.ArduinoLint(0xc0003db900, {0xc0003ee690, 0x1, 0x7})
	/home/build/internal/command/command.go:70 +0xd7
github.com/spf13/cobra.(*Command).execute(0xc0003db900, {0xc0000bc010, 0x7, 0x7})
	/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:860 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0xc0003db900)
	/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902
main.main()
	/home/build/main.go:33 +0x1e
Error: Process completed with exit code 2.

https://github.com/arduino/library-registry/actions/runs/10089139998/job/27896099282#step:8:27

Expected behavior

Arduino-lint should report the problem without crashing

Arduino Lint version

1.2.1

Operating system

Linux

Operating system version

n/a

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details
@umbynos umbynos added the type: imperfection Perceived defect in any part of project label Jul 25, 2024
@umbynos umbynos self-assigned this Jul 25, 2024
@per1234 per1234 added conclusion: resolved Issue was resolved topic: code Related to content of the project itself labels Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants