GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add initial version of the generated Danger model · nitheesh-me/python@09f9670

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • danger_python
    • danger.py
    • models.py
    • shell.py
  • tests
    • test_model.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎danger_python/danger.py‎

Copy file name to clipboardExpand all lines: danger_python/danger.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from pydantic import BaseModel
88
from pydantic.dataclasses import dataclass
99

10-
from .models import DangerDSL, GitDSL, GithubDSL
10+
from .models import DangerDSLJSONType, GitHubDSL, GitJSONDSL
1111

1212

1313
class Violation(BaseModel):
@@ -35,12 +35,12 @@ def serialize_results(results: DangerResults) -> Dict[str, Any]:
3535
return results.dict(exclude_none=True, by_alias=True)
3636

3737

38-
def load_dsl() -> DangerDSL:
38+
def load_dsl() -> DangerDSLJSONType:
3939
file_url = sys.stdin.read().split("danger://dsl/")[-1]
4040

4141
with open(file_url, "r") as json_file:
4242
input_json = json.loads(json_file.read())
43-
return DangerDSL(**input_json["danger"])
43+
return DangerDSLJSONType(**input_json["danger"])
4444

4545

4646
class Danger:
@@ -50,15 +50,15 @@ def __init__(self):
5050
if not Danger.results:
5151
Danger.results = DangerResults()
5252

53-
dsl: DangerDSL = None
53+
dsl: DangerDSLJSONType = None
5454
results: DangerResults = None
5555

5656
@property
57-
def git(self) -> GitDSL:
57+
def git(self) -> GitJSONDSL:
5858
return Danger.dsl.git
5959

6060
@property
61-
def github(self) -> GithubDSL:
61+
def github(self) -> GitHubDSL:
6262
return Danger.dsl.github
6363

6464

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.