Skip to content

package_api_docs: fix or remove? #57310

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
pylaligand opened this issue Apr 1, 2016 · 11 comments
Closed

package_api_docs: fix or remove? #57310

pylaligand opened this issue Apr 1, 2016 · 11 comments
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-linter Issues with the analyzer's support for the linter package linter-false-negative P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) type-question A question about expected behavior or functionality

Comments

@pylaligand
Copy link
Contributor

Here's a simple package:

my_package
    - pubspec.yaml
    - .analysis_options
    - lib
        - class.dart 

with .analysis_options:

linter:
  rules:
    - always_declare_return_types
    - package_api_docs

and class.dart:

class ThisIsATest {
  returnSomething() {
    return 314;
  }
}

If I run the analyzer, I don't get any lint for the lack of documentation:

$ dartanalyzer lib/*.dart
Analyzing [lib/class.dart]...
[lint] Declare method return types. (/work/turquoise/sysui/src/toto/lib/class.dart, line 2, col 3)
1 lint found.

$ dartanalyzer --version
dartanalyzer version 1.15.0

Based on the documentation, I would expect to get a message about ThisIsATest and returnSomething.

@zoechi
Copy link
Contributor

zoechi commented Apr 4, 2016

I guess you need

$ dartanalyzer lib/*.dart --lints

@pylaligand
Copy link
Contributor Author

It seems that --lints is implicit when the options file defines some lint rules. As you can see above, the output of my call to dartanalyzer does contain a lint - I put an additional lint rule precisely to show that lints were being processed.

@kevmoo kevmoo added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Mar 16, 2018
@kevmoo
Copy link
Member

kevmoo commented Mar 16, 2018

I'm hitting this now. package_api_docs seems to do nothing.

As of 2.0.0-dev.39.0

@devoncarew
Copy link
Member

What is package_api_docs supposed to do vs. public_member_api_docs?

@kevmoo
Copy link
Member

kevmoo commented Mar 18, 2018 via email

@srawlins
Copy link
Member

Since we've overhauled the command line process for linting (maybe twice), I think this bug is stale. Please re-open if you hit this again.

@leventkantaroglu
Copy link

Is there any working example of this rule? I couldn't get any message for this rule.

@pq
Copy link
Member

pq commented Aug 16, 2024

You're right. This lint is not working. Now that we have workspace support it could be fixed. Alternatively we should deprecate it and remove it. Sorry for the confusion!

See also: #58385

@leventkantaroglu
Copy link

I think this package_api_docs lint is necessary for packages. Because public_member_api_docs has no option to ignore src folder.

@pq pq changed the title package_api_docs not working as expected package_api_docs is not working as expected Aug 16, 2024
@pq pq reopened this Aug 16, 2024
@pq pq added the P2 A bug or feature request we're likely to work on label Aug 16, 2024
@pq
Copy link
Member

pq commented Aug 16, 2024

Re-opening so we can decide whether to fix or remove.

Thanks for the nudge @leventkantaroglu!

@pq pq changed the title package_api_docs is not working as expected package_api_docs: fix or remove? Aug 16, 2024
@pq pq added the type-question A question about expected behavior or functionality label Aug 16, 2024
@devoncarew devoncarew added devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. labels Nov 18, 2024
@devoncarew devoncarew transferred this issue from dart-archive/linter Nov 18, 2024
@bwilkerson bwilkerson added the area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. label Feb 21, 2025
@bwilkerson bwilkerson removed the legacy-area-analyzer Use area-devexp instead. label Feb 21, 2025
@srawlins
Copy link
Member

It's been removed.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-linter Issues with the analyzer's support for the linter package linter-false-negative P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) type-question A question about expected behavior or functionality
Projects
None yet
Development

No branches or pull requests

8 participants