Daniel Fütterer
28.05.21 b2e7285431fd668e5c6ea529b6ac941241672b97
feat: new sorting of types and no-scope commits

feat, fix, other, nonconform. commits without scopes at last
1 files modified
12 ■■■■■ changed files
oop_changelog_scope.py 12 ●●●●● patch | view | raw | blame | history
oop_changelog_scope.py
@@ -167,7 +167,7 @@
    # Grouping by Type
    commitsByType = {"Other":[], "Features":[], "Fixes":[]}
    commitsByType = {"Other":[], "Fixes":[], "Features":[]}
    nonconformCommits = []
    for commit in tag[1:]:
        if commit.body.commitType == CommitBody.commitTypes[5]: # fix
@@ -183,15 +183,13 @@
    while len(commitsByType) > 0:
        commitsByScope = {}
        commitType, commits = commitsByType.popitem()
        noScope = []
        if len(commits) == 0:
            continue
        for commit in commits:
            if commit.body.scope == None:
                if "no scope" not in commitsByScope:
                    commitsByScope["no scope"] = [commit]
                else:
                    commitsByScope["no scope"].append(commit)
                noScope.append(commit)
            elif commit.body.scope in commitsByScope:
                commitsByScope[commit.body.scope].append(commit)
            else:
@@ -206,6 +204,10 @@
                    fileTemplate.append("    - (" + commit.body.commitType + ") " + commit.body.subject + commit.appendShortHash())
                else:
                    fileTemplate.append("    - " + commit.body.subject + commit.appendShortHash())
        if len(noScope) > 0:
            fileTemplate.append("- *no scope*")
        for commit in noScope:
            fileTemplate.append("    - " + commit.body.subject + commit.appendShortHash())
    
    # nonconform commits
    if len(nonconformCommits) > 0: