Bladeren bron

Remove legacy settings and configs

Martin Melik Merkumians 1 maand geleden
bovenliggende
commit
4aa166a192
8 gewijzigde bestanden met toevoegingen van 78 en 317 verwijderingen
  1. 61 54
      .clang-format
  2. 0 6
      .gitattributes
  3. 0 3
      .gitignore
  4. 0 56
      .travis.yml
  5. 17 21
      README.md
  6. 0 20
      TODO
  7. 0 17
      sonar-project.properties
  8. 0 140
      uncrustify.cfg

+ 61 - 54
.clang-format

@@ -1,57 +1,64 @@
 ---
-Language:        Cpp
-# BasedOnStyle:  Google
-AccessModifierOffset: -1
-ConstructorInitializerIndentWidth: 4
-AlignEscapedNewlinesLeft: true
-AlignTrailingComments: true
-AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortBlocksOnASingleLine: false
-AllowShortIfStatementsOnASingleLine: true
-AllowShortLoopsOnASingleLine: true
-AllowShortFunctionsOnASingleLine: All
-AlwaysBreakTemplateDeclarations: true
-AlwaysBreakBeforeMultilineStrings: true
-BreakBeforeBinaryOperators: false
-BreakBeforeTernaryOperators: true
-BreakConstructorInitializersBeforeComma: false
-BinPackParameters: true
-ColumnLimit:     80
-ConstructorInitializerAllOnOneLineOrOnePerLine: true
-DerivePointerAlignment: true
-ExperimentalAutoDetectBinPacking: false
-IndentCaseLabels: true
-IndentWrappedFunctionNames: false
-IndentFunctionDeclarationAfterType: false
-MaxEmptyLinesToKeep: 1
-KeepEmptyLinesAtTheStartOfBlocks: false
-NamespaceIndentation: None
-ObjCSpaceAfterProperty: false
-ObjCSpaceBeforeProtocolList: false
-PenaltyBreakBeforeFirstCallParameter: 1
-PenaltyBreakComment: 300
-PenaltyBreakString: 1000
-PenaltyBreakFirstLessLess: 120
-PenaltyExcessCharacter: 1000000
-PenaltyReturnTypeOnItsOwnLine: 200
+# Based on the Google C++ Style Guide, with user-specific overrides.
+BasedOnStyle: Google
+
+# --- User Overrides from Uncrustify Config ---
+
+# 1. Indentation
+# Google Style default is 2, but we keep the explicit setting just in case.
+# Uncrustify: indent_columns=2
+IndentWidth: 2
+
+# 2. Tabs
+# Google Style default is Never, but explicitly set here.
+# Uncrustify: indent_with_tabs=0
+UseTab: Never
+
+# 3. Column Width
+# Uncrustify: code_width=80
+ColumnLimit: 80
+
+# 4. Brace Wrapping
+# The Google Style default is already to attach braces to the line end
+# (e.g., `if (x) { ... }`).
+# Uncrustify: nl_class_brace=remove, nl_fdef_brace=remove
+# We keep the default: BreakBeforeBraces: Attach
+
+# 5. Assignment Alignment
+# This is a key deviation from the Google default, which is usually 'None'.
+# Uncrustify: indent_align_assign=true
+AlignConsecutiveAssignments: true
+
+# 6. Function Parameter Packing (Google default is to pack)
+# Uncrustify: nl_func_def_args=add (Suggests placing each arg on a new line)
+BinPackArguments: false
+BinPackParameters: false # Applies to declarations
+
+# 7. Pointer Alignment
+# Google Style prefers the star next to the type ('int* foo').
+# Uncrustify: sp_before_ptr_star=add (e.g. 'int * a;')
+# We stick to the Google default: PointerAlignment: Left (or None, which often results in Left).
 PointerAlignment: Left
-SpacesBeforeTrailingComments: 2
-Cpp11BracedListStyle: true
-Standard:        Auto
-IndentWidth:     2
-TabWidth:        8
-UseTab:          Never
-BreakBeforeBraces: Attach
-SpacesInParentheses: false
-SpacesInAngles:  false
-SpaceInEmptyParentheses: false
-SpacesInCStyleCastParentheses: false
-SpacesInContainerLiterals: true
-SpaceBeforeAssignmentOperators: true
-ContinuationIndentWidth: 4
-CommentPragmas:  '^ IWYU pragma:'
-ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
-SpaceBeforeParens: ControlStatements
-DisableFormat:   false
-...
 
+# 8. Namespace Indentation
+# Google Style default is false, matching:
+# Uncrustify: indent_namespace=false
+IndentNamespace: false
+
+# 9. Case Label Indentation
+# Google Style default is to indent `case` labels.
+# Uncrustify: indent_switch_case=2 (Suggests indenting case labels)
+IndentCaseLabels: true
+
+# 10. Operator Alignment
+# Uncrustify: align_left_shift=true
+AlignOperands: Align
+
+# 11. Newlines/Block Handling
+# Uncrustify: mod_full_brace_if=add, mod_full_brace_for=add, etc.
+# These are generally handled by Google's requirement for braces, even for single statements.
+AllowShortBlocksOnASingleLine: Never
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortCaseLabelsOnASingleLine: Never
+AllowShortFunctionsOnASingleLine: Empty
+...

+ 0 - 6
.gitattributes

@@ -1,9 +1,3 @@
-# Code formatter settings
-*.c filter=uncrustify
-*.cpp filter=uncrustify
-*.h filter=uncrustify
-*.hpp filter=uncrustify
-
 # Set the default behavior, in case people don't have core.autocrlf set.
 * text=auto
 

+ 0 - 3
.gitignore

@@ -16,8 +16,5 @@ CMakeFiles
 devicedata.h
 source/src/ports/POSIX/OpENer
 source/cip_objects/
-
 .vscode/
-
-
 build/

+ 0 - 56
.travis.yml

@@ -1,56 +0,0 @@
-language: c
-branches:
-  except:
-  - gh-pages
-env:
-  global:
-  - GH_REPO_NAME: OpENer
-  - DOXYFILE: opener.doxyfile
-  - GH_REPO_REF: github.com/EIPStackGroup/OpENer.git
-  - secure: h1vuX5cGZd5W7f5TitD+EamJIsvG2qq8aBpO9MUGIOj3bShwTaR0S0qbcpCyltXiZ9DJklLc7kP5kB0XtX1o6vZMelQsqBjiHQK5yFW0vHmFAg1sLMpVBbsAN0lMWgeGJEmyRstA1KYBixwExtc5GpcgMBvS/mnJQ10zboZNcRU=
-  - secure: CN1E5LJZwa7PLJOcst1MNb1c5Nx1rM9ifrc4llevRyTRyHxJ2S15mVQdnCvMcdPFK+ranBdsl1WcIxP3BQtI4zDwj0UWjj44EHz67VTp1o3zuaCa0fExYUwbe0D8uGRP4XbX+B4+HQWneGbabOLAZcS3Gc/pUpC3WEJO2pO2BHg=
-addons:
-  apt:
-    packages:
-    - libcap-dev
-    - lcov
-    - doxygen
-    - doxygen-doc
-    - doxygen-latex
-    - doxygen-gui
-    - graphviz
-  sonarcloud:
-    organization: eipstackgroup
-    token: $SONAR_TOKEN
-
-jobs:
-  - name: "GCC on Linux"
-    os: linux
-    dist: xenial
-    env: CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz"
-
-    install:
-      - git fetch --unshallow --tags
-      - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
-      - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
-      - |
-        mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
-        export PATH=${DEPS_DIR}/cmake/bin:${PATH}
-        cmake --version
-    before_script:
-      - $TRAVIS_BUILD_DIR/travis_scripts/linuxBeforeScript.sh
-    script:
-      - $TRAVIS_BUILD_DIR/travis_scripts/linuxScript.sh
-    after_success:
-      - $TRAVIS_BUILD_DIR/travis_scripts/linuxAfterSuccessScript.sh
-  - name: "MSVC on Windows"
-    os: windows
-    script:
-      - $TRAVIS_BUILD_DIR/travis_scripts/windowsScript.sh
-  - name: "MinGW on Windows"
-    os: windows
-    env:
-      - CC="/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/x86_64-w64-mingw32-gcc"
-      - CXX="/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/x86_64-w64-mingw32-g++"
-    script:
-      - $TRAVIS_BUILD_DIR/travis_scripts/windowsMinGWScript.sh

+ 17 - 21
README.md

@@ -1,16 +1,12 @@
-[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=EIPStackGroup_OpENer&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=EIPStackGroup_OpENer)
-[![Join the chat at https://gitter.im/EIPStackGroupOpENer/Lobby](https://badges.gitter.im/EIPStackGroupOpENer/Lobby.svg)](https://gitter.im/EIPStackGroupOpENer/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-
-
 OpENer Version 2.3.0
 ====================
 
 Welcome to OpENer!
 ------------------
 
-OpENer is an EtherNet/IP™ stack for I/O adapter devices; supports multiple 
+OpENer is an EtherNet/IP™ stack for I/O adapter devices; supports multiple
 I/O and explicit connections; includes objects and services to make EtherNet/IP™-
-compliant products defined in THE ETHERNET/IP SPECIFICATION and published by 
+compliant products defined in THE ETHERNET/IP SPECIFICATION and published by
 ODVA (http://www.odva.org).
 
 Participate!
@@ -24,8 +20,8 @@ Users mailing list: https://groups.google.com/forum/#!forum/eip-stack-group-open
 Requirements:
 -------------
 OpENer has been developed to be highly portable. The default version targets PCs
-with a POSIX operating system and a BSD-socket network interface. To test this 
-version we recommend a Linux PC or Windows with Cygwin (http://www.cygwin.com) 
+with a POSIX operating system and a BSD-socket network interface. To test this
+version we recommend a Linux PC or Windows with Cygwin (http://www.cygwin.com)
 installed. You will need to have the following installed:
 
 * CMake
@@ -33,14 +29,14 @@ installed. You will need to have the following installed:
 * make
 * binutils
 * the development library of libcap (libcap-dev or equivalient)
- 
+
 for normal building. These should be installed on most Linux installations and
 are part of the development packages of Cygwin.
 
 If you want to run the unit tests you will also have to download CppUTest via
 https://github.com/cpputest/cpputest
 
-For configuring the project we recommend the use of a CMake GUI (e.g., the 
+For configuring the project we recommend the use of a CMake GUI (e.g., the
 cmake-gui package on Linux, or the Installer for Windows available at [CMake](https://cmake.org/))
 
 Compile for Linux/POSIX:
@@ -78,7 +74,7 @@ Compile for Windows XP/7/8 via Visual Studio:
 		e.g. ``OpENer 3``
 
 In order to get the correct interface index enter the command ``route print`` in a command promt and search for the MAC address of your chosen network interface at the beginning of the output. The leftmost number is the corresponding interface index.
-		
+
 Compile for Windows XP/7/8/10 via Cygwin:
 --------------------------------------
 The POSIX setup file can be reused for Cygwin. Please note, that you cannot use RT mode and you will have to remove the code responsible for checking and getting the needed capabilities, as libcap is not available in Cygwin. The easier and more supported way to build OpENer for Windows is to either use MinGW or Visual Studio.
@@ -88,7 +84,7 @@ Compile for MinGW on Windows XP/7/8/10
 1. Make sure 64 bit mingw is installed. (Test with gcc --version, should show x86_64-posix-seh-rev1)
 2. Make sure CMake is installed. (Test with cmake --version, should be version 3.xx)
 3. Change to <opener install dir>/bin/mingw
-4. Run the command `setup_mingw.bat` in a dos command line. (Not a bash shell). If tracing is desired, 
+4. Run the command `setup_mingw.bat` in a dos command line. (Not a bash shell). If tracing is desired,
 use the following (where the cmake parameter must be enclosed in quotes) or change the ./source/CMakeList.txt file.
     ```
     setup_mingw.bat "-DOpENer_TRACES:BOOL=TRUE"
@@ -96,7 +92,7 @@ use the following (where the cmake parameter must be enclosed in quotes) or chan
 5. Run the command "make" from the same directory (./bin/mingw)
 6. The opener.exe is now found in <opener install dir>\bin\mingw\src\ports\MINGW
 7. Start it like this: "opener 192.168.250.22", where the ip address is the local computer's address on the nettwork you want to use.
-		
+
 Directory structure:
 --------------------
 - bin ...  The resulting binaries and make files for different ports
@@ -115,18 +111,18 @@ Directory structure:
 
 Documentation:
 --------------
-The documentation of the functions of OpENer is part of the source code. The source 
-packages contain the generated documentation in the directory doc/api_doc. If you 
-use the GIT version you will need the program Doxygen for generating the HTML 
-documentation. You can generate the documentation by invoking doxygen from the 
+The documentation of the functions of OpENer is part of the source code. The source
+packages contain the generated documentation in the directory doc/api_doc. If you
+use the GIT version you will need the program Doxygen for generating the HTML
+documentation. You can generate the documentation by invoking doxygen from the
 command line in the opener main directory.
 
 
 Fuzzing
 --------------
 ### Intro
-Fuzzing is an automated testing method that directs varying input data to a program in 
-order to monitor output. It is a way to test for overall reliability as well as identify 
+Fuzzing is an automated testing method that directs varying input data to a program in
+order to monitor output. It is a way to test for overall reliability as well as identify
 potential security bugs.
 
 The fuzzer we are using is AFL, a fuzzer that uses runtime guided techniques to create input for the tested program. From a high-level prespective AFL works as follows:
@@ -152,7 +148,7 @@ echo "AFL is ready at: $(which afl-fuzz)"
 
 Then, compile OpENer with AFL:
 1. Change to the ``OpENer/bin/posix`` directory
-2. Compile OpENer with AFL ``./setup_posix_fuzz_afl.sh`` 
+2. Compile OpENer with AFL ``./setup_posix_fuzz_afl.sh``
 3. Run ``make``
 
 ### Fuzz
@@ -205,7 +201,7 @@ Shut down all the instances: docker-compose down
 
 Porting OpENer:
 ---------------
-For porting OpENer to new platforms please see the porting section in the 
+For porting OpENer to new platforms please see the porting section in the
 Doxygen documentation.
 
 Contributing to OpENer:

+ 0 - 20
TODO

@@ -1,20 +0,0 @@
-This file serves as brainstorming buffer for ideas to improve and enhance OpENer:
-
-* New Features:
-  - Implementation of common CIP-objects
-  - CIP-Sync
-  - CIP-Motion
-
-
-* Improvements and Optimizations
-  - Remove the need for the response buffer in the explicit message handling 
-  	(zero copy stack)
-  - Rework I/O message handling:
-     - own buffers for each connection that are preconfigured and only runtime 
-       data needs to be changed.
-  - Rework socket handling 
-     - Use only one single UDP socket for all I/O messages
-         - may not be possible for point to point consuming connections where
-           the scanner gives a different port number
-     - use the registered port number 2222 for all I/O communication 
-     

+ 0 - 17
sonar-project.properties

@@ -1,17 +0,0 @@
-sonar.projectKey=EIPStackGroup_OpENer
-sonar.organization=eipstackgroup
-sonar.python.version=3.8
-sonar.language=c
-sonar.c.file.suffixes=.c,.h
-sonar.cpp.file.suffixes=.cc,.cpp,.cxx,.c++,.hh,.hpp,.hxx,.h++,.ipp
-sonar.coverage.exclusions=fuzz/**, source/tests/**
-
-# This is the name and version displayed in the SonarCloud UI.
-#sonar.projectName=OpENer
-#sonar.projectVersion=1.0
-
-# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
-#sonar.sources=.
-
-# Encoding of the source code. Default is default system encoding
-#sonar.sourceEncoding=UTF-8

+ 0 - 140
uncrustify.cfg

@@ -1,140 +0,0 @@
-tok_split_gte=false
-utf8_byte=false
-utf8_force=false
-indent_cmt_with_tabs=false
-indent_align_string=false
-indent_braces=false
-indent_braces_no_func=false
-indent_braces_no_class=false
-indent_braces_no_struct=false
-indent_brace_parent=false
-indent_namespace=false
-indent_extern=false
-indent_class=true
-indent_class_colon=false
-indent_else_if=false
-indent_var_def_cont=false
-indent_func_call_param=false
-indent_func_def_param=false
-indent_func_proto_param=false
-indent_func_class_param=false
-indent_func_ctor_var_param=false
-indent_template_param=false
-indent_func_param_double=false
-indent_relative_single_line_comments=false
-indent_col1_comment=false
-indent_access_spec_body=false
-indent_paren_nl=false
-indent_comma_paren=false
-indent_bool_paren=false
-indent_first_bool_expr=false
-indent_square_nl=false
-indent_preserve_sql=false
-indent_align_assign=true
-sp_balance_nested_parens=true
-align_keep_tabs=false
-align_with_tabs=false
-align_on_tabstop=false
-align_number_right=true
-align_func_params=false
-align_same_func_call_params=false
-align_var_def_colon=false
-align_var_def_attribute=false
-align_var_def_inline=false
-align_right_cmt_mix=false
-align_on_operator=false
-align_mix_var_proto=false
-align_single_line_func=false
-align_single_line_brace=false
-align_nl_cont=false
-align_left_shift=true
-align_oc_decl_colon=false
-nl_collapse_empty_body=false
-nl_assign_leave_one_liners=false
-nl_class_leave_one_liners=false
-nl_enum_leave_one_liners=false
-nl_getset_leave_one_liners=false
-nl_func_leave_one_liners=false
-nl_if_leave_one_liners=false
-nl_multi_line_cond=false
-nl_multi_line_define=false
-nl_before_case=false
-nl_after_case=false
-nl_after_return=false
-nl_after_semicolon=false
-nl_after_brace_open=false
-nl_after_brace_open_cmt=false
-nl_after_vbrace_open=false
-nl_after_vbrace_open_empty=false
-nl_after_brace_close=false
-nl_after_vbrace_close=false
-nl_define_macro=false
-nl_squeeze_ifdef=false
-nl_ds_struct_enum_cmt=false
-nl_ds_struct_enum_close_brace=false
-nl_create_if_one_liner=false
-nl_create_for_one_liner=false
-nl_create_while_one_liner=false
-ls_for_split_full=false
-ls_func_split_full=true
-nl_after_multiline_comment=false
-eat_blanks_after_open_brace=false
-eat_blanks_before_close_brace=false
-mod_full_brace_if_chain=false
-mod_pawn_semicolon=false
-mod_full_paren_if_bool=false
-mod_remove_extra_semicolon=true
-mod_sort_import=false
-mod_sort_using=false
-mod_sort_include=false
-mod_move_case_break=false
-mod_remove_empty_return=false
-cmt_indent_multi=true
-cmt_c_group=false
-cmt_c_nl_start=false
-cmt_c_nl_end=false
-cmt_cpp_group=false
-cmt_cpp_nl_start=false
-cmt_cpp_nl_end=false
-cmt_cpp_to_c=false
-cmt_star_cont=false
-cmt_multi_check_last=true
-cmt_insert_before_preproc=false
-pp_indent_at_level=false
-pp_region_indent_code=false
-pp_if_indent_code=false
-pp_define_at_level=false
-indent_columns=2
-indent_switch_case=2
-code_width=80
-utf8_bom=remove
-indent_with_tabs=0
-sp_arith=add
-sp_assign=add
-sp_assign_default=add
-sp_enum_assign=add
-sp_pp_concat=add
-sp_pp_stringify=add
-sp_before_ptr_star=add
-sp_between_ptr_star=remove
-sp_after_ptr_star=remove
-sp_after_ptr_star_func=remove
-sp_func_def_paren=remove
-sp_fparen_brace=force
-nl_case_colon_brace=remove
-nl_class_brace=remove
-nl_func_decl_start_single=remove
-nl_func_def_start_single=remove
-nl_func_decl_args=add
-nl_func_def_args=add
-nl_func_decl_end_single=remove
-nl_func_def_end_single=remove
-nl_func_decl_empty=force
-nl_func_def_empty=remove
-nl_fdef_brace=remove
-mod_full_brace_do=add
-mod_full_brace_for=add
-mod_full_brace_function=add
-mod_full_brace_if=add
-mod_full_brace_while=add
-