Skip to content

Commit

Permalink
add __future__ imports, first step to python3
Browse files Browse the repository at this point in the history
running futurize:

futurize -w -p -a --stage1 bin config_db_migrate db_migrate docs
  libcodechecker scripts tests vendor/plist_to_html vendor/build-logger
  • Loading branch information
Gyorgy Orban committed Jun 29, 2018
1 parent 4628f4a commit a4ff4f1
Show file tree
Hide file tree
Showing 189 changed files with 785 additions and 64 deletions.
2 changes: 2 additions & 0 deletions bin/CodeChecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
Main CodeChecker script.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import argparse
import json
Expand Down
3 changes: 3 additions & 0 deletions config_db_migrate/env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from __future__ import with_statement
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from alembic import context
from sqlalchemy import engine_from_config, pool

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
Create Date: 2017-11-23 15:26:45.594141
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

# revision identifiers, used by Alembic.
revision = '150800b30447'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
Create Date: 2018-03-28 10:21:38.593302
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

# revision identifiers, used by Alembic.
revision = '4964142b58d2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
Create Date: 2018-03-13 10:44:38.446589
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

# revision identifiers, used by Alembic.
revision = '6b9f832d0b20'
Expand Down
3 changes: 3 additions & 0 deletions config_db_migrate/versions/8268fc7ca7f4_initial_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
Create Date: 2017-09-18 20:57:11.098460
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

# revision identifiers, used by Alembic.
revision = '8268fc7ca7f4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
Create Date: 2018-03-01 15:38:41.164141
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

# revision identifiers, used by Alembic.
revision = 'bb5278995f41'
Expand Down
3 changes: 3 additions & 0 deletions db_migrate/env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from __future__ import with_statement
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from alembic import context
from sqlalchemy import engine_from_config, pool

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
Create Date: 2018-03-12 15:10:24.652576
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

# revision identifiers, used by Alembic.
revision = '080349e895d7'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
Create Date: 2018-02-15 15:30:59.966552
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

# revision identifiers, used by Alembic.
revision = '101a9cb747de'
Expand Down
3 changes: 3 additions & 0 deletions db_migrate/versions/3793e361a752_source_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
Create Date: 2018-04-20 09:29:24.072720
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

# revision identifiers, used by Alembic.
revision = '3793e361a752'
Expand Down
3 changes: 3 additions & 0 deletions db_migrate/versions/4b38fa14c27b_file_id_index_for_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
Add index for the file ids in the report table to speed up
file cleanup.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

# revision identifiers, used by Alembic.
revision = '4b38fa14c27b'
Expand Down
3 changes: 3 additions & 0 deletions db_migrate/versions/82ca43f05c10_initial_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
Create Date: 2017-09-18 21:00:11.593693
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

# revision identifiers, used by Alembic.
revision = '82ca43f05c10'
Expand Down
3 changes: 3 additions & 0 deletions db_migrate/versions/dd9c97ead24_share_the_locking_of_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
Create Date: 2017-11-17 15:44:07.810579
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

# revision identifiers, used by Alembic.
revision = 'dd9c97ead24'
Expand Down
3 changes: 3 additions & 0 deletions libcodechecker/analyze/analysis_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# -------------------------------------------------------------------------
"""
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

from collections import defaultdict
import codecs
Expand Down
5 changes: 4 additions & 1 deletion libcodechecker/analyze/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"""
Prepare and start different analysis types
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import copy
from multiprocessing import Manager
Expand Down Expand Up @@ -55,7 +58,7 @@ def create_actions_map(actions, manager):
if act.source_count > 1:
LOG.debug("Multiple sources for one build action: " +
str(act.sources))
source = os.path.join(act.directory, act.sources.next())
source = os.path.join(act.directory, next(act.sources))
key = source, act.target
if key in result:
LOG.debug("Multiple entires in compile database "
Expand Down
3 changes: 3 additions & 0 deletions libcodechecker/analyze/analyzer_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# License. See LICENSE.TXT for details.
# -------------------------------------------------------------------------
""""""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import os

Expand Down
7 changes: 7 additions & 0 deletions libcodechecker/analyze/analyzers/analyzer_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
# -------------------------------------------------------------------------
"""
Base class for various source analyzers.
"""

from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

from abc import ABCMeta, abstractmethod
import os
Expand Down
3 changes: 3 additions & 0 deletions libcodechecker/analyze/analyzers/analyzer_clang_tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# -------------------------------------------------------------------------
"""
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import os
import re
Expand Down
7 changes: 7 additions & 0 deletions libcodechecker/analyze/analyzers/analyzer_clangsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
# -------------------------------------------------------------------------
"""
Clang Static Analyzer related functions.
"""

from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import os
import re
Expand Down
3 changes: 3 additions & 0 deletions libcodechecker/analyze/analyzers/analyzer_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"""
Supported analyzer types.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import os
import platform
import re
Expand Down
7 changes: 7 additions & 0 deletions libcodechecker/analyze/analyzers/config_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
# -------------------------------------------------------------------------
"""
Static analyzer configuration handler.
"""

from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

from abc import ABCMeta, abstractmethod
import collections
Expand Down
6 changes: 6 additions & 0 deletions libcodechecker/analyze/analyzers/config_handler_clang_tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
# -------------------------------------------------------------------------
"""
Config handler for Clang Tidy analyzer.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import argparse
import json
Expand Down
7 changes: 7 additions & 0 deletions libcodechecker/analyze/analyzers/config_handler_clangsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
# -------------------------------------------------------------------------
"""
Clang Static analyzer configuration handler.
"""

from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import re

Expand Down
3 changes: 3 additions & 0 deletions libcodechecker/analyze/analyzers/ctu_triple_arch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"""
Helpers for determining triple arch of a compile action
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import shlex

Expand Down
7 changes: 7 additions & 0 deletions libcodechecker/analyze/analyzers/result_handler_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
# -------------------------------------------------------------------------
"""
Result handlers to manage the output of the static analyzers.
"""

from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

from abc import ABCMeta
import hashlib
Expand Down
6 changes: 6 additions & 0 deletions libcodechecker/analyze/analyzers/result_handler_clang_tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
# -------------------------------------------------------------------------
"""
Result handler for Clang Tidy.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

from libcodechecker.analyze import tidy_output_converter
from libcodechecker.analyze.analyzers.result_handler_base \
Expand Down
3 changes: 3 additions & 0 deletions libcodechecker/analyze/ctu_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"""
Arranges the 1st phase of 2 phase executions for CTU
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import glob
import os
Expand Down
3 changes: 3 additions & 0 deletions libcodechecker/analyze/gcc_toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"""
gcc-toolchain compilation option related helper functions.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import os
import re
Expand Down
6 changes: 6 additions & 0 deletions libcodechecker/analyze/host_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
# -------------------------------------------------------------------------
"""
Check static analyzer and features on the host machine.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import errno
import subprocess
Expand Down
8 changes: 8 additions & 0 deletions libcodechecker/analyze/log_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
# -------------------------------------------------------------------------
"""
Parse the compile_commands.json file.
Get compiler specific include paths targets.
"""

from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import json
import os
Expand Down
3 changes: 3 additions & 0 deletions libcodechecker/analyze/plist_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
for Clang versions before v3.7
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

from collections import defaultdict
import math
Expand Down
6 changes: 6 additions & 0 deletions libcodechecker/analyze/pre_analysis_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
# -------------------------------------------------------------------------
"""
Run pre analysis, collect statistics or CTU data.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import multiprocessing
import os
Expand Down
3 changes: 3 additions & 0 deletions libcodechecker/analyze/skiplist_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# -------------------------------------------------------------------------
"""
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import fnmatch
import re
Expand Down
2 changes: 2 additions & 0 deletions libcodechecker/analyze/statistics_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
Calculates call statistics from analysis output
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import

from StringIO import StringIO
from collections import defaultdict
Expand Down
Loading

0 comments on commit a4ff4f1

Please sign in to comment.