schmittjoh / php-code-analysis

Advanced Code Analysis for PHP
23 stars 1 forks source link

Ignore automatically generated migrations #36

Open michaelcullum opened 11 years ago

michaelcullum commented 11 years ago

Clutters up the auto-changed files with migrations namespace use statements changing:

-use Doctrine\DBAL\Migrations\AbstractMigration,
6       
-    Doctrine\DBAL\Schema\Schema;
5   
+use Doctrine\DBAL\Migrations\AbstractMigration;
6   
+use Doctrine\DBAL\Schema\Schema;```

Should probably just ignore migrations files as they are automatically generated?
schmittjoh commented 11 years ago

You could either turn these fixes off for certain files,

# .jms.yml
path_configs:
    migrations:
        paths: [app/DoctrineMigrations/*]
        use_statement_fixes: false

or, you could also set it to preserve multiple statements like (use A, B;):

# .jms.yml
default_config:
    use_statement_fixes:
        preserve_multiple: true

There are some more settings in the docs: http://jmsyst.com/automated-code-reviews/docs

I'm not sure if we can do something better by default which makes everyone happy.

michaelcullum commented 11 years ago

I just thought it would be useful to the majority by default seeing as they are migrations and auto-generated.

schmittjoh commented 11 years ago

Yeah, let's keep this open.

Different default configs depending on project type is something that could be done.