Skip to content

Commit 011efb2

Browse files
committed
make it more LLM agent freindly
1 parent ea8025b commit 011efb2

17 files changed

Lines changed: 1886 additions & 392 deletions

.github/workflows/ci.yml

Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main, master ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ main, master ]
88

99
env:
1010
CARGO_TERM_COLOR: always
@@ -16,26 +16,35 @@ jobs:
1616
runs-on: ${{ matrix.os }}
1717
strategy:
1818
matrix:
19-
os: [ubuntu-latest, windows-latest, macos-latest]
20-
rust: [stable, beta]
19+
os: [ubuntu-latest, windows-latest, macOS-latest]
20+
rust: [stable, beta, nightly]
2121
steps:
2222
- uses: actions/checkout@v4
2323
- name: Install Rust
2424
uses: dtolnay/rust-toolchain@master
2525
with:
2626
toolchain: ${{ matrix.rust }}
27-
- name: Cache dependencies
28-
uses: actions/cache@v3
27+
- name: Cache cargo registry
28+
uses: actions/cache@v4
2929
with:
30-
path: |
31-
~/.cargo/registry
32-
~/.cargo/git
33-
target
34-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
30+
path: ~/.cargo/registry
31+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
32+
- name: Cache cargo index
33+
uses: actions/cache@v4
34+
with:
35+
path: ~/.cargo/git
36+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
37+
- name: Cache cargo build
38+
uses: actions/cache@v4
39+
with:
40+
path: target
41+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
3542
- name: Build
3643
run: cargo build --verbose
3744
- name: Run tests
3845
run: cargo test --verbose
46+
- name: Run doc tests
47+
run: cargo test --doc --verbose
3948

4049
fmt:
4150
name: Rustfmt
@@ -45,8 +54,7 @@ jobs:
4554
- uses: dtolnay/rust-toolchain@stable
4655
with:
4756
components: rustfmt
48-
- name: Check formatting
49-
run: cargo fmt -- --check
57+
- run: cargo fmt --all -- --check
5058

5159
clippy:
5260
name: Clippy
@@ -57,24 +65,42 @@ jobs:
5765
with:
5866
components: clippy
5967
- name: Run clippy
60-
run: cargo clippy -- -D warnings -W clippy::all -W clippy::pedantic -W clippy::nursery -A clippy::module_name_repetitions
68+
run: cargo clippy --all-targets --all-features -- -D warnings
6169

62-
doc:
63-
name: Documentation
70+
coverage:
71+
name: Code coverage
6472
runs-on: ubuntu-latest
6573
steps:
6674
- uses: actions/checkout@v4
6775
- uses: dtolnay/rust-toolchain@stable
68-
- name: Check documentation
69-
run: cargo doc --no-deps --document-private-items
70-
env:
71-
RUSTDOCFLAGS: -D warnings
76+
- name: Install tarpaulin
77+
run: cargo install cargo-tarpaulin
78+
- name: Generate code coverage
79+
run: cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml
80+
- name: Upload coverage to Codecov
81+
uses: codecov/codecov-action@v4
82+
with:
83+
file: cobertura.xml
84+
fail_ci_if_error: true
85+
86+
security_audit:
87+
name: Security audit
88+
runs-on: ubuntu-latest
89+
steps:
90+
- uses: actions/checkout@v4
91+
- uses: rustsec/audit-check@v1.4.1
92+
with:
93+
token: ${{ secrets.GITHUB_TOKEN }}
7294

73-
publish-dry-run:
74-
name: Publish dry run
95+
examples:
96+
name: Examples
7597
runs-on: ubuntu-latest
7698
steps:
7799
- uses: actions/checkout@v4
78100
- uses: dtolnay/rust-toolchain@stable
79-
- name: Cargo publish dry run
80-
run: cargo publish --dry-run
101+
- name: Run basic example
102+
run: cargo run --example basic
103+
- name: Run batch validation example
104+
run: cargo run --example batch_validation
105+
- name: Run LLM-friendly example
106+
run: cargo run --example llm_friendly

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
publish:
13+
name: Publish to crates.io
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: dtolnay/rust-toolchain@stable
18+
- name: Check version
19+
run: |
20+
VERSION="${GITHUB_REF#refs/tags/v}"
21+
CARGO_VERSION=$(grep "^version" Cargo.toml | sed 's/.*"\(.*\)".*/\1/')
22+
if [ "$VERSION" != "$CARGO_VERSION" ]; then
23+
echo "Git tag version ($VERSION) does not match Cargo.toml version ($CARGO_VERSION)"
24+
exit 1
25+
fi
26+
- name: Run tests
27+
run: cargo test --all
28+
- name: Publish to crates.io
29+
run: cargo publish --token ${{ secrets.CRATES_TOKEN }}
30+
env:
31+
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }}
32+
33+
create-release:
34+
name: Create GitHub Release
35+
runs-on: ubuntu-latest
36+
needs: publish
37+
steps:
38+
- uses: actions/checkout@v4
39+
- name: Extract version
40+
id: version
41+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
42+
- name: Extract changelog
43+
id: changelog
44+
run: |
45+
VERSION="${GITHUB_REF#refs/tags/v}"
46+
CHANGELOG=$(awk "/## \[$VERSION\]/{flag=1;next}/## \[/{flag=0}flag" CHANGELOG.md)
47+
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
48+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
49+
echo "EOF" >> $GITHUB_OUTPUT
50+
- name: Create Release
51+
uses: actions/create-release@v1
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
with:
55+
tag_name: ${{ github.ref }}
56+
release_name: Release ${{ steps.version.outputs.VERSION }}
57+
body: |
58+
## Changes in this Release
59+
${{ steps.changelog.outputs.CHANGELOG }}
60+
61+
## Installation
62+
```toml
63+
[dependencies]
64+
credify = "${{ steps.version.outputs.VERSION }}"
65+
```
66+
67+
See [CHANGELOG.md](https://github.com/hamzeghalebi/credify/blob/main/CHANGELOG.md) for the full changelog.
68+
draft: false
69+
prerelease: false

CHANGELOG.md

Lines changed: 46 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,51 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.1.0] - 2024-01-30
8+
## [Unreleased]
9+
10+
## [0.2.0] - 2025-07-31
11+
12+
### Added
13+
- `validate_for_llm()` function that returns structured string output for LLM consumption
14+
- `validate_for_llm_async()` async version of the LLM validation function
15+
- New example `llm_simple.rs` demonstrating the LLM validation functions
16+
- Chrono dependency for timestamp generation in validation reports
17+
18+
### Changed
19+
- Enhanced `validate_for_llm()` and `validate_for_llm_async()` output to be extremely verbose with:
20+
- Timestamp and detailed headers
21+
- Severity levels for each error type
22+
- Detailed explanations (2-3 sentences per scenario)
23+
- 5-7 suggested actions for each error type
24+
- Recommended next steps
25+
- Additional metadata like HTTP status codes and LinkedIn response types
26+
- Improved documentation with comprehensive examples of the new verbose output format
27+
28+
## [0.1.0] - 2025-07-31
929

1030
### Added
11-
- Initial release of linkedin-profile-validator
12-
- Format validation for LinkedIn profile URLs without network calls
13-
- Full validation with network requests to check profile existence
14-
- Both synchronous (blocking) and asynchronous APIs
15-
- Comprehensive error handling for different failure scenarios:
16-
- Invalid URL format
17-
- Non-LinkedIn domains
18-
- Non-profile URLs (e.g., company pages)
19-
- Profile not found (404)
20-
- Authentication required (LinkedIn's anti-bot protection)
21-
- Support for handling LinkedIn's rate limiting (status 999)
22-
- Example usage in main.rs
23-
- Comprehensive test suite
24-
25-
### Technical Details
26-
- Built with reqwest for HTTP requests
27-
- Uses regex for URL pattern matching
28-
- Implements proper error types with thiserror
29-
- Supports Rust 2021 edition (minimum Rust 1.70)
31+
- Initial release of Credify (formerly linkedin-profile-validator)
32+
- LinkedIn profile URL format validation
33+
- LinkedIn profile existence verification
34+
- Synchronous API with `LinkedInValidator`
35+
- Asynchronous API with `validate_linkedin_url_async`
36+
- LLM-friendly structured error messages
37+
- Comprehensive error handling with no panics
38+
- Examples for basic usage, batch validation, and LLM integration
39+
- Full test coverage
40+
- Documentation and examples
41+
42+
### Changed
43+
- Renamed project from `linkedin-profile-validator` to `credify`
44+
- Refactored error handling to never panic
45+
- Enhanced error messages with structured format for LLM agents
46+
- Updated `LinkedInValidator::new()` to return `Result` type
47+
48+
### Security
49+
- No sensitive data is logged or exposed
50+
- Safe handling of all network errors
51+
- Proper timeout configuration for HTTP requests
52+
53+
[Unreleased]: https://github.com/hamzeghalebi/credify/compare/v0.2.0...HEAD
54+
[0.2.0]: https://github.com/hamzeghalebi/credify/compare/v0.1.0...v0.2.0
55+
[0.1.0]: https://github.com/hamzeghalebi/credify/releases/tag/v0.1.0

0 commit comments

Comments
 (0)