Skip to content

Commit fe85df2

Browse files
glauberlimaclaude
andauthored
Improve/change detection logic (#17)
* Improve change detection to ignore timestamp headers Modify the change detection logic to compare only the actual site listings, ignoring the timestamp information in file headers. This prevents unnecessary commits when the site list hasn't changed but the header timestamp has been updated. The workflow now: - Extracts only site rules (lines starting with || for adblock, 0.0.0.0 for hosts) - Compares only these listings with the previous version - Ignores header metadata including timestamps 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * refactor: Rename lists directory to data and hosts.txt to hosts - Rename lists/ directory to data/ - Rename hosts.txt file to hosts (remove extension) - Update all references in README.md, GEMINI.md, and GitHub workflows 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * chore: removed useless files * refactor: Minimize configuration files removing unused file type rules Remove bloated rules for file types that don't exist in this Rust project: - .editorconfig: Remove Makefile, JavaScript, TypeScript, HTML, CSS, Shell - .gitignore: Remove .env, .github artifacts, build/, docs/, duplicate bins - .gitattributes: Remove 32 lines of unused binary file rules Consolidate with wildcards (*.{yml,yaml}, *.{tmp,temp,bak,backup}, etc) Results: 181 → 90 lines (-50%), keep 100% functionality 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent b361915 commit fe85df2

File tree

15 files changed

+35
-242
lines changed

15 files changed

+35
-242
lines changed

.editorconfig

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,10 @@ indent_size = 4
2020
trim_trailing_whitespace = false
2121
max_line_length = 100
2222

23-
[*.yml]
23+
[*.{yml,yaml}]
2424
indent_style = space
2525
indent_size = 2
2626

27-
[*.yaml]
28-
indent_style = space
29-
indent_size = 2
30-
31-
[Makefile]
32-
indent_style = tab
33-
3427
[*.json]
3528
indent_style = space
36-
indent_size = 2
37-
38-
[*.js]
39-
indent_style = space
40-
indent_size = 2
41-
42-
[*.ts]
43-
indent_style = space
44-
indent_size = 2
45-
46-
[*.html]
47-
indent_style = space
48-
indent_size = 2
49-
50-
[*.css]
51-
indent_style = space
52-
indent_size = 2
53-
54-
[*.sh]
55-
end_of_line = lf
56-
indent_style = space
57-
indent_size = 4
29+
indent_size = 2

.gitattributes

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,23 @@
1-
# Set default behavior to automatically normalize line endings
1+
# Default behavior
22
* text=auto
33

4-
# Rust source files
4+
# Rust and configuration
55
*.rs text eol=lf
66
*.toml text eol=lf
7+
Cargo.lock text eol=lf
78

8-
# Documentation
9+
# Documentation and text
910
*.md text eol=lf
1011
*.txt text eol=lf
1112

12-
# Configuration files
13-
*.yml text eol=lf
14-
*.yaml text eol=lf
13+
# Configuration formats
14+
*.{yml,yaml} text eol=lf
1515
*.json text eol=lf
1616
*.editorconfig text eol=lf
1717

18-
# Shell scripts
19-
*.sh text eol=lf
20-
21-
# Makefiles
22-
Makefile text eol=lf
23-
24-
# Binary files (don't normalize)
25-
*.png binary
26-
*.jpg binary
27-
*.jpeg binary
28-
*.gif binary
29-
*.ico binary
30-
*.svg binary
31-
*.woff binary
32-
*.woff2 binary
33-
*.ttf binary
34-
*.eot binary
35-
36-
# Archives
37-
*.zip binary
38-
*.tar.gz binary
39-
*.7z binary
40-
41-
# Executables
42-
*.exe binary
43-
*.dll binary
44-
*.so binary
45-
*.dylib binary
46-
47-
# Lock files
48-
Cargo.lock text eol=lf
49-
50-
# Git files
18+
# Git and version control
5119
.gitignore text eol=lf
5220
.gitattributes text eol=lf
5321

54-
# CI/CD files
22+
# CI/CD
5523
.github/** text eol=lf

.github/workflows/create-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
./procon-cli generate --output adblock.txt
9999
100100
# Gera a lista no formato hosts
101-
./procon-cli generate --format hosts --output hosts.txt
101+
./procon-cli generate --format hosts --output hosts
102102
```
103103
files: artifacts/**/*
104104
draft: false

.github/workflows/generate-lists.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,34 @@ jobs:
4040
4141
- name: Generate lists with Procon CLI
4242
run: |
43-
cd lists
43+
cd data
4444
../procon-cli generate --format adblock --output adblock.txt
45-
../procon-cli generate --format hosts --output hosts.txt
45+
../procon-cli generate --format hosts --output hosts
4646
4747
- name: Check for changes
4848
id: check_changes
4949
run: |
50-
if [ -n "$(git status --porcelain lists/)" ]; then
50+
# Extract only site listings (ignore headers with timestamps)
51+
grep '^||' data/adblock.txt > /tmp/adblock_sites.txt 2>/dev/null || true
52+
grep '^0\.0\.0\.0' data/hosts > /tmp/hosts_sites.txt 2>/dev/null || true
53+
54+
# Get previous versions from git
55+
git show HEAD:data/adblock.txt | grep '^||' > /tmp/adblock_sites_old.txt 2>/dev/null || true
56+
git show HEAD:data/hosts | grep '^0\.0\.0\.0' > /tmp/hosts_sites_old.txt 2>/dev/null || true
57+
58+
# Compare only the site listings (ignore timestamp in headers)
59+
if ! diff -q /tmp/adblock_sites.txt /tmp/adblock_sites_old.txt >/dev/null 2>&1 || \
60+
! diff -q /tmp/hosts_sites.txt /tmp/hosts_sites_old.txt >/dev/null 2>&1; then
5161
echo "changes=true" >> $GITHUB_OUTPUT
52-
echo "📝 Changes detected in lists"
62+
echo "📝 Changes detected in site listings"
5363
else
5464
echo "changes=false" >> $GITHUB_OUTPUT
55-
echo "✅ No changes detected in lists"
65+
echo "✅ No changes in site listings (only timestamp updated)"
5666
fi
5767
5868
- name: Commit and push changes
5969
if: steps.check_changes.outputs.changes == 'true'
6070
run: |
61-
git add lists/adblock.txt lists/hosts.txt
71+
git add data/adblock.txt data/hosts
6272
git commit -m "📋 Update lists - $(date +"%d/%m/%Y %H:%M:%S (GMT%:z)")"
6373
git push

.gitignore

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,51 +19,20 @@ ehthumbs.db
1919
Thumbs.db
2020

2121
# Temporary files
22-
*.tmp
23-
*.temp
24-
*.bak
25-
*.backup
22+
*.{tmp,temp,bak,backup}
2623

2724
# Log files
2825
*.log
2926
logs/
3027

31-
# Environment files
32-
.env
33-
.env.local
34-
.env.*.local
35-
3628
# Test coverage
3729
*.profraw
3830
coverage/
3931

40-
# Build artifacts from various tools
41-
build/
42-
dist/
43-
*.exe
44-
*.dll
45-
*.so
46-
*.dylib
47-
48-
# Package files
49-
*.deb
50-
*.rpm
51-
*.tar.gz
52-
*.zip
53-
54-
# CI/CD artifacts
55-
.github/artifacts/
56-
.github/cache/
57-
5832
# Local development files
5933
scratch/
6034
notes/
6135
todo.txt
6236

63-
# Generated documentation
64-
book/
65-
docs/build/
66-
6737
# Backup files
68-
*.orig
69-
*.rej
38+
*.{orig,rej}

.roo/rules-architect/AGENTS.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.roo/rules-ask/AGENTS.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.roo/rules-code/AGENTS.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.roo/rules-debug/AGENTS.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

AGENTS.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)