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

fedora-llvm-team / llvm-snapshots / 14795010914

02 May 2025 12:16PM UTC coverage: 58.86% (+0.02%) from 58.84%
14795010914

push

github

web-flow
Add mypy, autoflake and ruff pre-commit checks (#1331)

* Add mypy pre-commit hook

This adds mypy, autoflake, and ruff as a pre-commit check and addresses all the complaints it
has. This solved a lot of real issues plus some boilerplate.

* Add autoflake pre-commit hook

This adds autoflake as a pre-commit check and addresses all the complaints it has.

* Add ruff pre-commit hook

This adds ruff as a pre-commit check and addresses all the complaints it has. This solved a lot of real issues plus some boilerplate.

Other commits:

* Provide tests with secret
* Remove unused kwargs
* Deal with cases in which the XML attribute lookup is None
* [pre-commit] autoupdate
* Fix: [WARNING] Unexpected key(s) present on https://github.com/psf/black-pre-commit-mirror => black: force-exclude
* Annotate test fixtures
* Remove premature github label cache
* Add annotation to load-tests protocol
* Add comment about munch.Munch not being typed https://github.com/Infinidat/munch/issues/84
* Annotate subparsers parameters
* Remove unused session_headers property from GithubGraphQL

176 of 234 new or added lines in 21 files covered. (75.21%)

18 existing lines in 7 files now uncovered.

1239 of 2105 relevant lines covered (58.86%)

0.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

21.21
/scripts/upload-source-snapshots.py
1
#!/bin/env python3
2

3
import argparse
1✔
4
import datetime
1✔
5
import os
1✔
6
from glob import glob
1✔
7

8
from github import Github, UnknownObjectException
1✔
9

10

11
def main(args: argparse.Namespace) -> None:
1✔
12
    g = Github(login_or_token=args.token)
×
13
    repo = g.get_repo(args.project)
×
14

15
    yyyymmdd = args.yyyymmdd
×
16
    release_name = args.release_name
×
17
    tag_name = release_name
×
18
    print(f"uploading assets for yyyymmdd='{yyyymmdd}'")
×
19
    try:
×
20
        release = repo.get_release(release_name)
×
NEW
21
    except UnknownObjectException:
×
22
        print(f"release '{release_name}' not found but creating it now")
×
23
        release = repo.create_git_release(
×
24
            prerelease=True,
25
            name=release_name,
26
            draft=False,
27
            tag=tag_name,
28
            message="daily updated source-snapshots",
29
        )
30
    else:
31
        dir = os.getenv(key="GITHUB_WORKSPACE", default=".")
×
32
        print(f"looking for source snapshots in directory: {dir}")
×
33
        glob_patterns = [
×
34
            "*-{}.src.tar.xz",
35
            "llvm-release-{}.txt",
36
            "llvm-rc-{}.txt",
37
            "llvm-git-revision-{}.txt",
38
        ]
39
        for pattern in glob_patterns:
×
40
            for name in glob(pattern.format(yyyymmdd)):
×
41
                path = os.path.join(dir, name)
×
42
                print(f"uploading path: {path}")
×
43
                release.upload_asset(path=path)
×
44

45

46
if __name__ == "__main__":
1✔
47
    yyyymmdd = datetime.date.today().strftime("%Y%m%d")
×
48
    parser = argparse.ArgumentParser(
×
49
        description="Uploads the source snapshots as assets"
50
    )
51
    parser.add_argument(
×
52
        "--token",
53
        dest="token",
54
        type=str,
55
        default="YOUR-TOKEN-HERE",
56
        help="your github token",
57
    )
58
    parser.add_argument(
×
59
        "--project",
60
        dest="project",
61
        type=str,
62
        default="fedora-llvm-team/llvm-snapshots",
63
        help="github project to use (default: fedora-llvm-team/llvm-snapshots)",
64
    )
65
    parser.add_argument(
×
66
        "--release-name",
67
        dest="release_name",
68
        type=str,
69
        default="source-snapshot",
70
        help="name of the release to store the source snapshots (source-snapshot)",
71
    )
72
    parser.add_argument(
×
73
        "--yyyymmdd",
74
        dest="yyyymmdd",
75
        type=str,
76
        default=yyyymmdd,
77
        help="year month day combination to filter upload files by (default for today: {})".format(
78
            yyyymmdd
79
        ),
80
    )
81

82
    main(parser.parse_args())
×
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

© 2026 Coveralls, Inc