{
  "$schema": "../../rulesets/schema.json",
  "version": 2,
  "axioms": {
    "linguist": "language",
    "licensee": "license",
    "packagers": "packager"
  },
  "rules": {
    "license-file-exists": {
      "level": "error",
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["LICENSE*", "COPYING*"],
          "nocase": true
        }
      }
    },
    "readme-file-exists": {
      "level": "error",
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["README*"],
          "nocase": true
        }
      }
    },
    "contributing-file-exists": {
      "level": "error",
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["{docs/,.github/,}CONTRIB*"]
        }
      }
    },
    "code-of-conduct-file-exists": {
      "level": "error",
      "rule": {
        "type": "file-existence",
        "options": {
          "files": [
            "{docs/,.github/,}CODEOFCONDUCT*",
            "{docs/,.github/,}CODE-OF-CONDUCT*",
            "{docs/,.github/,}CODE_OF_CONDUCT*"
          ]
        }
      }
    },
    "changelog-file-exists": {
      "level": "error",
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["CHANGELOG*"],
          "nocase": true
        }
      }
    },
    "security-file-exists": {
      "level": "error",
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["{docs/,.github/,}SECURITY.md"]
        }
      }
    },
    "support-file-exists": {
      "level": "error",
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["{docs/,.github/,}SUPPORT*"],
          "nocase": true
        }
      }
    },
    "readme-references-license": {
      "level": "error",
      "rule": {
        "type": "file-contents",
        "options": {
          "files": ["README*"],
          "content": "license",
          "flags": "i"
        }
      }
    },
    "binaries-not-present": {
      "level": "error",
      "rule": {
        "type": "file-type-exclusion",
        "options": {
          "type": ["**/*.exe", "**/*.dll", "!node_modules/**"]
        }
      }
    },
    "test-directory-exists": {
      "level": "error",
      "rule": {
        "type": "directory-existence",
        "options": {
          "directories": ["**/test*", "**/specs"],
          "nocase": true
        }
      }
    },
    "integrates-with-ci": {
      "level": "error",
      "rule": {
        "type": "file-existence",
        "options": {
          "files": [
            ".gitlab-ci.yml",
            ".travis.yml",
            "appveyor.yml",
            ".appveyor.yml",
            "circle.yml",
            ".circleci/config.yml",
            "Jenkinsfile",
            ".drone.yml",
            ".github/workflows/*",
            "azure-pipelines.yml"
          ]
        }
      }
    },
    "code-of-conduct-file-contains-email": {
      "level": "error",
      "rule": {
        "type": "file-contents",
        "options": {
          "files": [
            "CODEOFCONDUCT*",
            "CODE-OF-CONDUCT*",
            "CODE_OF_CONDUCT*",
            ".github/CODEOFCONDUCT*",
            ".github/CODE-OF-CONDUCT*",
            ".github/CODE_OF_CONDUCT*"
          ],
          "content": ".+@.+\\..+",
          "flags": "i",
          "human-readable-content": "email address"
        }
      }
    },
    "source-license-headers-exist": {
      "level": "warning",
      "rule": {
        "type": "file-starts-with",
        "options": {
          "files": ["**/*.js", "!node_modules/**"],
          "lineCount": 5,
          "patterns": ["Copyright", "License"],
          "flags": "i"
        }
      }
    },
    "github-issue-template-exists": {
      "level": "error",
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["ISSUE_TEMPLATE*", ".github/ISSUE_TEMPLATE*"]
        }
      }
    },
    "github-pull-request-template-exists": {
      "level": "error",
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["PULL_REQUEST_TEMPLATE*", ".github/PULL_REQUEST_TEMPLATE*"]
        }
      }
    },
    "javascript-package-metadata-exists": {
      "level": "error",
      "where": ["language=javascript"],
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["package.json"]
        }
      }
    },
    "ruby-package-metadata-exists": {
      "level": "error",
      "where": ["language=ruby"],
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["Gemfile"]
        }
      }
    },
    "java-package-metadata-exists": {
      "level": "error",
      "where": ["language=java"],
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["pom.xml", "build.xml", "build.gradle"]
        }
      }
    },
    "license-detectable-by-licensee": {
      "level": "error",
      "where": ["license=*"],
      "rule": {
        "type": "license-detectable-by-licensee",
        "options": {}
      }
    },
    "notice-file-exists": {
      "level": "error",
      "where": ["license=Apache-2.0"],
      "rule": {
        "type": "apache-notice",
        "options": {}
      }
    },
    "python-package-metadata-exists": {
      "level": "error",
      "where": ["language=python"],
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["setup.py", "requirements.txt"]
        }
      }
    },
    "objective-c-package-metadata-exists": {
      "level": "error",
      "where": ["language=objective-c"],
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["Cartfile", "Podfile", "*.podspec"]
        }
      }
    },
    "swift-package-metadata-exists": {
      "level": "error",
      "where": ["language=swift"],
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["Package.swift"]
        }
      }
    },
    "erlang-package-metadata-exists": {
      "level": "error",
      "where": ["language=erlang"],
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["rebar.config"]
        }
      }
    },
    "elixir-package-metadata-exists": {
      "level": "error",
      "where": ["language=elixir"],
      "rule": {
        "type": "file-existence",
        "options": {
          "files": ["mix.exs"]
        }
      }
    }
  }
}
