dart-lang / pana

Package ANAlysis for Dart
https://pub.dev/packages/pana
BSD 3-Clause "New" or "Revised" License
207 stars 44 forks source link

Examples aren't detected in package:rfw #971

Closed Hixie closed 11 months ago

Hixie commented 3 years ago

https://pub.dev/packages/rfw/score claims that there's example, but there's four of them, and they follow the structure described in https://dart.dev/tools/pub/package-layout#examples.

isoos commented 3 years ago

As the linked package layout page describes, we have a fair number of file names that we detect as example file, and package:rfw doesn't have any of them. In such cases where the example folder has multiple sub-folders, we suggest to use the example/README.md to describe the content.

On the longer term, we could also scan the subfolders, collect the readme files, concatenate them (with downscaling the header sizes), and treat them as the top-level readme. However, the order of the folders will be arbitrary, and I think if somebody had the time to write multiple example projects, it may be better for them to control the order and the presentation of it through example/README.md.

Hixie commented 3 years ago

Ah, I see. It would be good to clarify the docs to say that you have to do the bottom part even if you have more than one example. Right now it reads as if you do the bottom part if you have one example, and if you have several, you use subdirectories.

jonasfj commented 2 years ago

https://pub.dev/packages/rfw/versions/1.0.0/score

image

sigurdm commented 2 years ago

Short term: Let us have pana give a different message if the example folder exists, but we cannot detect our usual patterns of examples.

Longer term: let us have source-listings of the entire example folder. Then we can just detect presence of an example folder.

Hixie commented 2 years ago

(https://pub.dev/packages/rfw/example is what it looks like now, I added the README as suggested above.)

sigurdm commented 11 months ago

Seems to be fixed by now