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
30 changes: 21 additions & 9 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,25 @@ jobs:
exit 1
fi

- name: Print Modified Files
- name: Check for Missing Final Newlines
run: |
FILES=$(git ls-files --modified)
if [[ ! -z "$FILES" ]]; then
echo "The following files have incorrect trailing newlines:"
echo "$FILES"
echo "Please fix them using:"
echo -e 'if [[ -f "$1" ]]; then\n echo -n "$1"\n if (diff /dev/null "$1" || true) | tail -1 | grep -q "^\\ No newline"; then\n echo >> "$1"\n echo "...fixed"\n else\n echo ""\n fi\nfi'
false
fi
python3 - <<'PY'
import pathlib
import subprocess
import sys

missing = []
for name in subprocess.check_output(["git", "ls-files"], text=True).splitlines():
path = pathlib.Path(name)
if not path.is_file():
continue
data = path.read_bytes()
if data and not data.endswith(b"\n"):
missing.append(name)

if missing:
print("The following files are missing a trailing newline:")
for name in missing:
print(name)
sys.exit(1)
PY
2 changes: 1 addition & 1 deletion .github/workflows/lint-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/setup-node@v6

- name: Install Prettier and markdownlint
run: npm install -g prettier markdownlint-cli
run: npm install -g prettier@3.5.3 markdownlint-cli@0.45.0

- name: Run Markdown Lint
run: markdownlint "**/*.md"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: actions/setup-node@v6

- name: Install Prettier
run: npm install -g prettier
run: npm install -g prettier@3.5.3

- name: Check YAML Formatting
run: prettier --check "**/*.{yml,yaml}" --ignore-path .prettierignore
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
AllCops:
# Avoid RuboCop warnings when new cops are released.
NewCops: disable
SuggestExtensions: false
TargetRubyVersion: 3.2
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ git clone https://github.com/paradedb/rails-paradedb.git
cd rails-paradedb

bundle install
prek install -f
pre-commit install -f
```

### Running Tests

Unit tests:
Unit specs (DB-backed; starts local ParadeDB unless `CI` is set):

```bash
bash scripts/run_unit_tests.sh
Expand All @@ -59,13 +59,13 @@ bash scripts/run_unit_tests.sh spec/user_api_unit_spec.rb

### Linting and Formatting

This repository enforces markdown/style checks via `prek` and
This repository enforces markdown/style checks via `pre-commit` and
`.pre-commit-config.yaml`.
Common commands:

```bash
prek run --all-files
prek install -f
pre-commit run --all-files
pre-commit install -f
```

If you change Ruby code, keep style consistent with existing files and tests.
Expand Down
5 changes: 1 addition & 4 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"

echo "==> Installing dependencies"
if [[ "${PARADEDB_WITH_PG:-0}" == "1" ]]; then
echo " PARADEDB_WITH_PG=1 (installing pg gem)"
fi

bundle install

echo ""
echo "==> Done"
echo "Run unit tests: scripts/run_unit_tests.sh"
echo "Run integration tests (requires ParadeDB): PARADEDB_WITH_PG=1 scripts/run_integration_tests.sh"
echo "Run integration tests (requires ParadeDB): scripts/run_integration_tests.sh"
2 changes: 1 addition & 1 deletion scripts/run_paradedb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else
RUNNING=0
fi

IMAGE="${PARADEDB_IMAGE:-paradedb/paradedb:latest-pg18}"
IMAGE="${PARADEDB_IMAGE:-paradedb/paradedb:0.21.10-pg18}"
CONTAINER_NAME="${PARADEDB_CONTAINER_NAME:-paradedb-integration}"

# Allow overriding connection details via env vars
Expand Down
Loading