Skip to content

Conversation

@danoli3
Copy link
Member

@danoli3 danoli3 commented Aug 28, 2024

The great old question - Tab or Space

Reminder: openFrameworks uses for C++/C - Tabs - with a space width 4
https://github.com/openframeworks/openFrameworks/wiki/oF-code-style

We have .clangformat for C / C++ / all clang editors like Xcode etc.
For Xcode, @2bbb has added some values to configure this directly for the core mac/iOS/tvOS Project files

Added some .editorconfig and merged: #6900
EditorConfig
I've configured this to have exclusions to YML, JS and other formats where spaces are required.

This will fix format issues when editing source in editors such as:

  • Sublime Text
  • Notepad++
  • Codeblocks
  • Eclipse
  • VSCode
    etc
Screenshot 2024-08-28 at 10 14 28 AM

Essentially:

# EditorConfig https://editorconfig.org
root = true

# Default settings for all files
[*]
indent_style = tab
indent_size = 4
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,py}]
charset = utf-8

[*.sh]
indent_style = tab
indent_size = 4
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true

# Override JSON 
[*.json]
indent_style = space
indent_size = 2
tab_width = 2

# Override YAML 
[*.yml]
indent_style = space
indent_size = 2
tab_width = 2

[*.html]
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

@danoli3 danoli3 merged commit 796a899 into openframeworks:master Sep 5, 2024
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.

2 participants