Skip to content
This repository was archived by the owner on Sep 12, 2025. It is now read-only.
Merged
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
3 changes: 2 additions & 1 deletion .credo.exs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
{Credo.Check.Consistency.ExceptionNames, []},
{Credo.Check.Consistency.LineEndings, []},
{Credo.Check.Consistency.ParameterPatternMatching, []},
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, []},
{Credo.Check.Consistency.SpaceAroundOperators, []},
{Credo.Check.Consistency.SpaceInParentheses, []},
{Credo.Check.Consistency.TabsOrSpaces, []},
Expand Down Expand Up @@ -102,7 +103,7 @@
{Credo.Check.Readability.ModuleDoc, []},
{Credo.Check.Readability.ModuleNames, []},
{Credo.Check.Readability.ParenthesesInCondition, []},
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, []},
# {Credo.Check.Readability.ParenthesesOnZeroArityDefs, []},
{Credo.Check.Readability.PipeIntoAnonymousFunctions, []},
{Credo.Check.Readability.PredicateFunctionNames, []},
{Credo.Check.Readability.PreferImplicitTry, []},
Expand Down
16 changes: 14 additions & 2 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,20 @@ echo "🔍 Running pre-push validation pipeline..."
# Run formatting check
echo "📝 Checking code formatting..."
if ! mix format --check-formatted; then
echo "❌ Code formatting check failed. Run 'mix format' to fix."
exit 1
echo "❌ Code formatting issues found. Running 'mix format' to fix..."
mix format

# Check if files were actually changed by formatting
if ! git diff --quiet; then
echo "📝 Code has been automatically formatted."
echo "🔄 Please commit the formatting changes and push again:"
echo " git add ."
echo " git commit -m 'Auto-format code with mix format'"
echo " git push"
exit 1
else
echo "✅ No files needed formatting changes."
fi
fi

# Run regression tests (critical - these should never break)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ jobs:
regression-tests:
name: Regression Test Suite
runs-on: ubuntu-latest
needs: test
needs: compile

steps:
- name: Checkout code
Expand Down
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,39 @@ An Elixir implementation of SCXML (State Chart XML) state charts with a focus on
- Expression evaluation and datamodel support
- Enhanced validation for complex SCXML constructs

## Future Extensions

### **Feature-Based Test Validation System**
An enhancement to improve test accuracy by validating that tests actually exercise intended SCXML functionality:

**Goal**: Prevent false positive tests where unsupported features are silently ignored, leading to "passing" tests that don't actually validate the intended behavior.

**Proposed Enhancement**:
```elixir
# Example test with feature requirements
defmodule SCIONTest.SendIdlocation.Test0Test do
use SC.Case
@tag :scion
@required_features [:datamodel, :send_elements, :onentry_actions, :conditional_transitions]

test "test0" do
# Test implementation that requires these features
end
end
```

**Implementation Phases**:
1. **Feature Detection Phase** - Analyze SCXML documents to identify used features
2. **Feature Validation Phase** - Fail tests when required features are unsupported
3. **Test Annotation Phase** - Add `@required_features` tags to existing tests
4. **Incremental Implementation** - Enable feature flags as capabilities are added

**Benefits**:
- Eliminates false positive test results
- Provides clear roadmap of which features tests depend on
- Enables progressive test suite expansion as features are implemented
- Improves test reliability and developer confidence

## Installation

Add `sc` to your list of dependencies in `mix.exs`:
Expand Down
Loading