Commit 421659e
committed
fix: return None instead of re-raising on invalid YAML in existing dependabot config
Fixes #523
## What
Changed build_dependabot_file() to return None instead of re-raising when an existing dependabot config has invalid YAML (e.g., duplicate keys, indentation errors). Updated existing test expectations and added a new test for the duplicate key scenario reported in the issue.
## Why
When a repository had an invalid dependabot.yml (such as a duplicate key), the YAML parse error crashed the entire program, preventing all remaining repositories from being processed. Returning None allows the caller's existing `if dependabot_file is None` check to skip the repo and continue.
## Notes
- The error message is still printed via the existing `print(f"YAML indentation error: {e}")` so users can identify which repo has a broken config.
- The second test at line 175 (indentation error) also changed from `assertRaises` to `assertIsNone` since it exercises the same code path.
Signed-off-by: jmeridth <jmeridth@gmail.com>1 parent f1a2991 commit 421659e
2 files changed
+28
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
134 | 157 | | |
135 | 158 | | |
136 | 159 | | |
| |||
152 | 175 | | |
153 | 176 | | |
154 | 177 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
159 | 182 | | |
160 | 183 | | |
161 | 184 | | |
| |||
0 commit comments