Is golangci-lint detecting my auto-generated files? Is there a FAQ or docs?
              
              #2233
            
            
              
                
                  
                  
                    Answered
                  
                  by
                    ldez
                  
              
          
                  
                    
                      frederikhors
                    
                  
                
                  asked this question in
                Q&A
              
            -
| I'm using gqlgen and I have many big auto-generated files. Each  Is  I wanna exclude those files from scanning. | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            ldez
          
      
      
        Sep 14, 2021 
      
    
    Replies: 1 comment 2 replies
-
| Hello, you can use  https://golangci-lint.run/usage/configuration/#config-file run:
  # which dirs to skip: issues from them won't be reported;
  # can use regexp here: generated.*, regexp is applied on full path;
  # default value is empty list, but default dirs are skipped independently
  # from this option's value (see skip-dirs-use-default).
  # "/" will be replaced by current OS file path separator to properly work
  # on Windows.
  skip-dirs:
    - src/external_libs
    - autogenerated_by_my_lib
  # default is true. Enables skipping of directories:
  #   vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
  skip-dirs-use-default: true
  # which files to skip: they will be analyzed, but issues from them
  # won't be reported. Default value is empty list, but there is
  # no need to include all autogenerated files, we confidently recognize
  # autogenerated files. If it's not please let us know.
  # "/" will be replaced by current OS file path separator to properly work
  # on Windows.
  skip-files:
    - ".*\\.my\\.go$"
    - lib/bad.go | 
Beta Was this translation helpful? Give feedback.
                  
                    2 replies
                  
                
            
      Answer selected by
        frederikhors
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Hello,
you can use
skip-dirsorskip-files.https://golangci-lint.run/usage/configuration/#config-file