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
63 changes: 63 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
# Clang-Tidy configuration for RetDec
# This configuration focuses on bug detection, modernization, and performance

Checks: >
bugprone-*,
modernize-*,
performance-*,
readability-*,
clang-analyzer-*,
cppcoreguidelines-*,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-readability-identifier-length,
-readability-function-cognitive-complexity,
-readability-magic-numbers,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-avoid-non-const-global-variables

# Naming conventions based on RetDec's existing style
CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: camelBack
- key: readability-identifier-naming.MethodCase
value: camelBack
- key: readability-identifier-naming.VariableCase
value: camelBack
- key: readability-identifier-naming.ParameterCase
value: camelBack
- key: readability-identifier-naming.PrivateMemberPrefix
value: '_'
- key: readability-identifier-naming.ProtectedMemberPrefix
value: '_'
- key: readability-identifier-naming.ConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.MacroCase
value: UPPER_CASE
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
value: '1'
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: '0'

WarningsAsErrors: ''
HeaderFilterRegex: '.*retdec.*'
FormatStyle: file
...
97 changes: 97 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
## Description

<!-- Provide a clear and concise description of your changes -->

## Type of Change

<!-- Check all that apply -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Refactoring (code improvements without changing functionality)
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Test addition or update
- [ ] Build/CI changes

## Related Issues

<!-- Link to related issues using #issue_number -->

Fixes #
Closes #
Related to #

## Motivation and Context

<!-- Why is this change needed? What problem does it solve? -->

## How Has This Been Tested?

<!-- Describe the tests you ran to verify your changes -->

- [ ] Unit tests pass (`ctest`)
- [ ] Integration tests pass (if applicable)
- [ ] Manual testing performed
- [ ] Tested on multiple platforms (specify):
- [ ] Linux
- [ ] Windows
- [ ] macOS

**Test Configuration**:
- OS:
- Compiler:
- CMake version:
- Build type (Debug/Release):

## Checklist

<!-- Check all items before submitting -->

### Code Quality
- [ ] My code follows the code style of this project (see [CONTRIBUTING.md](../CONTRIBUTING.md))
- [ ] Code is formatted with `clang-format`
- [ ] No new compiler warnings introduced
- [ ] Code passes static analysis checks (`clang-tidy`)

### Testing
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally
- [ ] I have tested on both Debug and Release builds

### Documentation
- [ ] I have updated the documentation accordingly
- [ ] I have added/updated Doxygen comments for public APIs
- [ ] I have updated CHANGELOG.md with my changes
- [ ] README.md is updated if user-facing changes were made

### Process
- [ ] My branch is up to date with the master branch
- [ ] I have rebased my commits if needed
- [ ] Commit messages follow project guidelines
- [ ] No merge conflicts

## Screenshots (if applicable)

<!-- Add screenshots to help explain your changes -->

## Performance Impact

<!-- If applicable, describe the performance impact of your changes -->

- [ ] No performance impact
- [ ] Performance improved (describe):
- [ ] Performance may be affected (describe and justify):

## Additional Notes

<!-- Any additional information that reviewers should know -->

## Reviewer Notes

<!-- Notes for reviewers (optional) -->

---

**By submitting this pull request, I confirm that my contribution is made under the terms of the MIT License and I have the right to submit it under this license.**
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Dependabot configuration for RetDec
# Automatically checks for updates to dependencies and GitHub Actions

version: 2
updates:
# Monitor GitHub Actions for updates
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "ci"
include: "scope"

# Monitor CMake dependencies (if using FetchContent in future)
# Note: Dependabot doesn't directly support CMake ExternalProject
# Manual monitoring still required for external dependencies
62 changes: 62 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
## Code Quality Checks for RetDec

name: Code Quality

on:
pull_request:
branches:
- master
push:
branches:
- master
- 'test-*'

jobs:
clang-format-check:
name: Check Code Formatting
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format-14

- name: Check C++ code formatting
run: |
# Find all C++ source and header files
FILES=$(find src include tests -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' -o -name '*.c' \) 2>/dev/null || true)

if [ -z "$FILES" ]; then
echo "No C++ files found to check"
exit 0
fi

# Check formatting (dry-run)
echo "Checking code formatting..."
FORMAT_ISSUES=0

for file in $FILES; do
if ! clang-format-14 --dry-run --Werror "$file" 2>&1; then
echo "❌ Formatting issue in: $file"
FORMAT_ISSUES=$((FORMAT_ISSUES + 1))
fi
done

if [ $FORMAT_ISSUES -gt 0 ]; then
echo ""
echo "❌ Found $FORMAT_ISSUES file(s) with formatting issues"
echo ""
echo "To fix formatting issues, run:"
echo " find src include tests -type f \( -name '*.cpp' -o -name '*.h' \) -exec clang-format-14 -i {} \;"
exit 1
else
echo "✅ All files are properly formatted"
fi

- name: Format Check Summary
if: failure()
run: |
echo "::error::Code formatting check failed. Please format your code using clang-format-14"
81 changes: 81 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# CodeQL Security Analysis for RetDec
# Automatically scans code for security vulnerabilities

name: "CodeQL Security Analysis"

on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
# Run every Monday at 9 AM UTC
- cron: '0 9 * * 1'

jobs:
analyze:
name: Analyze Code for Security Issues
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
cmake \
build-essential \
libssl-dev \
python3 \
autoconf \
automake \
libtool \
pkg-config \
m4 \
zlib1g-dev

# Initialize CodeQL tools for scanning
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# Specify queries to run:
# - security-extended: All default security queries plus extended checks
# - security-and-quality: Security plus code quality
queries: security-extended

# Configure the build for CodeQL analysis
- name: Configure Build
run: |
mkdir build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DRETDEC_TESTS=OFF \
-DRETDEC_DOC=OFF

# Build the codebase
- name: Build Project
run: |
cd build
# Build with multiple cores but limit to avoid OOM
make -j2

# Perform CodeQL Analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
Loading