How to prevent a Java project from building when TODO present

前端 未结 3 1045
挽巷
挽巷 2021-01-24 02:33

Recently code containing a debugging override was release to production. The code was clearly marked

// TODO - Remove before releasing to production

<
3条回答
  •  死守一世寂寞
    2021-01-24 02:52

    I'm using maven checkstyle plugin:

    
        org.apache.maven.plugins
        maven-checkstyle-plugin
        2.15
        
            
                validate
                validate
                
                    src/main/resources/config/checkstyle.xml
                    UTF-8
                    true
                    false
                    false
                
                
                    check
                
            
        
    
    

    The configuration file should contain a TodoComment module This will prevent from building a code with "TODO" comments inside. You can configure it so that it looks at other comment regexps, like "FIXME" or something. Here you have more details.

提交回复
热议问题