Code Style Guide
Welcome to the Dunosis Code Style Guide! This guide outlines the standards and best practices for writing clean, maintainable, and consistent code across all Dunosis projects. Following these guidelines ensures readability, reduces errors, and promotes collaboration.
🧭 Purpose
The purpose of this style guide is to:
- Ensure consistency across codebases.
- Improve readability for current and future developers.
- Minimize errors and simplify debugging.
- Facilitate onboarding of new team members.
📋 General Guidelines
1. Naming Conventions
- Variables: Placeholder for variable naming rules (e.g., camelCase or snake_case).
- Functions: Placeholder for function naming rules.
- Classes: Placeholder for class naming rules.
2. Code Formatting
- Indentation: Placeholder for rules (e.g., 2 spaces or 4 spaces).
- Line Length: Placeholder for maximum line length recommendations.
- Whitespace: Placeholder for spacing between blocks of code.
📛 Naming Conventions for Documentation
To ensure clarity and consistency across all documentation, follow these naming conventions:
🔡 Variables
- Use
camelCasefor JavaScript/TypeScript andsnake_casefor Python. - Be descriptive and concise (e.g.,
userEmail,file_path). - Avoid abbreviations unless they are well-known (e.g.,
id,URL).
📄 File Names
- Use
kebab-casefor filenames:user-profile.html,main-layout.css. - Use lowercase letters only.
- Avoid spaces or underscores.
- Include a descriptive prefix if applicable:
component-header.js,service-auth.py.
🖼️ Media Resources
- Use lowercase
kebab-casefor media files:product-thumbnail.jpg,hero-banner.mp4. - Include the context or purpose in the name.
- Use versioning if needed:
logo-v2.svg,intro-video-v1.mp4.
🌿 Branch Names
Use semantic and descriptive branch names, separating words with hyphens:
Examples:
feature/user-authenticationbugfix/navbar-overlaphotfix/image-compressiondocs/style-guide-update
💬 Commit Messages
Follow the conventional commit format:
Types:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Code style changes (formatting, missing semi-colons, etc.)refactor: Refactoring code without changing functionalitytest: Adding or fixing testschore: Maintenance tasks
Examples:
feat(login): add Google OAuth integrationfix(navbar): fix alignment issue on mobiledocs(readme): update setup instructions
🖋 HTML Guidelines
1. Structure
- Placeholder for rules on semantic HTML structure (e.g., proper use of
<header>,<main>,<footer>).
2. Attributes
- Placeholder for attribute ordering and usage guidelines (e.g., class, id, data attributes).
3. Comments
- Placeholder for guidelines on commenting in HTML (e.g.,
<!-- Section: Header -->).
🎨 CSS Guidelines
1. Syntax
- Placeholder for preferred syntax (e.g., kebab-case for class names).
- Placeholder for rules on using shorthand properties.
2. Organization
- Placeholder for organizing CSS files (e.g., by components or pages).
3. Specificity
- Placeholder for rules on avoiding overly specific selectors.
4. Comments
- Placeholder for examples of how to document CSS rules.
⚙️ JavaScript Guidelines
1. Syntax
- Placeholder for preferred syntax (e.g., ES6+).
- Placeholder for rules on arrow functions and template literals.
2. Variables and Constants
- Placeholder for rules on using
const,let, and avoidingvar.
3. Comments
- Placeholder for guidelines on inline and block comments.
4. Error Handling
- Placeholder for best practices on error handling and logging.
🛠 Tools and Linting
1. Linting Tools
- Placeholder for tools like ESLint, Prettier, or Stylelint.
2. Configurations
- Placeholder for examples of configuration files (e.g.,
.eslintrc,.prettierrc).
📝 Documentation Standards
1. Code Comments
- Placeholder for commenting best practices in code.
2. Inline Documentation
- Placeholder for inline documentation rules (e.g., docstrings in Python, JSDoc for JavaScript).
Future Updates
This style guide will expand to include:
- Framework-Specific Guidelines: Tailored rules for Django, React, etc.
- Example Code Snippets: Demonstrating best practices in action.
- Team Contributions: Incorporating feedback and suggestions from the team.
Need Help?
For questions or clarifications about the style guide, reach out to: - 📧 Email: info@dunosis.com - 📞 Phone: +1 (708) 669-9225