Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# EditorConfig helps maintain consistent coding styles across different editors
# https://editorconfig.org/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

# Markdown files
[*.md]
trim_trailing_whitespace = false

# Lua files
[*.lua]
indent_size = 2

# VimL files
[*.vim]
indent_size = 2

# YAML files
[*.{yml,yaml}]
indent_size = 2

# Shell scripts
[*.sh]
indent_size = 2

# Make files
[Makefile]
indent_style = tab
111 changes: 111 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#!/bin/bash

# Pre-commit hook for Rovo Dev plugin
# 1. Formats Lua files with StyLua
# 2. Runs linting with luacheck
# 3. Runs tests to ensure code quality

# ======== Style Formatting ========
# Check if stylua is installed
if ! command -v stylua &> /dev/null; then
echo "Error: stylua is not installed. Please install it to format Lua code."
echo "You can install it from: https://github.com/JohnnyMorganz/StyLua"
exit 1
fi

# Check for luacheck
if ! command -v luacheck &> /dev/null; then
echo "Warning: luacheck is not installed. Skipping lint checks."
echo "You can install it using luarocks: luarocks install luacheck"
HAS_LUACHECK=0
else
HAS_LUACHECK=1
fi

# Get all staged Lua files
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.lua$')

if [ -n "$STAGED_FILES" ]; then
echo "Running StyLua on staged Lua files..."

# Format all staged Lua files
for FILE in $STAGED_FILES; do
stylua "$FILE"
git add "$FILE"
done

echo "Lua files have been formatted and staged."

# Run luacheck if available
if [ "$HAS_LUACHECK" -eq 1 ]; then
echo "Running luacheck on staged Lua files..."
LINT_ISSUES=0
FIXABLE_ISSUES=0
FIXED_FILES=""

# First check for issues that we can automatically fix
for FILE in $STAGED_FILES; do
# Auto-fix trailing whitespace
if grep -q "[[:space:]]$" "$FILE"; then
sed -i 's/[[:space:]]*$//' "$FILE"
FIXABLE_ISSUES=1
FIXED_FILES="$FIXED_FILES $FILE"
fi

# Auto-fix line endings (ensure LF)
if file "$FILE" | grep -q "CRLF"; then
dos2unix "$FILE" 2>/dev/null
FIXABLE_ISSUES=1
FIXED_FILES="$FIXED_FILES $FILE"
fi
done

# If we fixed any issues, add them back to staging
if [ "$FIXABLE_ISSUES" -eq 1 ]; then
echo "Fixed some linting issues automatically in:$FIXED_FILES"
for FILE in $FIXED_FILES; do
git add "$FILE"
done
fi

# Now run the full luacheck to see if there are remaining issues
for FILE in $STAGED_FILES; do
luacheck "$FILE"
if [ $? -ne 0 ]; then
LINT_ISSUES=1
fi
done

if [ "$LINT_ISSUES" -eq 1 ]; then
echo "Error: Lua lint issues found that couldn't be fixed automatically."
echo "Please fix the remaining issues before committing."
echo "You can bypass this check with git commit --no-verify"
exit 1
fi
fi

# ======== Run Tests ========
echo "Running tests to ensure code quality..."

# Find the project root directory (where .git is)
PROJECT_ROOT=$(git rev-parse --show-toplevel)

# Change to the project root
cd "$PROJECT_ROOT" || exit 1

# Run the tests using relative path from project root
TEST_SCRIPT="$PROJECT_ROOT/scripts/test.sh"
echo "Running test script at: $TEST_SCRIPT"
bash "$TEST_SCRIPT"

# Check if tests passed
if [ $? -ne 0 ]; then
echo "❌ Tests failed! Commit aborted."
echo "Please fix the test failures before committing."
exit 1
fi

echo "✅ All tests passed. Proceeding with commit."
fi

exit 0
60 changes: 60 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
name: Bug report
about: Create a report to help improve Rovo-Dev.nvim
title: '[BUG] '
labels: bug
assignees: ''
---

## Bug Description

A clear and concise description of what the bug is.

## Steps To Reproduce

1. Go to '...'
2. Run command '....'
3. See error

## Expected Behavior

A clear and concise description of what you expected to happen.

## Screenshots

If applicable, add screenshots to help explain your problem.

## Environment

- OS: [e.g. Ubuntu 22.04, macOS 13.0, Windows 11]
- Neovim version: [e.g. 0.9.0]
- Rovo Dev CLI version: [e.g. 1.0.0]
- Plugin version or commit hash: [e.g. main branch as of date]

## Plugin Configuration

```lua
-- Your Rovo-Dev.nvim configuration here
require("rovo-dev").setup({
-- Your configuration options
})
```

## Additional Context

Add any other context about the problem here, such as:
- Error messages from Neovim (:messages)
- Logs from the Rovo Dev terminal
- Any recent changes to your setup

## Minimal Reproduction

For faster debugging, try to reproduce the issue using our minimal configuration:

1. Create a new directory for testing
2. Copy `tests/minimal-init.lua` from this repo to your test directory
3. Start Neovim with this minimal config:
```bash
nvim --clean -u minimal-init.lua
```
4. Try to reproduce the issue with this minimal setup
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Questions & Discussions
url: https://github.com/atlassian-labs/rovo-dev.nvim/discussions
about: Please ask and answer questions here.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Feature request
about: Suggest an idea for Rovo-Dev.nvim
title: '[FEATURE] '
labels: enhancement
assignees: ''
---

## Problem Statement

Is your feature request related to a problem? Please describe.
Example: I'm always frustrated when [...]

## Proposed Solution

A clear and concise description of what you want to happen.

## Alternative Solutions

A clear and concise description of any alternative solutions or features you've considered.

## Use Case

Describe how this feature would be used and who would benefit from it.

## Additional Context

Add any other context, screenshots, or examples about the feature request here.
37 changes: 37 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Pull Request

## Description

Please provide a clear description of what this PR does and why it should be merged.

## Type of Change

Please check the options that are relevant:

- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Other (please describe):

## Checklist

Please check all that apply:

- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document
- [ ] My code follows the style guidelines of this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have tested with the actual Rovo Dev CLI tool
- [ ] I have tested in different environments (if applicable)

## Screenshots (if applicable)

Add screenshots to help explain your changes if they include visual elements.

## Additional Notes

Add any other context about the PR here.
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
neovim-version: [stable, nightly]

name: Test with Neovim ${{ matrix.neovim-version }}
steps:
- uses: actions/checkout@v3

- name: Install Neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.neovim-version }}

- name: Create cache directories
run: |
mkdir -p ~/.luarocks
mkdir -p ~/.local/share/nvim/site/pack

- name: Cache plugin dependencies
uses: actions/cache@v3
with:
path: ~/.local/share/nvim/site/pack
key: ${{ runner.os }}-nvim-plugins-${{ hashFiles('**/test.sh') }}-${{ matrix.neovim-version }}
restore-keys: |
${{ runner.os }}-nvim-plugins-

- name: Install dependencies
run: |
mkdir -p ~/.local/share/nvim/site/pack/vendor/start
if [ ! -d "$HOME/.local/share/nvim/site/pack/vendor/start/plenary.nvim" ]; then
echo "Cloning plenary.nvim..."
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
else
echo "plenary.nvim directory already exists, updating..."
cd ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim && git pull origin master
fi

- name: Verify test directory structure
run: |
ls -la ./tests/
ls -la ./tests/spec/

- name: Display Neovim version
run: nvim --version

- name: Run tests
run: |
export PLUGIN_ROOT="$(pwd)"
./scripts/test.sh
continue-on-error: false
# Documentation validation has been moved to the dedicated docs.yml workflow
Loading