Skip to content

Python scraper based on AI

changed score evaluation

VinciGit00f79dee802f34
diff --git a/.github/workflows/evaluate_pylint_score.py b/.github/workflows/evaluate_pylint_score.py
index 1d3dc0d0..1d31118a 100644
--- a/.github/workflows/evaluate_pylint_score.py
+++ b/.github/workflows/evaluate_pylint_score.py
@@ -2,9 +2,8 @@
import sys
-def evaluate_pylint_score(output_file):
- with open(output_file, 'r') as f:
- lines = f.readlines()
+def evaluate_pylint_score():
+ lines = sys.stdin.readlines()
score_line = next((line for line in lines if 'Your code has been rated at' in line), None)
if score_line:
@@ -20,8 +19,4 @@ def evaluate_pylint_score(output_file):
sys.exit(1)
if __name__ == "__main__":
- if len(sys.argv) != 2:
- print("Usage: python evaluate_pylint_score.py <pylint_output_file>")
- sys.exit(1)
- output_file = sys.argv[1]
- evaluate_pylint_score(output_file)
+ evaluate_pylint_score()
diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml
index a25654ad..1ae95910 100644
--- a/.github/workflows/pylint.yml
+++ b/.github/workflows/pylint.yml
@@ -20,6 +20,4 @@ jobs:
pip install pylint
pip install -r requirements.txt
- name: Analysing the code with pylint
- run: |
- pylint --disable=C0114,C0115,C0116 --exit-zero scrapegraphai/**/*.py scrapegraphai/*.py examples/*.py tests/*.py > pylint_output.txt
- python .github/workflows/evaluate_pylint_score.py pylint_output.txt
+ run: pylint --disable=C0114,C0115,C0116 --exit-zero scrapegraphai/**/*.py scrapegraphai/*.py examples/*.py tests/*.py | python .github/workflows/evaluate_pylint_score.py