Fylos
A VS Code extension that ensures your C/C++ code follows the style guidelines required by ESP and OOP courses at TU Graz. By using this extension, you automatically comply with the formatting requirements that account for 30% of your code quality assessment.
Installation
- Install the extension from the VS Code Marketplace
- The clang-format extension will be installed automatically
- Important: You also need to install the clang-format program on your system:
Depending on your operating system:
Ubuntu/Debian:
sudo apt install clang-format
Arch Linux / Manjaro:
sudo pacman -S clang
macOS (with Homebrew):
brew install clang-format
Activation
- Settings are applied automatically on first startup
- Manual application via the Fylos icon in the status bar
- Commands can be accessed via the command palette (Ctrl+Shift+P)
Features
Automatically applies formatting settings for C and C++ code that meet the requirements of ESP and OOP courses. The extension configures clang-format with the following style settings:
- LLVM-based style
- Allman bracing style (braces on new lines)
- Indented case labels
- No single-line blocks, functions, or if statements
- 120-character line limit
- Left-aligned pointers
- And more formatting rules essential for TU Graz assignments
Status Bar Integration
A dedicated status bar item allows quick access to extension features and settings application.
Add standardized file header comments with the "Fylos: Add Header Comment Template" command from the editor context menu or command palette.
Comprehensive Code Linting
The extension includes multiple specialized linters for C/C++ code:
- Nested Structure Linter: Checks for excessive nesting levels
- Function Header Linter: Ensures proper documentation of functions
- Naming Convention Linter: Enforces consistent variable and function naming
- Function Length Linter: Identifies functions that are too long
- Single Statement Linter: Checks for proper formatting of control statements
- File Header Linter: Validates file header documentation
- Main Function Linter: Ensures correct implementation of main() functions
- Parameter Limit Linter: Flags functions with too many parameters
Automatic Settings Configuration
The extension automatically configures VS Code settings for optimal C/C++ development:
- Auto-save functionality
- Editor rulers at 120 characters
- Format on save enabled
- Bracket pair guides
- clang-format as the default formatter for C/C++ files
Requirements
- VS Code version 1.67.1 or higher
- Extension: clang-format (installed automatically)
- clang-format program (installed separately as shown above)
Known Issues
If you encounter problems with the extension:
License
This extension is licensed under the MIT License.
Enjoy!