-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathdependencies.py
More file actions
52 lines (38 loc) · 1.35 KB
/
Copy pathdependencies.py
File metadata and controls
52 lines (38 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# DU: Dependency Updating
from __future__ import annotations
from typing import Any
from . import mk_url
class Dependencies:
family = "dependencies"
class DEP200(Dependencies):
"""Maintained by Dependabot or Renovate."""
url = mk_url("gha-basic")
@staticmethod
def check(dependabot: dict[str, Any], renovate: dict[str, Any]) -> bool:
"""
All projects should have a tool to manage dependencies, either Dependabot or Renovate.
Something like one of these:
`.github/dependabot.yml`
```yaml
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
```
`renovate.json`
```json
{{
"extends": ["config:recommended"]
}}
```
Renovate configurations in `package.json` are not supported.
`.jsonc` files (and `.json5` files that only use comments or trailing
commas) are supported out of the box. Full JSON5 configs require the
optional `json5` dependency (`pip install sp-repo-review[json5]`).
"""
return bool(dependabot or renovate)
def repo_review_checks() -> dict[str, Dependencies]:
return {p.__name__: p() for p in Dependencies.__subclasses__()}