Skip to content

Latest commit

 

History

History
196 lines (137 loc) · 4.43 KB

File metadata and controls

196 lines (137 loc) · 4.43 KB

English | Tiếng Việt

Contributing to fcitx5-lotus

Thank you for your interest in contributing to the fcitx5-lotus project! This document guides you on how to participate in project development.

📋 Table of Contents

Getting Started

System Requirements

  • GCC or Clang with C++17 support
  • CMake >= 3.16
  • Go 1.20+ (for bamboo engine)
  • Fcitx5 development headers
  • Git

Installation and Build

# Clone repository
git clone https://github.com/LotusInputMethod/fcitx5-lotus.git
cd fcitx5-lotus

# Initialize submodules
git submodule update --init --recursive

# Build
mkdir build && cd build
cmake ..
make -j$(nproc)

Contribution Workflow

1. Fork repository

Fork this repository on GitHub and clone your fork to your machine.

git clone https://github.com/yourusername/fcitx5-lotus.git
cd fcitx5-lotus
git remote add upstream https://github.com/LotusInputMethod/fcitx5-lotus.git

2. Create a new branch

Always create a new branch for each feature or bug fix:

git checkout dev
git pull upstream dev
git checkout -b feature/feature-name
# or
git checkout -b fix/bug-name

3. Make changes

  • Write clean, readable code
  • Follow code style rules (see below)
  • Update documentation if needed

4. Commit changes

Use clear and descriptive commit messages:

feat: add emoji support

- Add emoji_data.h
- Update generate_emoji_header.py

Code of Conduct

All members contributing to this project must adhere to the Contributor Code of Conduct to build an open, friendly, and healthy community.

Code Style Rules

  • Follow the .clang-format file in the repository
  • Encouraged to create a hook for pre-commit to automatically format code before commit by creating a file .git/hooks/pre-commit with the following content:
#!/bin/bash
FILES=$(git diff --cached --name-only --diff-filter=ACMR | grep -E '\.(cpp|h)$')

if [ -n "$FILES" ]; then
    for file in $FILES; do
        clang-format -i "$file"
        git add "$file"
    done
fi

Then run the command: chmod +x .git/hooks/pre-commit

Pull Request Process

1. Ensure clean code with clang-format

2. Run tests

# Build C++ code
cd build
cmake .. && make

3. Rebase with the dev branch

git checkout dev
git pull upstream dev
git checkout feature/feature-name
git rebase dev

4. Push and create PR

git push origin feature/feature-name

Create a Pull Request on GitHub with:

  • Clear descriptive title
  • Detailed description of changes
  • Link to related issue (if any)
  • Screenshots for UI changes

Important Notes on Branching

IMPORTANT: ALL PRs MERGE INTO THE DEV BRANCH

NEVER create a Pull Request into the main branch

  • The main branch only contains stable releases and is only merged by the maintainer
  • All Pull Requests must target the dev branch
  • After passing all CI/CD tests and being reviewed by the maintainer, code will be merged into dev
  • When eligible, code will be merged from dev to main by the maintainer to bump the version

Branch Structure

main    ← Stable release (only maintainer merges)
  ↑
dev     ← Main development branch (all PRs merge here)
  ↑
feature/*, fix/*, hotfix/*  ← Personal branch for each PR

Merge Process

  1. Developer creates PR to dev
  2. Code review by maintainer
  3. Merge into dev
  4. Test on dev
  5. When stable → merge devmain (by maintainer)

Bug Reporting

When reporting a bug, please provide:

  • fcitx5-lotus version
  • Operating system and version
  • Steps to reproduce the bug
  • Log or screenshot (if any) (Log via fcitx5-diagnose command)
  • Environment (desktop environment, terminal, etc.)

Feature Requests

Before proposing a new feature:

  • Check if the feature already exists
  • Search for similar issues
  • Clearly describe the feature and use case
  • Explain why this feature is necessary

License

By contributing, you agree that your code will be licensed under the same license as the project (GPL-3.0-or-later).


Thank you for contributing!