Skip to content

7. Code Style Guidelines

Eneko Gonzalez edited this page Jun 3, 2024 · 3 revisions

7.1 Introduction

Maintaining a consistent code style is crucial for project readability and maintainability. This section provides guidelines on how to use the Code Style files located in the CodeStyleFiles directory of our repository.

7.2 Accessing Code Style Files

The code style files are readily available in the CodeStyleFiles directory of our repository. To access these files, navigate to:

https://github.com/grc-iit/ChronoLog/tree/master/CodeStyleFiles

Here, you will find style configuration files that can be used with various IDEs and code editors to maintain consistent formatting.

7.3 Using Code Style Files

7.3.1 Download the Style Files:

First, download the appropriate style file for your IDE from the CodeStyleFiles directory.

7.3.2 Configuring Your IDE:

  • For Visual Studio: Import the .vssettings file via Tools > Import and Export Settings.
  • For IntelliJ IDEA: Go to File > Settings > Editor > Code Style, click on the gear icon, and choose Import Scheme.
  • For Eclipse: Under Window > Preferences > Java > Code Style, import the .xml file.
  • For other editors: Refer to your editor's documentation for instructions on importing or using a code style configuration file.

7.4 Enforcing Code Style

  • Automated Checks: Implement automated style checks using tools like ESLint for JavaScript or Flake8 for Python. Configure these tools to run as part of the continuous integration process, ensuring that every commit adheres to the defined style guidelines.
  • Manual Reviews: During code reviews, reviewers should check that the submitted code complies with the established code style guidelines, in addition to functional correctness and design appropriateness.

7.5 Updating Style Guidelines

As our project evolves, so might our coding standards. Proposed changes to the code style files should be discussed and approved through the standard pull request and review process. This ensures that any modifications are agreed upon by the project maintainers and are well documented.

7.6 Notes

Always ensure that your local development environment is configured to use these style files, as this will greatly reduce the chance of style discrepancies. If you encounter any issues with the style files, or if you have suggestions for improvement, please open an issue in the GitHub repository under the Code Style tag.

By following these guidelines, all contributors can ensure that their code meets the project’s standards, helping to maintain the quality and consistency of the codebase.