issues:
  exclude-rules:
    - linters:
        - unparam
      text: "always receives"
  max-per-linter: 0
  max-same-issues: 0

linters:
  disable-all: true
  enable:
    - asciicheck
    - errcheck
    - exportloopref
    - gocritic
    - gofmt
    - gomnd
    - gosimple
    - ineffassign
    - makezero
    - misspell
    - nakedret
    - nilerr
    - nolintlint
    - staticcheck
    - stylecheck
    - typecheck
    - unconvert
    - unparam
    - unused
    - vet
    - vetshadow
    - whitespace

linters-settings:
  errcheck:
    ignore: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema:ForceNew|Set,fmt:.*,io:Close
  gocritic:
    enabled-tags:
      - diagnostic
    disabled-tags:
      - style
      - performance
      - experimental
      - opinionated
  gomnd:
    settings:
      mnd:
        checks:
          - argument
        ignored-functions:
          # AWS Go SDK
          - aws.Int64
          - request.ConstantWaiterDelay
          - request.WithWaiterMaxAttempts
          # AWS Provider
          - nullable.*
          - tfresource.With*
          # Terraform Plugin SDK
          - resource.Retry
          - schema.DefaultTimeout
          - validation.*
          # Terraform Plugin Framework
          - int64validator.*
          # Go
          - make
          - strconv.FormatFloat
          - strconv.FormatInt
          - strconv.ParseFloat
          - strconv.ParseInt
          - strings.SplitN
  nolintlint:
    allow-unused: false
    allow-leading-space: false
    require-explanation: true
    require-specific: true
    allow-no-explanation:
      - unparam
      - gomnd
  staticcheck:
    checks: ["all", "-SA1019"]
  stylecheck:
    checks: ["all", "-ST1005", "-ST1003"]
    initialisms: ["ACL", "ACM", "ACMPCA", "ACMPCA", "AMI", "API", "APIGateway", "AppConfig", "AppMesh", "AppSync", "ARN", "ASG", "ASN", "AutoScaling", "BGP", "BYOIP", "CIDR", "CloudFormation", "CloudFront", "CloudWatch", "CMK", "CNAME", "CoIP", "CPU", "CSS", "CSV", "DAX", "DB", "DHCP", "DKIM", "DLM", "DMS", "DNS", "DNSSEC", "DocDB", "DocDB", "DynamoDB", "DynamoDB", "EBS", "EC2", "ECMP", "ECR", "ECS", "EFS", "EIP", "EKS", "ElastiCache", "Elasticsearch", "ELB", "EMR", "FIFO", "FMS", "FQDNS", "FSx", "FSx", "GameLift", "GCM", "GP2", "GP3", "GraphQL", "GRPC", "GuardDuty", "HAProxy", "HSM", "HTTP", "HTTPS", "HVM", "IAM", "IoT", "IP", "IPAM", "IPSet", "iSCSI", "JDBC", "JSON", "KMS", "MFA", "MSK", "MWAA", "MySQL", "NFS", "OAuth", "OIDC", "OpsWorks", "PHP", "PITR", "POSIX", "PreCheck", "QLDB", "RabbitMQ", "RDS", "RFC", "SageMaker", "SASL", "SFN", "SMB", "SMS", "SMTP", "SNS", "SQL", "SQS", "SSH", "SSL", "SSM", "SSO", "STS", "SWF", "TCP", "TLS", "TTL", "URI", "URL", "VGW", "VoIP", "VPC", "VPN", "WAF", "WAFV2", "WorkGroup", "WorkLink", "WorkSpaces", "XRay", "XSS", "YAML"]

run:
  timeout: 75m
  go: 1.18
  skip-dirs:
    - .ci/providerlint/vendor
