Haskell Vulnerability Checks
Tools for checking vulnerabilities in Haskell code.
Cabal Outdated
1# Check outdated dependencies
2cabal outdated
3
4# Update dependencies
5cabal update
6cabal install --only-dependencies
HLint
1# Install
2cabal install hlint
3
4# Run on project
5hlint src/
6
7# Apply suggestions
8hlint src/ --refactor --refactor-options="-i"
9
10# Generate report
11hlint src/ --report
Weeder (Dead Code Detection)
1# Install
2cabal install weeder
3
4# Run
5weeder
Stan (Static Analyzer)
1# Install
2cabal install stan
3
4# Run
5stan
CI/CD Integration
1# GitHub Actions
2name: Security Scan
3
4on: [push, pull_request]
5
6jobs:
7 security:
8 runs-on: ubuntu-latest
9 steps:
10 - uses: actions/checkout@v3
11
12 - name: Set up Haskell
13 uses: haskell/actions/setup@v2
14 with:
15 ghc-version: '9.4'
16 cabal-version: '3.10'
17
18 - name: Cache
19 uses: actions/cache@v3
20 with:
21 path: |
22 ~/.cabal
23 dist-newstyle
24 key: ${{ runner.os }}-cabal-${{ hashFiles('**/*.cabal') }}
25
26 - name: Install dependencies
27 run: cabal build --only-dependencies
28
29 - name: Run HLint
30 run: |
31 cabal install hlint
32 hlint src/
33
34 - name: Run Weeder
35 run: |
36 cabal install weeder
37 weeder
Related Snippets
- C/C++ Code Smells
Common code smells in C/C++ and how to fix them. Memory Leaks 1// ❌ Bad 2void … - C/C++ Secure Coding
Secure coding practices for C/C++ applications. Buffer Overflow Prevention 1// ❌ … - C/C++ Vulnerability Checks
Tools for checking vulnerabilities in C/C++ code. Valgrind 1# Install 2sudo apt … - Common Antipatterns
Common software antipatterns to avoid across all languages and architectures. … - Common Code Smells
Common code smells to watch for during code reviews with examples and fixes. … - Developer Pre-Submission Checklist
Comprehensive checklist for developers before submitting a pull request. Code … - Go Code Smells
Common code smells in Go and how to fix them. Ignoring Errors 1// ❌ Bad 2result, … - Go Secure Coding
Secure coding practices for Go applications. SQL Injection Prevention 1// ❌ … - Go Vulnerability Checks
Tools for checking vulnerabilities in Go code. Govulncheck 1# Install 2go … - Haskell Code Smells
Common code smells in Haskell and how to fix them. Partial Functions 1-- ❌ Bad: … - Haskell Secure Coding
Secure coding practices for Haskell applications. SQL Injection Prevention 1-- ❌ … - Python Code Smells
Common code smells in Python and how to fix them. Mutable Default Arguments 1# ❌ … - Python Secure Coding
Secure coding practices for Python applications. SQL Injection Prevention 1# ❌ … - Python Vulnerability Checks
Tools for checking vulnerabilities in Python code. Safety - Dependency Scanner … - Reviewer Checklist
Comprehensive checklist for code reviewers to ensure thorough and constructive … - Rust Code Smells
Common code smells in Rust and how to fix them. Unwrap/Expect Abuse 1// ❌ Bad … - Rust Secure Coding
Secure coding practices for Rust applications. SQL Injection Prevention 1// ❌ … - Rust Vulnerability Checks
Tools for checking vulnerabilities in Rust code. Cargo Audit 1# Install 2cargo … - TypeScript Code Smells
Common code smells in TypeScript and how to fix them. Using any 1// ❌ Bad … - TypeScript Secure Coding
Secure coding practices for TypeScript applications. XSS Prevention 1// ❌ … - TypeScript Vulnerability Checks
Tools for checking vulnerabilities in TypeScript/JavaScript code. npm audit 1# …