Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ogma-core: cFS app template contains trailing spaces #108

Closed
ivanperez-keera opened this issue Nov 22, 2023 · 6 comments
Closed

ogma-core: cFS app template contains trailing spaces #108

ivanperez-keera opened this issue Nov 22, 2023 · 6 comments
Assignees
Labels
CR:Status:Closed Admin only: Change request that has been completed CR:Type:Bug Admin only: Change request pertaining to error detected
Milestone

Comments

@ivanperez-keera
Copy link
Member

ivanperez-keera commented Nov 22, 2023

Description

The cFS app template contains trailing spaces. It's best to remove them, since those are automatically removed by many editors and that will produce changes to the generated files.

Type

  • Bug: The application produced by Ogma does not conform with our coding standards.

Additional context

None.

Requester

  • Ivan Perez

Method to check presence of bug

Searching for trailing spaces in the ogma directory brings up multiple results. It should not bring any.

$ grep -nIHre ' $'
ogma-core/templates/copilot-cfs/fsw/mission_inc/copilot_cfs_perfids.h:5:** Purpose: 
ogma-core/templates/copilot-cfs/fsw/mission_inc/copilot_cfs_perfids.h:15:#define COPILOT_CFS_PERF_ID              91 
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs.c:63:        
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs.c:91:    */ 
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs.c:106:                COPILOT_CFS_MINOR_VERSION, 
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs.c:107:                COPILOT_CFS_REVISION, 
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs.c:150:    
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs_events.h:3:**    copilot_app_events.h 
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs_events.h:5:** Purpose: 
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs_events.h:17:#define COPILOT_STARTUP_INF_EID             1 
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs_events.h:20:#define COPILOT_INVALID_MSGID_ERR_EID       4 
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs_events.h:21:#define COPILOT_LEN_ERR_EID                 5 
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs_msg.h:3:**   copilot_cfs_msg.h 
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs_msg.h:5:** Purpose: 
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs_msg.h:29:typedef struct 
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs_version.h:5:** Purpose: 
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs_version.h:19:      
ogma-core/templates/copilot-cfs/fsw/for_build/Makefile:2:# File: CFS Application Makefile 
ogma-core/templates/copilot-cfs/fsw/for_build/Makefile:7:# Revision 1.8 2009/07/09 12:25:54EDT rmcgraw 
ogma-core/templates/copilot-cfs/fsw/for_build/Makefile:16:# 
ogma-core/templates/copilot-cfs/fsw/for_build/Makefile:18:# 
ogma-core/templates/copilot-cfs/fsw/for_build/Makefile:36:LOCAL_COPTS = 
ogma-core/templates/copilot-cfs/fsw/for_build/Makefile:52:SHARED_LIB_LINK = 
ogma-core/templates/copilot-cfs/fsw/for_build/Makefile:55:# Should not have to change below this line, except for customized 
ogma-core/templates/copilot-cfs/fsw/for_build/Makefile:60:# Set build type to CFE_APP. This allows us to 
ogma-core/templates/copilot-cfs/fsw/for_build/Makefile:62:# 
ogma-core/templates/copilot-cfs/fsw/for_build/Makefile:65:## 
ogma-core/templates/copilot-cfs/fsw/for_build/Makefile:67:## Any of these can be copied to a local file and 
ogma-core/templates/copilot-cfs/fsw/for_build/Makefile:101:## Define the VPATH make variable. 
ogma-core/templates/copilot-cfs/fsw/for_build/Makefile:104:## if the mission chooses to put the src in another directory such as "src", then that can be 
ogma-core/templates/copilot-cfs/fsw/for_build/Makefile:107:VPATH = $(CFS_APP_SRC)/$(APPTARGET)/fsw/src 
ogma-core/templates/copilot-cfs/fsw/platform_inc/copilot_cfs_msgids.h:5:** Purpose: 

Expected result

The result of the grep command above should be empty, indicating that there are no trailing spaces.

Desired result

The result of the grep command above should be empty, indicating that there are no trailing spaces.

Proposed solution

Remove all trailing spaces from any files that have them.

Further notes

None.

@ivanperez-keera ivanperez-keera added CR:Status:Initiated Admin only: Change request that has been initiated CR:Type:Bug Admin only: Change request pertaining to error detected labels Nov 22, 2023
@ivanperez-keera
Copy link
Member Author

Change Manager: Confirmed that the issue exists.

@ivanperez-keera ivanperez-keera added CR:Status:Confirmed Admin only: Change request that has been acknowledged by the change manager and removed CR:Status:Initiated Admin only: Change request that has been initiated labels Nov 22, 2023
@ivanperez-keera
Copy link
Member Author

Technical Lead: Confirmed that the issue should be addressed.

@ivanperez-keera ivanperez-keera added CR:Status:Accepted Admin only: Change request accepted by technical lead and removed CR:Status:Confirmed Admin only: Change request that has been acknowledged by the change manager labels Nov 22, 2023
@ivanperez-keera
Copy link
Member Author

Technical Lead: Issue scheduled for fixing in Ogma 1.0.12.

Fix assigned to: @ivanperez-keera.

@ivanperez-keera ivanperez-keera added CR:Status:Scheduled Admin only: Change requested scheduled and removed CR:Status:Accepted Admin only: Change request accepted by technical lead labels Nov 22, 2023
@ivanperez-keera ivanperez-keera self-assigned this Nov 22, 2023
@ivanperez-keera ivanperez-keera added this to the 1.0.12 milestone Nov 22, 2023
@ivanperez-keera ivanperez-keera added CR:Status:Implementation Admin only: Change request that is currently being implemented and removed CR:Status:Scheduled Admin only: Change requested scheduled labels Nov 22, 2023
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2023
The cFS app template contains trailing spaces. It's best to remove them, since
those are automatically removed by many editors and that will produce changes
to the generated files, and trailing spaces do not conform with our own style
guide (and are commonly disallowed by style guides).

This commit removes all trailing spaces from the cFS app template.
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2023
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2023
The cFS app template contains trailing spaces. Trailing spaces do not conform
with our own style guide (and are commonly disallowed by style guides), and are
consequently automatically removed by many editors. In turn that will produce
changes to the generated files, which will be overwritten every time the user
re-generates the app.

This commit removes all trailing spaces from the cFS app template.
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2023
@ivanperez-keera
Copy link
Member Author

Implementor: Solution implemented, review requested.

@ivanperez-keera ivanperez-keera added CR:Status:Verification Admin only: Change request that is currently being verified and removed CR:Status:Implementation Admin only: Change request that is currently being implemented labels Nov 22, 2023
@ivanperez-keera
Copy link
Member Author

Change Manager: Verified that:

  • Solution is implemented:
    • The code proposed compiles passes the tests. Details:
      Docker image:

      FROM ubuntu:trusty
      
      RUN apt-get update
      
      RUN apt-get install --yes software-properties-common
      RUN add-apt-repository ppa:hvr/ghc
      RUN apt-get update
      
      RUN apt-get install --yes ghc-8.6.5 cabal-install-2.4
      RUN apt-get install --yes libz-dev
      
      ENV PATH=/opt/ghc/8.6.5/bin:/opt/cabal/2.4/bin:$PWD/.cabal-sandbox/bin:$PATH
      
      RUN cabal update
      RUN cabal v1-sandbox init
      RUN cabal v1-install alex happy
      RUN apt-get install --yes git
      
      # We install the application first and then test it, in case any tests need to
      # run the tool.
      CMD git clone $REPO && \
          cd $NAME && \
          git checkout $COMMIT && \
          cd .. && \
          cabal v1-install $NAME/$PAT**/ --enable-tests && \
          cabal v1-install $NAME/$PAT**/ --enable-tests --run-tests -j1

      Command:

      $ docker run -e "REPO=https://github.com/ivanperez-keera/ogma" -e "NAME=ogma" -e PAT="ogma-" -e "COMMIT=b9753e29f6e0823fa8bf5e639b750528438d7b31" -it ogma-test
    • The solution proposed fixes the issues described. Details:
      The following Dockerfile searches for trailing spaces in all files, printing the word Success if none are found.

      FROM ubuntu:focal
      
      RUN apt-get update
      
      RUN apt-get install --yes git
      
      SHELL ["/bin/bash", "-c"]
      CMD git clone $REPO \
          && cd $NAME \
          && git checkout $COMMIT \
          && ! grep -nIHre ' $' ogma** \
          && echo "Success"

      Command:

      $ docker run -e "REPO=https://github.com/ivanperez-keera/ogma" -e "NAME=ogma" -e PAT="ogma-" -e "COMMIT=b9753e29f6e0823fa8bf5e639b750528438d7b31" -it ogma-verify-108
  • Implementation is documented. Details:
    No changes needed.
  • Change history is clear.
  • Commit messages are clear.
  • Changelogs are updated.
  • Examples are updated. Details:
    No examples affected.
  • Required version bumps are evaluated. Details:
    No bump needed (change to generated code with no behavioral implications).

@ivanperez-keera
Copy link
Member Author

Change Manager: Implementation ready to be merged.

@ivanperez-keera ivanperez-keera added CR:Status:Closed Admin only: Change request that has been completed and removed CR:Status:Verification Admin only: Change request that is currently being verified labels Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CR:Status:Closed Admin only: Change request that has been completed CR:Type:Bug Admin only: Change request pertaining to error detected
Projects
None yet
Development

No branches or pull requests

1 participant