Skip to content

Commit

Permalink
[refactor] Use Python3 enums
Browse files Browse the repository at this point in the history
  • Loading branch information
csordasmarton committed Apr 28, 2021
1 parent 426e2de commit 2c09fee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions analyzer/codechecker_analyzer/analyzers/config_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


from abc import ABCMeta
from enum import Enum
from operator import itemgetter
import collections
import platform
Expand All @@ -32,8 +33,7 @@
# disabled on the command-line, or belongs to a profile explicitly disabled
# on the command-line, then it is considered to have a CheckerState of
# disabled.
# TODO: Use enum when upgrading to Python3.
class CheckerState(object):
class CheckerState(Enum):
default = 0
disabled = 1
enabled = 2
Expand Down
3 changes: 2 additions & 1 deletion analyzer/codechecker_analyzer/buildlog/log_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from collections import defaultdict
# pylint: disable=no-name-in-module
from distutils.spawn import find_executable
from enum import Enum

import glob
import json
Expand Down Expand Up @@ -1200,7 +1201,7 @@ def default(self, o):
return json.JSONEncoder.default(self, o)


class CompileActionUniqueingType(object):
class CompileActionUniqueingType(Enum):
NONE = 0 # Full Action text
SOURCE_ALPHA = 1 # Based on source file, uniqueing by
# on alphanumerically first target
Expand Down
3 changes: 2 additions & 1 deletion web/server/codechecker_server/api/report_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import base64
from collections import defaultdict
from datetime import datetime, timedelta
from enum import Enum
import os
import re
import shlex
Expand Down Expand Up @@ -67,7 +68,7 @@
GEN_OTHER_COMPONENT_NAME = "Other (auto-generated)"


class CommentKindValue(object):
class CommentKindValue(Enum):
USER = 0
SYSTEM = 1

Expand Down

0 comments on commit 2c09fee

Please sign in to comment.