diff options
author | Jack Lloyd <[email protected]> | 2017-09-19 14:02:49 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-09-19 14:02:49 -0400 |
commit | ab543f29cc6c7aa79f9d3aefc93faae965c36bd4 (patch) | |
tree | 507fcfa20a8d30b929b8093cca4f819328dcfd04 | |
parent | 0c77c98feda95c109ed780b767aca6aad1c14dc7 (diff) |
Move config files to src/configs
-rw-r--r-- | .editorconfig | 12 | ||||
-rw-r--r-- | doc/contributing.rst | 12 | ||||
-rw-r--r-- | src/configs/astyle.rc (renamed from .astylerc) | 0 | ||||
-rw-r--r-- | src/configs/coverage.rc (renamed from .coveragerc) | 0 | ||||
-rw-r--r-- | src/configs/indent.el (renamed from src/scripts/indent.el) | 0 | ||||
-rw-r--r-- | src/configs/pylint.rc (renamed from .pylintrc) | 0 | ||||
-rwxr-xr-x | src/scripts/ci_build.py | 24 |
7 files changed, 20 insertions, 28 deletions
diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index d89f4d8b4..000000000 --- a/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -# See http://editorconfig.org/ - -root = true - -[*] -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -[*.py] -indent_style = space -indent_size = 4 diff --git a/doc/contributing.rst b/doc/contributing.rst index 092fe2fcd..60091ae13 100644 --- a/doc/contributing.rst +++ b/doc/contributing.rst @@ -11,6 +11,7 @@ Under ``src`` there are directories example ``build-data/cc/gcc.txt`` describes various gcc options. * ``scripts`` contains misc scripts: install, distribution, various codegen things. Scripts controlling CI go under ``scripts/ci``. +* ``configs`` contains configuration files for emacs, astyle, pylint, etc * ``python/botan2.py`` is the Python ctypes wrapper Library Layout @@ -140,9 +141,6 @@ a change in a new year not covered by your existing statement, add the year. Even if the years you are making the change are consecutive, avoid year ranges: specify each year separated by a comma. -Also if you are a new contributor or making an addition in a new year, include -an update to ``license.txt`` in your PR. - Style Conventions ======================================== @@ -172,18 +170,18 @@ introducing a new type that is not intended for derivation, mark it ``final``. Use ``m_`` prefix on all member variables. -A formatting setup for emacs is included in `scripts/indent.el` but the basic -formatting style should be obvious. No tabs, and remove trailing whitespace. +For formatting, there are configs for emacs and astyle in ``src/configs``. +No tabs, and remove trailing whitespace. Prefer using braces on both sides of if/else blocks, even if only using a single statement. The current code doesn't always do this. Avoid ``using namespace`` declarations, even inside of single functions. One allowed exception is ``using namespace std::placeholders`` in functions which -use ``std::bind``. +use ``std::bind``. (But, don't use ``std::bind`` - use a lambda instead). Use ``::`` to explicitly refer to the global namespace (eg, when calling an OS -or library function like ``::select`` or ``::sqlite3_open``). +or external library function like ``::select`` or ``::sqlite3_open``). Use of External Dependencies ======================================== diff --git a/.astylerc b/src/configs/astyle.rc index dd2c7a35d..dd2c7a35d 100644 --- a/.astylerc +++ b/src/configs/astyle.rc diff --git a/.coveragerc b/src/configs/coverage.rc index d93af43e2..d93af43e2 100644 --- a/.coveragerc +++ b/src/configs/coverage.rc diff --git a/src/scripts/indent.el b/src/configs/indent.el index 7fa2540b0..7fa2540b0 100644 --- a/src/scripts/indent.el +++ b/src/configs/indent.el diff --git a/.pylintrc b/src/configs/pylint.rc index 546de8f37..546de8f37 100644 --- a/.pylintrc +++ b/src/configs/pylint.rc diff --git a/src/scripts/ci_build.py b/src/scripts/ci_build.py index d2b83fd5e..27ffc9f3c 100755 --- a/src/scripts/ci_build.py +++ b/src/scripts/ci_build.py @@ -213,7 +213,7 @@ def run_cmd(cmd, root_dir): time_taken = int(time.time() - start) - if time_taken > 2: + if time_taken > 10: print("Ran for %d seconds" % (time_taken)) if proc.returncode != 0: @@ -344,6 +344,14 @@ def main(args=None): if not use_python2 and not use_python3: raise Exception('No python interpreters found cannot lint') + pylint_rc = '--rcfile=%s' % (os.path.join(root_dir, 'src/configs/pylint.rc')) + pylint_flags = [pylint_rc, '--reports=no', '--score=no'] + + # Some disabled rules specific to Python2 + # superfluous-parens: needed for Python3 compatible print statements + # too-many-locals: variable counting differs from pylint3 + py2_flags = '--disable=superfluous-parens,too-many-locals' + py_scripts = [ 'configure.py', 'src/python/botan2.py', @@ -356,14 +364,10 @@ def main(args=None): target_path = os.path.join(root_dir, target) if use_python2: - # Some disabled rules specific to Python2 - # superfluous-parens: needed for Python3 compatible print statements - # too-many-locals: variable counting differs from pylint3 - py2_flags = '--disable=superfluous-parens,too-many-locals' - cmds.append(['python2', '-m', 'pylint', py2_flags, target_path]) + cmds.append(['python2', '-m', 'pylint'] + pylint_flags + [py2_flags, target_path]) if use_python3: - cmds.append(['python3', '-m', 'pylint', target_path]) + cmds.append(['python3', '-m', 'pylint'] + pylint_flags + [target_path]) else: config_flags, run_test_command, make_prefix = determine_flags( @@ -441,14 +445,16 @@ def main(args=None): cmds.append(['lcov', '--list', cov_file]) if have_prog('coverage'): - cmds.append(['coverage', 'run', '--branch', botan_py]) + cmds.append(['coverage', 'run', '--branch', + '--rcfile', os.path.join(root_dir, 'src/configs/coverage.rc'), + botan_py]) if have_prog('codecov'): # If codecov exists assume we are on Travis and report to codecov.io cmds.append(['codecov']) else: # Otherwise generate a local HTML report - cmds.append(['genhtml', 'cov.info', '--output-directory', 'lcov-out']) + cmds.append(['genhtml', cov_file, '--output-directory', 'lcov-out']) for cmd in cmds: if options.dry_run: |