Skip to content

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented May 19, 2021

This rule checks for the presence of the library's library.properties depends items in the library index. Since the
library index is not available when in ARDUINO_LINT_LIBRARY_MANAGER_INDEXING mode, this rule can not run.

Before this change, attempting to lint a library with a library.properties depends field when in ARDUINO_LINT_LIBRARY_MANAGER_INDEXING mode resulted in a panic:

panic: interface conversion: interface {} is nil, not []interface {}

goroutine 1 [running]:
github.com/arduino/arduino-lint/internal/rule/rulefunction.nameInLibraryManagerIndex(0xc000160206, 0x19, 0xddae1d)
        /home/build/internal/rule/rulefunction/library.go:1447 +0x1be
github.com/arduino/arduino-lint/internal/rule/rulefunction.LibraryPropertiesDependsFieldNotInIndex(0xdcd21e, 0x18, 0xc0005a1890)
        /home/build/internal/rule/rulefunction/library.go:1181 +0x224
github.com/arduino/arduino-lint/internal/rule.Runner(0xc0008ea050, 0x1, 0x1)
        /home/build/internal/rule/rule.go:53 +0x2e5
github.com/arduino/arduino-lint/internal/command.ArduinoLint(0xc0000ee580, 0x160b2a0, 0x0, 0x0)
        /home/build/internal/command/command.go:76 +0x219
github.com/spf13/cobra.(*Command).execute(0xc0000ee580, 0xc000088190, 0x0, 0x0, 0xc0000ee580, 0xc000088190)
        /go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:854 +0x2a4
github.com/spf13/cobra.(*Command).ExecuteC(0xc0000ee580, 0x0, 0x0, 0x0)
        /go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:958 +0x350
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:895
main.main()
        /home/build/main.go:32 +0x32

This rule checks for the presence of the library's library.properties `depends` items in the library index. Since the
library index is not available when in `ARDUINO_LINT_LIBRARY_MANAGER_INDEXING` mode, this rule can not run.
@per1234 per1234 added type: bug topic: code Related to content of the project itself labels May 19, 2021
@per1234 per1234 requested review from silvanocerza and umbynos May 19, 2021 11:02
@codecov-commenter
Copy link

codecov-commenter commented May 19, 2021

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.34%. Comparing base (609854e) to head (809540a).
⚠️ Report is 1819 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #173   +/-   ##
=======================================
  Coverage   84.34%   84.34%           
=======================================
  Files          43       43           
  Lines        2971     2971           
=======================================
  Hits         2506     2506           
  Misses        373      373           
  Partials       92       92           
Flag Coverage Δ
unit 84.34% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@per1234 per1234 merged commit 57756ad into arduino:main May 19, 2021
@per1234 per1234 deleted the indexing-depends branch May 19, 2021 13:05
@rsora rsora added the type: imperfection Perceived defect in any part of project label Sep 22, 2021
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants