diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..b61cc8e --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,4 @@ +# RaidLogAuto Code Owners +# These users will be automatically requested for review on PRs + +* @Xerrion diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..95f83f2 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: Xerrion +ko_fi: Xerrion diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 9c4468d..de83363 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -1,50 +1,14 @@ name: Release PR on: - push: - branches: - - master - paths-ignore: - - CHANGELOG.md + push: + branches: [master] permissions: - contents: write - pull-requests: write + contents: write + pull-requests: write jobs: - release-pr: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - name: Generate changelog - id: git-cliff - uses: orhun/git-cliff-action@v4 - with: - config: cliff.toml - args: --bump --verbose - env: - OUTPUT: CHANGELOG.md - GITHUB_REPO: ${{ github.repository }} - - - name: Normalize version - id: version - if: steps.git-cliff.outputs.version - run: | - VERSION="${{ steps.git-cliff.outputs.version }}" - VERSION="${VERSION#v}" - echo "version=$VERSION" >> "$GITHUB_OUTPUT" - - - name: Create/update release PR - if: steps.version.outputs.version - uses: peter-evans/create-pull-request@v7 - with: - branch: release/next - title: "chore: release ${{ steps.version.outputs.version }}" - labels: autorelease - commit-message: "chore: release ${{ steps.version.outputs.version }}" - body: "Automated release PR for version ${{ steps.version.outputs.version }}" - delete-branch: true + release-pr: + uses: DragonAddons/wow-workflows/.github/workflows/release-pr.yml@main + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c5ee4e..a0403c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,153 +1,21 @@ name: Release on: - push: - tags: - - "*" - pull_request: - types: [closed] - branches: - - master - workflow_dispatch: - inputs: - tag_name: - description: "Tag to package (e.g. 1.1.2)" - required: true - type: string + push: + tags: + - "*" + workflow_dispatch: + inputs: + tag_name: + description: Tag to release + required: true permissions: - contents: write - pull-requests: read + contents: write jobs: - create-tag: - name: Create tag from release PR - if: >- - github.event_name == 'pull_request' && - github.event.pull_request.merged == true && - contains(github.event.pull_request.labels.*.name, 'autorelease') - runs-on: ubuntu-latest - outputs: - tag: ${{ steps.tag.outputs.tag }} - steps: - - name: Checkout - uses: actions/checkout@v5 + release: + uses: DragonAddons/wow-workflows/.github/workflows/release.yml@main with: - fetch-depth: 0 - - - name: Extract version and create tag - id: tag - shell: bash - run: | - TITLE="${{ github.event.pull_request.title }}" - TAG=$(echo "$TITLE" | grep -oP '\d+\.\d+\.\d+') - if [ -z "$TAG" ]; then - echo "::error::Could not extract version from PR title: $TITLE" - exit 1 - fi - echo "tag=$TAG" >> "$GITHUB_OUTPUT" - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - git tag -a "$TAG" -m "Release $TAG" - git push origin "$TAG" - - changelog: - name: Generate changelog - needs: [create-tag] - if: >- - always() && - github.event_name != 'pull_request' && - (startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch') - runs-on: ubuntu-latest - outputs: - tag: ${{ steps.vars.outputs.tag }} - steps: - - name: Checkout - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - name: Resolve tag - id: vars - shell: bash - run: | - TAG="" - if [ -n "${{ needs.create-tag.outputs.tag }}" ]; then - TAG="${{ needs.create-tag.outputs.tag }}" - elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - TAG="${{ github.event.inputs.tag_name }}" - else - TAG="${{ github.ref_name }}" - fi - if [ -z "$TAG" ]; then - echo "::error::No tag could be resolved" - exit 1 - fi - echo "tag=$TAG" >> "$GITHUB_OUTPUT" - - - name: Generate changelog - uses: orhun/git-cliff-action@v4 - with: - config: cliff.toml - args: --verbose - env: - OUTPUT: CHANGELOG.md - GITHUB_REPO: ${{ github.repository }} - - - name: Commit changelog to default branch - shell: bash - run: | - BRANCH="${{ github.event.repository.default_branch }}" - git switch "$BRANCH" - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - git add CHANGELOG.md - if git diff --cached --quiet; then - exit 0 - fi - git commit -m "Update changelog" - git push origin "HEAD:$BRANCH" - - package: - name: Package - needs: [create-tag, changelog] - if: >- - always() && ( - needs.create-tag.result == 'success' || - startsWith(github.ref, 'refs/tags/') || - github.event_name == 'workflow_dispatch' - ) - runs-on: ubuntu-latest - env: - CF_API_KEY: ${{ secrets.CF_API_KEY }} - WAGO_API_TOKEN: ${{ secrets.WAGO_API_TOKEN }} - GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} - steps: - - name: Resolve tag - id: resolve - shell: bash - run: | - TAG="" - if [ -n "${{ needs.create-tag.outputs.tag }}" ]; then - TAG="${{ needs.create-tag.outputs.tag }}" - elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - TAG="${{ github.event.inputs.tag_name }}" - else - TAG="${{ github.ref_name }}" - fi - if [ -z "$TAG" ]; then - echo "::error::No tag could be resolved" - exit 1 - fi - echo "TAG_NAME=$TAG" >> "$GITHUB_ENV" - - - name: Checkout tag - uses: actions/checkout@v5 - with: - ref: refs/tags/${{ env.TAG_NAME }} - fetch-depth: 0 - - - name: Package and upload - uses: BigWigsMods/packager@v2 - env: - GITHUB_REF: refs/tags/${{ env.TAG_NAME }} \ No newline at end of file + tag_name: ${{ inputs.tag_name || github.ref_name }} + secrets: inherit diff --git a/.gitignore b/.gitignore index bd454cb..496bb96 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,5 @@ -# Packager files +.env .release/ -# Editor files -*.swp -*.swo -*~ -.vscode/ -.idea/ - -# OS files -.DS_Store -Thumbs.db - -# Env files -.env +# Windows +nul diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..30668ab --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.1.2" +} diff --git a/AGENTS.md b/AGENTS.md index 97cfa80..6c3833c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,170 +1,201 @@ # RaidLogAuto - Agent Guidelines -World of Warcraft addon that automatically enables combat logging in raid instances and disables it on exit. Supports Retail, MoP Classic, TBC Anniversary, Cataclysm Classic, and Classic Era. +This is a World of Warcraft addon that automatically enables combat logging when entering raid instances and disables it when leaving. The addon supports multiple WoW versions: Retail, MoP Classic, TBC Anniversary, Cataclysm Classic, and Classic Era. -## Build, Lint, and Release +--- -There is no local build step. GitHub Actions handles everything: +## CI / CD -- **Lint** (`.github/workflows/lint.yml`) - Runs `luacheck --no-color` on PRs to master via `nebularg/actions-luacheck`. -- **Release PR** (`.github/workflows/release-pr.yml`) - On master push, generates a changelog with git-cliff and opens/updates an `autorelease` PR. -- **Release** (`.github/workflows/release.yml`) - On tag push (or merged autorelease PR), packages with `BigWigsMods/packager@v2` and uploads to CurseForge, Wago, and GitHub. +| Workflow | Trigger | What it does | +|----------|---------|--------------| +| `lint.yml` | `pull_request_target` to `master` | Runs Luacheck | +| `release-pr.yml` | Push to `master` | Creates / updates a release PR via release-please | +| `release.yml` | Tag push or `workflow_dispatch` | Builds and publishes via BigWigsMods packager | -### Running Luacheck Locally +### Branch Protection -```bash -luacheck . -``` - -Configuration is in `.luacheckrc` (Lua 5.1 std, no max line length, excludes deprecated `RaidLogAuto.lua`). - -### Manual Testing - -There are no automated tests. Test in-game: - -1. Load the addon in the target WoW version -2. Enter and exit a raid instance, verify combat logging toggles on/off -3. (Retail/MoP only) Start and finish a Mythic+ key with `/rla mythic` enabled -4. Test slash commands: `/rla`, `/rla on`, `/rla off`, `/rla toggle`, `/rla mythic`, `/rla silent`, `/rla help` -5. Check `/rla status` output matches expected SavedVariable state - -#### Advanced Combat Logging Auto-Enable +- PRs required to merge into `master` +- Luacheck status check must pass +- Branches must be up to date before merging +- No force pushes to `master` +- Squash merge only +- Auto-delete head branches after merge -1. Disable ACL in WoW settings: `/console advancedCombatLogging 0` -2. Enter a raid instance - verify chat message: "Advanced Combat Logging was disabled. Automatically enabled it for you." -3. Verify ACL is now enabled: `/rla status` should show "Advanced Combat Logging: ON" -4. Enter another raid - verify NO duplicate ACL message (it is already on) +### Running a Single Test (Manual) +Since this is a WoW addon, there are no automated unit tests. Testing is done manually in-game: +1. Load the addon in the appropriate WoW version (Retail/Classic/TBC/Cata) +2. Enter/exit raid instances to verify combat logging toggles +3. Test slash commands: `/rla`, `/rla on`, `/rla off`, `/rla toggle`, `/rla mythic`, `/rla silent`, `/rla help` -#### CombatLog.txt Reminder Dialog - -1. Reset the reminder: `/run RaidLogAutoDB.combatLogReminderDismissed = false; ReloadUI()` -2. Enter a raid instance - verify a StaticPopup dialog appears warning about CombatLog.txt -3. Click "OK, Got It" - verify dialog dismisses -4. Leave and re-enter the raid - verify the dialog does NOT reappear -5. `/reload` and re-enter - verify dialog still does NOT reappear (persisted) - -#### /rla acl Command - -1. `/rla acl` with ACL enabled - shows "Advanced Combat Logging: ON" -2. `/console advancedCombatLogging 0` then `/rla acl` - should auto-enable and confirm +--- ## Project Structure ``` RaidLogAuto/ - RaidLogAuto.toc # TOC - maps Interface versions to Lua files - RaidLogAuto_Retail.lua # Retail (Raids + Mythic+) - RaidLogAuto_Mists.lua # MoP Classic (Raids + Mythic+) - RaidLogAuto_TBC.lua # TBC Anniversary (Raids only) - RaidLogAuto_Cata.lua # Cataclysm Classic (Raids only) - RaidLogAuto_Classic.lua # Classic Era (Raids only) - RaidLogAuto.lua # DEPRECATED - do not edit or load - .luacheckrc # Luacheck config - .pkgmeta # BigWigsMods packager metadata - cliff.toml # git-cliff changelog config - .github/workflows/ - lint.yml # Luacheck CI - release-pr.yml # Auto release PR via git-cliff - release.yml # Tag-based packaging and upload +├── AGENTS.md # This file +├── RaidLogAuto.toc # TOC file - defines which Lua to load per version +├── RaidLogAuto_Retail.lua # Retail (Raids + Mythic+) +├── RaidLogAuto_Mists.lua # MoP Classic (Raids + Mythic+) +├── RaidLogAuto_TBC.lua # TBC Anniversary (Raids) +├── RaidLogAuto_Cata.lua # Cataclysm Classic (Raids) +├── RaidLogAuto_Classic.lua # Classic Era (Raids) +├── RaidLogAuto.lua # Deprecated - DO NOT EDIT +├── .luacheckrc # Luacheck configuration +├── .pkgmeta # Packaging metadata +├── cliff.toml # DEPRECATED - git-cliff config (pending removal) +├── release-please-config.json # Release-please configuration +├── .release-please-manifest.json # Release-please version manifest +├── .github/workflows/ +│ ├── lint.yml # Luacheck CI on PRs and master +│ ├── release-pr.yml # Release PR via release-please +│ └── release.yml # Tag-based packaging and upload ``` -Each game version loads exactly one Lua file via the TOC `Interface-*` directives. One file per version; never mix version-specific code across files. +### Version-Specific Files -## Code Style +| File | Interface | Game Version | Features | +|------|-----------|--------------|----------| +| RaidLogAuto_Retail.lua | Interface | Retail | Raids + Mythic+ | +| RaidLogAuto_Mists.lua | Interface-Mists | MoP Classic | Raids + Mythic+ | +| RaidLogAuto_TBC.lua | Interface-BCC | TBC Anniversary | Raids | +| RaidLogAuto_Cata.lua | Interface-Cata | Cataclysm Classic | Raids | +| RaidLogAuto_Classic.lua | Interface-Classic | Classic Era | Raids | -### General Rules +--- -- Keep it simple. Each file is roughly 160-200 lines. Avoid over-engineering. -- Use `local` for all variables and functions. Only globals: `RaidLogAutoDB` (SavedVariable) and slash command registrations. -- Cache frequently-used WoW API globals as local references at the top of the file. -- Keep functions under 50 lines. Extract helpers when longer. -- Prefer early returns over deeply nested conditionals. -- Plain Lua 5.1; no type annotations, LuaLS, or EmmyLua comments. +## Code Style Guidelines -### File Layout (every version file follows this order) +### General Principles +- **Keep it simple** - This is a small addon (~200 lines), avoid over-engineering +- **Local scope everything** - Use `local` for all variables and functions +- **Cache API functions** - Cache frequently-used global API functions as locals for performance +- **One file per version** - Don't mix version-specific code; use separate files + +### Lua Formatting ```lua +-- Use 4 spaces for indentation (no tabs) +-- Maximum line length: 120 characters +-- Use spaces around operators: local x = 1 + 2 +-- No trailing whitespace + +-- Header comment format: ------------------------------------------------------------------------------- --- FileName (without .lua) --- Brief description. Version: . Features: + -- FileName + -- Description of what this file does + -- + -- Supported versions: Retail, MoP Classic (or relevant versions) ------------------------------------------------------------------------------- + local ADDON_NAME, _ = ... --- 1. SavedVariables init and defaults table --- 2. Local API caching (IsInInstance, LoggingCombat, print) --- 3. Localized strings table (L) --- 4. Color constants (COLOR_YELLOW, COLOR_GREEN, COLOR_RED, COLOR_RESET) --- 5. Helper functions (Print, ShouldEnableLogging, UpdateLogging) --- 6. Event handler frame and OnEvent --- 7. Slash command registration and handler -``` -### Naming Conventions +-- Constants (uppercase) +local CONSTANT_NAME = "value" -| Element | Convention | Example | -|---------|------------|---------| -| Files | PascalCase with underscore suffix | `RaidLogAuto_Retail.lua` | -| Global variables | PascalCase | `RaidLogAutoDB` | -| Local variables | camelCase | `local shouldLog` | -| Local functions | PascalCase | `local function UpdateLogging()` | -| Constants | UPPER_SNAKE_CASE | `local COLOR_GREEN = ...` | -| Slash commands | UPPER_SNAKE_CASE | `SLASH_RAIDLOGAUTO1` | +-- Local references for performance (camelCase) +local IsInInstance = IsInInstance +local LoggingCombat = LoggingCombat -### Local API Caching +-- Color codes (defined once at top) +local COLOR_YELLOW = "|cffffff00" +local COLOR_GREEN = "|cff00ff00" +local COLOR_RED = "|cffff0000" +local COLOR_RESET = "|r" +``` -Cache WoW globals used more than once, placed right after the defaults table: -`local IsInInstance = IsInInstance; local LoggingCombat = LoggingCombat; local print = print` +### Naming Conventions -### Localized Strings +| Type | Convention | Example | +|------|------------|---------| +| Files | PascalCase | RaidLogAuto_Retail.lua | +| Global variables | PascalCase | RaidLogAutoDB | +| Local variables | camelCase | local currentState | +| Functions | PascalCase | local function UpdateLogging() | +| Constants | UPPER_SNAKE | local DEFAULT_DELAY = 1 | +| Slash commands | UPPER_SNAKE | SLASH_RAIDLOGAUTO1 | -Use a local `L` table with `or` fallbacks for globals that may not exist in all versions. `COMBATLOGENABLED`/`COMBATLOGDISABLED` were removed in Cataclysm, so always provide a fallback string. +### Functions ```lua -local L = { - ENABLED = COMBATLOGENABLED or "Combat logging enabled.", - DISABLED = COMBATLOGDISABLED or "Combat logging disabled.", - ADDON_LOADED = "RaidLogAuto loaded. Type /rla for options.", -} +-- Prefer early returns +local function ShouldEnableLogging() + if not RaidLogAutoDB.enabled then + return false + end + + local inInstance, instanceType = IsInInstance() + if not inInstance then + return false + end + + -- Main logic + return instanceType == "raid" +end ``` -### SavedVariables - -Initialize `RaidLogAutoDB` with a defaults merge in the `ADDON_LOADED` handler to preserve existing user values while adding new keys. Only Retail and Mists files include `mythicPlus = false` in defaults. +### Event Handling ```lua -RaidLogAutoDB = RaidLogAutoDB or {} -local defaults = { enabled = true, raidOnly = true, printMessages = true } -for key, value in pairs(defaults) do - if RaidLogAutoDB[key] == nil then RaidLogAutoDB[key] = value end +local frame = CreateFrame("Frame") + +local function OnEvent(self, event, arg1) + if event == "ADDON_LOADED" and arg1 == ADDON_NAME then + -- Initialize and register other events + self:UnregisterEvent("ADDON_LOADED") + self:RegisterEvent("PLAYER_ENTERING_WORLD") + + elseif event == "PLAYER_ENTERING_WORLD" then + -- Handle event + end end + +frame:SetScript("OnEvent", OnEvent) +frame:RegisterEvent("ADDON_LOADED") ``` -### Event Handling +### Version-Specific Code + +**DO NOT** use runtime checks for version-specific features. Instead: -Register `ADDON_LOADED` first, then remaining events after initialization. Unregister `ADDON_LOADED` immediately after use. Use `C_Timer.After(1, UpdateLogging)` on `PLAYER_ENTERING_WORLD` to handle the race condition where instance info is not yet available. +1. **Create separate files** for different versions +2. **Document supported versions** in the file header +3. **Remove unused code** - don't include Mythic+ code in files where it doesn't exist ### Error Handling -- Guard API calls that may be nil: `if C_ChallengeMode and C_ChallengeMode.GetActiveChallengeMapID then` -- Use `or` fallbacks for globals that may not exist (see Localized Strings) -- No `pcall` is used; defensive nil checks are sufficient +- Use `pcall` for risky operations that might fail on some versions +- Provide fallback values for deprecated/removed globals +- Handle nil gracefully with defensive checks -## Version-Specific Rules +```lua +-- Safe API call with fallback +local currentlyLogging = LoggingCombat and LoggingCombat() or false -Do NOT use runtime version checks. The TOC routes each game version to the correct Lua file. If a feature only exists in certain versions (e.g. Mythic+), include the code only in those files. +-- Defensive nil check +if RaidLogAutoDB and RaidLogAutoDB.printMessages then + -- Safe to use +end +``` -| Feature | Retail | Mists | TBC | Cata | Classic | -|---------|--------|-------|-----|------|---------| -| Raid logging | Yes | Yes | Yes | Yes | Yes | -| Mythic+ logging | Yes | Yes | No | No | No | -| CHALLENGE_MODE events | Yes | Yes | No | No | No | +### SavedVariables -## Common Pitfalls +```lua +-- Initialize defaults in ADDON_LOADED handler +local defaults = { + enabled = true, + raidOnly = true, + mythicPlus = false, -- Retail/Mists only + printMessages = true, +} -1. `COMBATLOGENABLED`/`COMBATLOGDISABLED` removed in Cata; always provide `or` fallbacks -2. `C_ChallengeMode` API exists in all clients but M+ only runs on Retail and MoP Classic -3. `PLAYER_ENTERING_WORLD` fires before instance info is ready; use `C_Timer.After` delay -4. Cancel or guard against redundant timers to avoid duplicate log toggles -5. Unregister events you no longer need (e.g. `ADDON_LOADED` after init) +-- Merge defaults (preserves existing user values) +for key, value in pairs(defaults) do + if RaidLogAutoDB[key] == nil then + RaidLogAutoDB[key] = value + end +end +``` ## Repository Constraints @@ -173,3 +204,49 @@ Do NOT use runtime version checks. The TOC routes each game version to the corre - Do not edit `RaidLogAuto.lua`; it is deprecated and excluded from packaging - Prefer ripgrep (`rg`) over `grep` when searching the codebase - Keep changes minimal and focused; this is a small, stable addon + +--- + +## Key WoW API Functions Used + +| Function | Availability | Purpose | +|----------|--------------|---------| +| `IsInInstance()` | All versions | Check if player is in instance | +| `IsInRaid()` | All versions | Check if player is in raid | +| `LoggingCombat([bool])` | All versions | Get/set combat logging state | +| `C_ChallengeMode.GetActiveChallengeMapID()` | All versions (content in Retail/MoP only) | Get active M+ map ID | +| `C_Timer.After(seconds, func)` | All versions | Delayed function execution | +| `CreateFrame("Frame")` | All versions | Create event frame | + +## GitHub Project Board + +RaidLogAuto uses the **DragonAddons** org-level GitHub project board (#2) for issue tracking and sprint planning. + +### Board Columns + +| Column | Purpose | +|--------|---------| +| To triage | New issues awaiting review | +| Backlog | Accepted but not yet scheduled | +| Ready | Prioritised and ready to pick up | +| In progress | Actively being worked on | +| In review | PR submitted, awaiting review | +| Done | Merged / released | + +### Custom Fields + +| Field | Values / Type | +|-------|---------------| +| Priority | P0 (critical), P1 (important), P2 (nice-to-have) | +| Size | XS, S, M, L, XL | +| Estimate | Story points (number) | +| Start date | Date | +| Target date | Date | + +### Workflow + +1. **Triage** - New issues land in *To triage*. Assign Priority and Size. +2. **Plan** - Move to *Backlog* or *Ready* depending on urgency. +3. **Start** - Move to *In progress*, create a feature branch, add a comment. +4. **Review** - Open PR, move to *In review*, link the issue. +5. **Ship** - Squash-merge, auto-move to *Done* on close. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..1bc6252 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,67 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers of **RaidLogAuto** pledge to make participation in our +project and our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies within all project spaces, and it also applies when +an individual is representing the project or its community in public spaces. +Examples of representing a project or community include using an official project +email address, posting via an official social media account, or acting as an +appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at **lasse@xerrion.dk**. All complaints will +be reviewed and investigated and will result in a response that is deemed +necessary and appropriate to the circumstances. The project team is obligated to +maintain confidentiality with regard to the reporter of an incident. Further +details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct/](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..797d1cb --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,127 @@ +# Contributing to RaidLogAuto + +Thank you for your interest in contributing to **RaidLogAuto** - an addon that automatically enables combat logging in raid instances for World of Warcraft! This guide will help you get started. + +## How to Contribute + +### Reporting Bugs +- Use the [bug report template](https://github.com/Xerrion/RaidLogAuto/issues/new?template=bug-report.yml) +- Include your WoW version, RaidLogAuto version, and steps to reproduce + +### Suggesting Features +- Use the [feature request template](https://github.com/Xerrion/RaidLogAuto/issues/new?template=feature-request.yml) +- Explain the problem your feature would solve + +### Contributing Code +1. Fork the repository +2. Create a feature branch +3. Make your changes +4. Submit a pull request + +## Prerequisites + +- World of Warcraft client (Retail, TBC Anniversary, MoP Classic, Cata, or Classic) +- [Lua 5.1](https://www.lua.org/) (for linting) +- [Luacheck](https://github.com/mpeterv/luacheck) (for static analysis) +- [Git](https://git-scm.com/) + +## Development Setup + +1. **Fork and clone** the repository: + ```bash + git clone https://github.com/YOUR_USERNAME/RaidLogAuto.git + cd RaidLogAuto + ``` + +2. **Symlink** the addon into your WoW AddOns folder: + ```bash + # Windows (PowerShell as Admin) + New-Item -ItemType SymbolicLink -Path "$env:PROGRAMFILES\World of Warcraft\_retail_\Interface\AddOns\RaidLogAuto" -Target "$(Get-Location)" + ``` + +3. **Reload** in-game with `/reload` + +## Code Style + +### Formatting +- Indent with **4 spaces** (no tabs) +- No trailing whitespace + +### File Header +Every Lua file should start with: +```lua +------------------------------------------------------------------------------- +-- FileName.lua +-- Brief description +-- +-- Supported versions: Retail, MoP Classic, TBC Anniversary, Cata, Classic +------------------------------------------------------------------------------- +``` + +### Naming Conventions + +| Element | Convention | Example | +|---------|------------|---------| +| Files | PascalCase | `RaidLogAuto_Retail.lua` | +| SavedVariables | PascalCase | `RaidLogAutoDB` | +| Local variables | camelCase | `local isLogging` | +| Functions | PascalCase | `local function ToggleLogging()` | +| Constants | UPPER_SNAKE | `local MAX_RETRIES = 5` | + +### Error Handling +- Use defensive nil checks for optional APIs +- Use `pcall` for APIs that may be missing in some versions +- Prefer `or` fallbacks over runtime version checks + +## Linting + +Run luacheck before submitting changes: + +```bash +luacheck . +luacheck path/to/File.lua # single file for fast feedback +``` + +## Testing + +RaidLogAuto does not have automated tests. Manual testing checklist: + +1. Load the addon in the target game version +2. Test slash commands: `/rla status`, `/rla mythic`, `/rla toggle` +3. Enter and exit a raid instance to verify auto-logging +4. Enable Lua errors: `/console scriptErrors 1` +5. Verify no errors in the error frame + +## Submitting Changes + +1. **Branch** from `master`: + ```bash + git checkout -b feat/your-feature-name + ``` + +2. **Commit** using [Conventional Commits](https://www.conventionalcommits.org/): + ```bash + git commit --no-gpg-sign -m "feat: add mythic+ logging support (#42)" + ``` + +3. **Push** your branch and open a PR against `master` + +4. **Fill out** the PR template and wait for CI checks + +### Branch Naming + +| Prefix | Purpose | Example | +|--------|---------|---------| +| `feat/` | New feature | `feat/19-release-please` | +| `fix/` | Bug fix | `fix/20-logging-error` | +| `docs/` | Documentation | `docs/update-readme` | +| `refactor/` | Code improvement | `refactor/21-core-cleanup` | + +## What Happens After Your PR + +1. **CI** runs luacheck automatically +2. **Review** by a maintainer +3. **Squash merge** into `master` +4. **Release-please** creates a release PR when ready + +Thank you for contributing to RaidLogAuto! diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..cb22779 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,37 @@ +# Security Policy + +## Supported Versions + +Only the latest release is supported with security updates. + +| Version | Supported | +|---------|-----------| +| Latest | Yes | +| Older | No | + +## Reporting a Vulnerability + +If you discover a security vulnerability in RaidLogAuto, please report it +responsibly: + +1. **Email**: Send details to **admin@xerrion.dk** +2. **Do not** open a public GitHub issue for security vulnerabilities +3. Include steps to reproduce and potential impact + +### What to expect + +- Acknowledgment within **7 days** +- Assessment and fix timeline within **14 days** +- Credit in the changelog (unless you prefer anonymity) + +## Scope + +### In scope +- Lua code that could expose sensitive data +- SavedVariables handling that could be exploited +- Any form of external communication or data leakage + +### Out of scope +- World of Warcraft client vulnerabilities +- Blizzard API behavior +- Gameplay exploits unrelated to the addon diff --git a/cliff.toml b/cliff.toml index a18fc20..7e5b650 100644 --- a/cliff.toml +++ b/cliff.toml @@ -1,3 +1,7 @@ +# DEPRECATED: This file is kept for reference during the migration to release-please. +# It will be removed after the first successful release-please release. +# See issue #19. + # git-cliff ~ configuration file # https://git-cliff.org/docs/configuration diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..e911b49 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "packages": { + ".": { + "release-type": "simple", + "include-v-in-tag": false, + "changelog-sections": [ + { "type": "feat", "section": "Features" }, + { "type": "fix", "section": "Bug Fixes" }, + { "type": "refactor", "section": "Code Refactoring" }, + { "type": "doc", "section": "Documentation", "hidden": true }, + { "type": "docs", "section": "Documentation", "hidden": true }, + { "type": "perf", "section": "Performance Improvements" }, + { "type": "style", "section": "Styles" }, + { "type": "test", "section": "Tests" }, + { "type": "ci", "section": "Continuous Integration", "hidden": true }, + { "type": "chore", "section": "Miscellaneous Chores", "hidden": true } + ] + } + } +}