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

Makefile comments and always MODE= #314

Merged
merged 9 commits into from Dec 28, 2021
Merged

Conversation

DG12
Copy link
Contributor

@DG12 DG12 commented Dec 14, 2021

Add many comments.
Only functional change:
Always include MODE= to allow application_modes to complain about misspelling of mode.
PS it appears that git display shows uses different tab stops.

Already deleted from master
Add many comments. 
Only functional change:
Always include MODE= to allow application_modes to complain about misspelling of mode.
PS it appears that git display shows uses different tab stops
@ojousima-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ojousima
Copy link
Member

ok to test

@ojousima
Copy link
Member

The indentation comes out as strange:
image

Let's keep commands in one line, text editors can do word wrap

src/Makefile Outdated
# @file Makefile
# @author Otso Jousimaa <otso@ojousima.net>
# @date 2021-03-30
# 2021-11-19 DG align options, MODE=APPLICATION_MODE_xxx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version information is in git, please remove duplicate information

Copy link
Contributor Author

@DG12 DG12 Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editor and astyle don't do a good job of wrapping. they sometimes break between keyword and value or just some arbitrary place.

Having all the arguments strung out in one apparent string makes this very confusing (especially with the many underscores). It is difficult to see what is a keyword.

I think that since you are intimately familiar with this and it makes perfect sense to you. I spent a very long time understanding this and was partly making notes so I could remember how it works and hoping that these comments might save others hours of investigation.

Have you looked at it in as a text file where the TABS are better presented?
What's it hurt?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is an effort to format makefiles prettier, it should cover all the makefiles in one go and be based on some standard that everyone can read. For example https://openjdk.java.net/groups/build/doc/code-conventions.html .

While the makefile might look more appealing, there's no good system to catch any possible subtle bugs introduced by this change. For example line
MODE=-DAPPLICATION_MODE_DEFAULT \DEBUG=-DNDEBUG FW_VERSION=-DAPP_FW_VERSION=${VERSION}
has \DEBUG=-DNDEBUG. I have no idea how it evaluates in code with the makefile the string is being passed to. Essentially merging this PR would require testing all the board and firmware variants, and then doing tests again when some other makefile is adjusted for new format.

In general, any formatting changes should be done by a formatting tool that is guaranteed to not change the functionality of the code. If you find such a tool for makefiles and open a pull request for GitHub Action that points out the differences between current file and tool output, I'd be happy to consider using the tool and format it is producing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try something different

@ojousima ojousima self-requested a review December 28, 2021 09:54
Copy link
Member

@ojousima ojousima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I made a few changes

@ojousima ojousima merged commit bfb837c into ruuvi:master Dec 28, 2021
@DG12
Copy link
Contributor Author

DG12 commented Dec 28, 2021

Excellent

@DG12 DG12 deleted the Makefile_comments branch December 28, 2021 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants