Introduction

Welcome to the OSS Coding Standards documentation! 📚 These guidelines help maintain consistency, readability, and quality across open-source projects. Whether you're contributing to an existing repository or starting a new one, following these standards ensures smoother collaboration.

For more details on how to contribute to OSS projects, check out our OSS Project Contribution Guide.

Key Principles

Here are the core principles every OSS contributor should follow:

  • Readability First 📝
    Code should be easy to understand. Use clear variable names and consistent formatting.

  • Consistency Matters 🔄
    Follow the style guide of the project. If it's not defined, adopt a widely accepted standard (e.g., Google Style Guides).

  • Documentation is Essential 📖
    Every public API and major feature must have accompanying documentation. Use tools like Sphinx for Python projects.

  • Testing & Linting 🔍
    Run automated tests and linters (e.g., ESLint for JavaScript) before submitting changes.

Language-Specific Guidelines

Python

  • PEP 8 compliance is mandatory.
  • Use black for code formatting.
  • Add type hints for better maintainability.

JavaScript

Java

Best Practices

Community Standards

  • Respect the project's code of conduct.
  • Use 📢 for important announcements in the README.
  • Keep discussions in the issue tracker focused on solutions.
code_cleanliness
For visual examples of clean code, explore our [Code Examples Gallery](/en/docs/oss/code_examples).

Let's build better software together! 🌍🔧