k1LoW / tbls

tbls is a CI-Friendly tool for document a database, written in Go.
MIT License
3.32k stars 164 forks source link

Lint rule "requireViewpoints" #516

Closed majimaccho closed 9 months ago

majimaccho commented 9 months ago

Hi I'm a big fun of tbls and in love with viewpoints feature:heart: It's really helpful to communicate with team outside and even my self in the future.

I define the viewpoints like aggregates in DDD context. So basically all the tables are expected to be in some viewpoints of tbls.

However, it's really easy to forget to add viewpoints when my team adds tables. I want to prevent this by adding lint rule which require all the tables to be in at least one viewpoint.

The config format should be similar to requireTableComment but allOrNothing is not needed in this case, I suppose.

# require table is included in at least one viewpoint
requireViewpoints:
    enabled: true
    exclude: 
        - tmp_data    
k1LoW commented 9 months ago

@macoto1995 I think it is a very good idea! Thank you!