from coalib.bearlib.abstractions.Lint import Lint
from coalib.bears.LocalBear import LocalBear


class CSSAutoPrefixBear(Lint, LocalBear):
    executable = "postcss"
    arguments = "--use autoprefixer {filename}"
    prerequisite_command = ['postcss', '--use', 'autoprefixer']
    prerequisite_fail_msg = "Autoprefixer is not installed."
    diff_message = "Add vendor prefixes to CSS rules."
    gives_corrected = True
    LANGUAGES = "CSS"

    def run(self, filename, file):
        '''
        This bear adds vendor prefixes to CSS rules using ``autoprefixer``
        utility.
        '''
        return self.lint(filename, file)

@@ -30,24 +30,26 @@
 ons.Lint
+er
  import 
 Lint%0Afro
@@ -44,106 +44,25 @@
 ort 
-Lint%0Afrom coalib.bears.LocalBear import LocalBear%0A%0A%0Aclass CSSAutoPrefixBear(Lint, LocalBear):%0A    
+linter%0A%0A%0A@linter(
 exec
@@ -71,73 +71,121 @@
 able
- = %22
+='
 postcss
-%22%0A    arguments = %22--use autoprefixer %7Bfilename%7D%22%0A
+',%0A        output_format='corrected',%0A        diff_message='Add vendor prefixes to CSS rules.',%0A  
     
+  
 prer
@@ -197,19 +197,23 @@
 ite_
+check_
 command
- = %5B
+=(
 'pos
@@ -246,14 +246,19 @@
 xer'
-%5D%0A
+),%0A 
     
+   
 prer
@@ -270,20 +270,28 @@
 ite_
-fail_msg = %22
+check_fail_message='
 Auto
@@ -320,166 +320,44 @@
 led.
-%22%0A    diff_message = %22Add vendor prefixes to CSS rules.%22%0A    gives_corrected = True%0A    LANGUAGES = %22CSS%22%0A%0A    def run(self, filename, file):%0A        '''%0A    
+')%0Aclass CSSAutoPrefixBear:%0A    %22%22%22%0A
     
@@ -422,24 +422,16 @@
 efixer%60%60
-%0A       
  utility
@@ -440,40 +440,77 @@
     
-    '''%0A        return self.li
+%22%22%22%0A    LANGUAGES = %22CSS%22%0A%0A    @staticmethod%0A    def create_argume
 nt
+s
 (fil
@@ -520,10 +520,73 @@
 me, file
-)
+, config_file):%0A        return '--use', 'autoprefixer', filename
 %0A

Refactor to Linter v2 API