Skip to content

Always discover subprojects #167

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

Merged
merged 2 commits into from
Mar 10, 2021
Merged

Always discover subprojects #167

merged 2 commits into from
Mar 10, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Mar 9, 2021

The documentation of the --project-type flag promises that subprojects will also be discovered:

--project-type string      Only lint projects of the specified type and their subprojects. Can be {sketch|library|platform|all}. (default "all")

Under a specific combination of configurations a bug caused subprojects to not be discovered:

  • --project-type flag set to specific project type.
  • --recursive flag not used.
  • PROJECT_PATH is a folder (rather than file).

So, for example, given this project structure:

FooLibrary
|-- examples
|   `-- FooExample
|       `-- FooExample.ino
|-- src
|   `-- FooLibrary.h
`-- library.properties

The following command only linted the library, and not the FooExample sketch:

arduino-lint --project-type library FooLibrary

Under any other configuration, subprojects were discovered and the FooExample sketch would be linted in the above example.

per1234 added 2 commits March 9, 2021 15:01
The documentation of the `--project-type` flag promises that subprojects will also be discovered:

```
--project-type string      Only lint projects of the specified type and their subprojects. Can be {sketch|library|platform|all}. (default "all")
```

Under a specific combination of configurations a bug caused subprojects to not be discovered:

- `--project-type` flag set to specific project type.
- `--recursive` flag not used.
- `PROJECT_PATH` is a folder (rather than file).

So, for example, given this project structure:

FooLibrary
|-- examples
|   `-- FooExample
|       `-- FooExample.ino
|-- src
|   `-- FooLibrary.h
`-- library.properties

The following command only linted the library, and not the FooExample sketch:

```
arduino-lint --project-type library FooLibrary
```

Under any other configuration, subprojects were discovered and the FooExample sketch would be linted in the above example.
Subproject discovery must be done under any circumstances. Previously, there was duplicate code to do this for both file project paths and folder project paths, resulting in the code being more difficult to maintain.

In order to accomodate this change, the error message in the event of no projects being discovered was reworded to be applicable to either project path type.
@per1234 per1234 added type: bug priority: high Resolution is a high priority topic: code Related to content of the project itself labels Mar 9, 2021
@per1234 per1234 requested a review from silvanocerza March 9, 2021 23:12
@codecov-io
Copy link

Codecov Report

Merging #167 (8e5f33a) into main (37a8a38) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #167      +/-   ##
==========================================
+ Coverage   84.27%   84.30%   +0.02%     
==========================================
  Files          43       43              
  Lines        2957     2956       -1     
==========================================
  Hits         2492     2492              
+ Misses        373      372       -1     
  Partials       92       92              
Flag Coverage Δ
unit 84.30% <100.00%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
internal/project/project.go 93.87% <100.00%> (+0.63%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 37a8a38...8e5f33a. Read the comment docs.

@per1234 per1234 merged commit e04c6fa into arduino:main Mar 10, 2021
@rsora rsora added the type: imperfection Perceived defect in any part of project label Sep 22, 2021
@rsora rsora added criticality: high Of high impact and removed priority: high Resolution is a high priority labels Nov 2, 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
criticality: high Of high impact 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.

None yet

4 participants