Skip to content

Latest commit

 

History

History
208 lines (158 loc) · 4.98 KB

File metadata and controls

208 lines (158 loc) · 4.98 KB

Contributing to 42 Header+

Thank you for your interest in contributing to the 42 Header+ VSCode extension! This document provides guidelines for contributing to the project.

Code of Conduct

By participating in this project, you agree to maintain a respectful and inclusive environment for everyone.

How to Contribute

Reporting Bugs

Before creating bug reports, please check the existing issues to avoid duplicates.

When creating a bug report, please include:

  • A clear and descriptive title
  • Steps to reproduce the issue
  • Expected behavior
  • Actual behavior
  • VSCode version and OS information
  • Extension version
  • Screenshots if applicable

Suggesting Enhancements

Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:

  • A clear and descriptive title
  • Detailed description of the proposed feature
  • Use cases and examples
  • Why this enhancement would be useful

Pull Requests

  1. Fork the repository and create your branch from master

    git checkout -b feature/my-new-feature
  2. Install dependencies

    npm install
  3. Make your changes

    • Write clean, readable code
    • Follow the existing code style
    • Add comments for complex logic
    • Update documentation if needed
  4. Test your changes

    npm run build
    npm test
    npm run lint
  5. Commit your changes

    • Use clear, descriptive commit messages
    • Reference issues in commits (e.g., "Fix header alignment (#42)")
  6. Push to your fork

    git push origin feature/my-new-feature
  7. Open a Pull Request

    • Use the PR template
    • Link related issues
    • Provide a clear description of changes
    • Ensure CI checks pass

Development Setup

Prerequisites

  • Node.js 18.x or 20.x
  • VSCode
  • Git

Getting Started

  1. Clone the repository:

    git clone https://github.com/MarioLJFerreira/vscode-42header-plus.git
    cd vscode-42header-plus
  2. Install dependencies:

    npm install
  3. Build the extension:

    npm run build
  4. Run tests:

    npm test
  5. Debug the extension:

    • Press F5 in VSCode
    • This opens a new Extension Development Host window
    • Test your changes in this window

Project Structure

vscode-42header-plus/
├── src/
│   ├── extension.ts      # Extension entry point
│   ├── header.ts         # Header generation logic
│   ├── delimiters.ts     # Language-specific delimiters
│   └── test/             # Test files
│       ├── runTest.ts    # Test runner
│       └── suite/        # Test suites
├── .github/
│   └── workflows/        # CI/CD workflows
├── package.json          # Extension manifest
└── tsconfig.json         # TypeScript configuration

Testing Guidelines

Unit Tests

  • Test individual functions in isolation
  • Use descriptive test names
  • Cover edge cases
  • Location: src/test/suite/*.test.ts

Integration Tests

  • Test extension functionality end-to-end
  • Test VSCode API integration
  • Test user workflows

Running Tests

# Run all tests
npm test

# Run tests with coverage
npm run test:coverage

# Run only unit tests
npm run test:unit

Code Style

  • Use TypeScript
  • Follow existing code formatting
  • Use meaningful variable and function names
  • Add JSDoc comments for public APIs
  • Keep functions small and focused

Commit Message Guidelines

Use conventional commits format:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes (formatting)
  • refactor: Code refactoring
  • test: Test updates
  • chore: Build process or auxiliary tool changes

Example:

feat: add support for 42 Tokyo campus

- Add 42tokyo.jp to campus list
- Update email generation logic
- Add tests for Tokyo campus

Release Process

  1. Version is updated in package.json following 0.42.x scheme (ALWAYS maintain 0.42.x format)
    • Example: 0.42.9 → 0.42.10 → 0.42.11
    • Never use 0.43.x or higher - maintain consistency with original project
  2. CHANGELOG.md is updated with changes
  3. Tests pass on all platforms
  4. PR is reviewed and approved
  5. Changes are merged to master
  6. New version is published

Versioning Guidelines

IMPORTANT: This project follows the 0.42.x versioning scheme:

  • Correct: 0.42.8, 0.42.9, 0.42.10, 0.42.11, ...
  • Incorrect: 0.43.0, 1.0.0, 0.50.0

This maintains consistency with the original 42 Header extension and preserves the "42" reference in the version number.

Need Help?

License

By contributing, you agree that your contributions will be licensed under the MIT License.


Thank you for contributing! 🎉