annotate_models icon indicating copy to clipboard operation
annotate_models copied to clipboard

Disable annotations of factories and specs in the entire project

Open jedrekdomanski opened this issue 4 years ago • 1 comments

The docs says

To annotate just your models:

annotate --models

but in fact this commands annotates models AND factories and specs unless you specify -exclude... option which is confusing. I'd like to be able to disable annotations of factories and specs in the entire project in an initializer (not with an env var) so that running annotate --models annotates just models as it should.

Commands

$ annotate --models

Version

  • annotate (3.1.1)
  • rails version 6.1.4
  • ruby version 2.6.5

jedrekdomanski avatar Oct 08 '21 07:10 jedrekdomanski

In lib/tasks/auto_annotate_models.rake, you can put

    Annotate.set_defaults(
      ...,
      'exclude_tests' => 'true',
      'exclude_fixtures' => 'true',
      'exclude_factories' => 'true',
      'exclude_serializers' => 'true',
      ...
    )

(all of them are false by default).

alexeyr-ci1 avatar Jul 05 '22 19:07 alexeyr-ci1