• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

google / sedpack / 11658389015
89%

Build:
DEFAULT BRANCH: main
Ran 04 Nov 2024 05:08AM UTC
Jobs 1
Files 63
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Nov 2024 09:27AM UTC coverage: 86.417% (-0.005%) from 86.422%
11658389015

push

github

web-flow
modernize typehints (#52)

Closes #49 

Used python script to automate changes:

```python
import re
from pathlib import Path

project_dir = Path("path")

optional_pattern = re.compile(r"Optional\[(.+)\]")

def replace_optional(match):
    '''Replace "Optional[...]" with "... | None"'''
    content = match.group(1)
    bracket_count = 0
    end_index = -1

    for i, char in enumerate(content):
        if char == '[':
            bracket_count += 1
        elif char == ']':
            bracket_count -= 1
            if bracket_count == 0:
                end_index = i
                break

    if end_index != -1:
        return f"{content[:end_index + 1]} | None{content[end_index + 1:]}"
    else:
        return f"{content} | None"  

patterns = [
    (re.compile(r"\bList\b"), "list"),
    (re.compile(r"\bDict\b"), "dict"),
    (re.compile(r"\bTuple\b"), "tuple"),
]


for filepath in project_dir.rglob("*.py"):
    with open(filepath, "r", encoding="utf-8") as file:
        content = file.read()
    
    content = optional_pattern.sub(replace_optional, content)

    for pattern, replacement in patterns:
        content = pattern.sub(replacement, content)

    with open(filepath, "w", encoding="utf-8") as file:
        file.write(content)
```

---------

Co-authored-by: kralka <kralkareliv@gmail.com>

11 of 11 new or added lines in 6 files covered. (100.0%)

2284 of 2643 relevant lines covered (86.42%)

0.86 hits per line

Jobs
ID Job ID Ran Files Coverage
1 11658389015.1 04 Nov 2024 05:08AM UTC 63
86.42
GitHub Action Run
Source Files on build 11658389015
  • Tree
  • List 63
  • Changed 8
  • Source Changed 8
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #11658389015
  • 65fc0597 on github
  • Prev Build on main (#11593962917)
  • Next Build on main (#11772477137)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc