Skip to content

Commit 761175b

Browse files
committed
change repo structure
1 parent 25d4add commit 761175b

16 files changed

+702
-259
lines changed

.claude/settings.local.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
"WebFetch(domain:github.com)",
55
"WebFetch(domain:raw.githubusercontent.com)",
66
"Bash(python -m pip install:*)",
7-
"Bash(python -m pytest:*)"
7+
"Bash(python -m pytest:*)",
8+
"Bash(cat:*)",
9+
"Bash(python -m json.tool:*)",
10+
"Bash(if [ -f codecheck_logo.png ])",
11+
"Bash(then mv codecheck_logo.png .codecheck/)",
12+
"Bash(fi)"
813
],
914
"deny": [],
1015
"ask": []

.codecheck/codecheck.ipynb

Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "11dcf3e9",
6+
"metadata": {},
7+
"source": [
8+
"Template document for [CODECHECK](https://codecheck.org.uk/)'s with a Jupyter notebook. Note that the files in this repository should be placed into a `codecheck` directory, and require a `codecheck.yml` file in the main folder (i.e. `../codecheck.yml` from the point of view of this notebook). See the [CODECHECK community process guide](https://codecheck.org.uk/guide/community-process) for more details.\n",
9+
"\n",
10+
"Note that the `{-}` at the end of the headings is necessary to avoid numbered headings in jupyter's `nbexport`."
11+
]
12+
},
13+
{
14+
"cell_type": "code",
15+
"id": "p9fkrelbqqo",
16+
"source": "from codecheck import Codecheck",
17+
"metadata": {},
18+
"execution_count": null,
19+
"outputs": []
20+
},
21+
{
22+
"cell_type": "code",
23+
"execution_count": null,
24+
"id": "d75b33d1",
25+
"metadata": {},
26+
"outputs": [],
27+
"source": "# By default, this expects a file at `../codecheck.yml` -- provide a path/filename otherwise.\n# Set validate=True to check configuration before proceeding\n# Set strict=True to halt on validation errors\ncheck = Codecheck(validate=False, strict=False)"
28+
},
29+
{
30+
"cell_type": "markdown",
31+
"id": "nekc3mpbi4",
32+
"source": "## Validation (Optional){-}\n\nThe following cells run validation checks on the `codecheck.yml` file. This is optional but recommended to catch configuration errors early. You can skip these cells if you prefer.",
33+
"metadata": {}
34+
},
35+
{
36+
"cell_type": "code",
37+
"id": "afhjxh7y7un",
38+
"source": "# Run validation checks (set check_manifest=False if outputs/ directory doesn't exist yet)\npassed, issues = check.validate(check_manifest=False, strict=False)\nprint(f\"Validation {'passed' if passed else 'failed'} with {len(issues)} issue(s)\")\ncheck.validation_report()",
39+
"metadata": {},
40+
"execution_count": null,
41+
"outputs": []
42+
},
43+
{
44+
"cell_type": "code",
45+
"execution_count": null,
46+
"id": "e5893809",
47+
"metadata": {},
48+
"outputs": [],
49+
"source": [
50+
"check.title()"
51+
]
52+
},
53+
{
54+
"cell_type": "markdown",
55+
"id": "aaa08iw35qj",
56+
"source": "---",
57+
"metadata": {}
58+
},
59+
{
60+
"cell_type": "markdown",
61+
"id": "60b1589a",
62+
"metadata": {},
63+
"source": [
64+
"## CODECHECK summary{-}"
65+
]
66+
},
67+
{
68+
"cell_type": "code",
69+
"execution_count": null,
70+
"id": "42df69b7",
71+
"metadata": {},
72+
"outputs": [],
73+
"source": [
74+
"check.summary_table()"
75+
]
76+
},
77+
{
78+
"cell_type": "markdown",
79+
"id": "db137e9a",
80+
"metadata": {},
81+
"source": [
82+
"## Summary of output files generated{-}"
83+
]
84+
},
85+
{
86+
"cell_type": "code",
87+
"execution_count": null,
88+
"id": "4bdd6dcd",
89+
"metadata": {},
90+
"outputs": [],
91+
"source": [
92+
"check.files()"
93+
]
94+
},
95+
{
96+
"cell_type": "markdown",
97+
"id": "b0af9cd0",
98+
"metadata": {},
99+
"source": [
100+
"## Summary{-}"
101+
]
102+
},
103+
{
104+
"cell_type": "code",
105+
"execution_count": null,
106+
"id": "3d319d3a",
107+
"metadata": {},
108+
"outputs": [],
109+
"source": [
110+
"check.summary()"
111+
]
112+
},
113+
{
114+
"cell_type": "markdown",
115+
"id": "be63e1d6",
116+
"metadata": {},
117+
"source": [
118+
"## CODECHECKER notes{-}\n",
119+
"\n",
120+
"*TODO*"
121+
]
122+
},
123+
{
124+
"cell_type": "markdown",
125+
"id": "82d0bdb9",
126+
"metadata": {},
127+
"source": [
128+
"## Recommendations to the authors{-}\n",
129+
"\n",
130+
"*TODO*"
131+
]
132+
},
133+
{
134+
"cell_type": "markdown",
135+
"id": "8fe8127b",
136+
"metadata": {},
137+
"source": [
138+
"## Citing this document{-}"
139+
]
140+
},
141+
{
142+
"cell_type": "code",
143+
"execution_count": null,
144+
"id": "bbb4aec2",
145+
"metadata": {},
146+
"outputs": [],
147+
"source": [
148+
"check.citation()"
149+
]
150+
},
151+
{
152+
"cell_type": "markdown",
153+
"id": "a89d2b5e",
154+
"metadata": {},
155+
"source": [
156+
"## About CODECHECK{-}"
157+
]
158+
},
159+
{
160+
"cell_type": "code",
161+
"execution_count": null,
162+
"id": "400b2603",
163+
"metadata": {},
164+
"outputs": [],
165+
"source": [
166+
"check.about_codecheck()"
167+
]
168+
},
169+
{
170+
"cell_type": "markdown",
171+
"id": "3f5f5d71",
172+
"metadata": {},
173+
"source": [
174+
"## About this document{-}\n",
175+
"This document was created using a [jupyter notebook](https://jupyter.org/) and converted into PDF via [nbconvert](https://nbconvert.readthedocs.io/), [pandoc](https://pandoc.org/), and [xelatex](http://xetex.sourceforge.net/). \n",
176+
"\n",
177+
"## License{-}\n",
178+
"The code, data, and figures created by the original authors are licensed under the ... license (see their [LICENSE file](https://github.com/codecheckers/causality-review/blob/main/LICENSE)). The content of the `codecheck` directory and this report are licensed under the ... license."
179+
]
180+
},
181+
{
182+
"cell_type": "markdown",
183+
"id": "10b01948",
184+
"metadata": {},
185+
"source": [
186+
"## Manifest files{-}\n",
187+
"\n",
188+
"### CSV files{-}"
189+
]
190+
},
191+
{
192+
"cell_type": "code",
193+
"execution_count": null,
194+
"id": "86962465",
195+
"metadata": {},
196+
"outputs": [],
197+
"source": [
198+
"# Show CSV file summaries if any CSV files exist in manifest\n",
199+
"try:\n",
200+
" result = check.csv_files(index_col=False, header=None) # arguments for panda's read_csv function\n",
201+
" if result:\n",
202+
" display(result)\n",
203+
"except Exception as e:\n",
204+
" print(f'No CSV files to display or files not found: {e}')"
205+
]
206+
},
207+
{
208+
"cell_type": "markdown",
209+
"id": "c1424a39",
210+
"metadata": {},
211+
"source": [
212+
"### Figures{-}"
213+
]
214+
},
215+
{
216+
"cell_type": "code",
217+
"execution_count": null,
218+
"id": "fb1bccee",
219+
"metadata": {},
220+
"outputs": [],
221+
"source": [
222+
"# Show figures if any exist in manifest\n",
223+
"try:\n",
224+
" result = check.latex_figures(extensions=('.pdf',)) # Manifest files to include\n",
225+
" if result:\n",
226+
" display(result)\n",
227+
"except Exception as e:\n",
228+
" print(f'No figures to display or files not found: {e}')"
229+
]
230+
}
231+
],
232+
"metadata": {
233+
"celltoolbar": "Raw Cell Format",
234+
"kernelspec": {
235+
"display_name": "Python 3",
236+
"language": "python",
237+
"name": "python3"
238+
},
239+
"language_info": {
240+
"codemirror_mode": {
241+
"name": "ipython",
242+
"version": 3
243+
},
244+
"file_extension": ".py",
245+
"mimetype": "text/x-python",
246+
"name": "python",
247+
"nbconvert_exporter": "python",
248+
"pygments_lexer": "ipython3",
249+
"version": "3.9.4"
250+
}
251+
},
252+
"nbformat": 4,
253+
"nbformat_minor": 5
254+
}
File renamed without changes.

manifest.py renamed to .codecheck/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def validate_paths(self) -> Tuple[bool, List[str]]:
274274
continue
275275

276276
# Ensure normalized path doesn't escape
277-
normalized = Path(file_path).resolve()
277+
normalized = (self.outputs_dir / file_path).resolve()
278278
try:
279279
normalized.relative_to(self.outputs_dir.resolve())
280280
except ValueError:
File renamed without changes.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"""
44

55
# Required fields according to CODECHECK spec
6-
MANDATORY_FIELDS = ['manifest', 'codechecker', 'report']
6+
MANDATORY_FIELDS = ['manifest', 'codechecker', 'report', 'version', 'paper', 'repository', 'check_time', 'certificate', 'summary']
77

8-
# Recommended fields for complete certificates
9-
RECOMMENDED_FIELDS = ['version', 'paper', 'repository', 'check_time', 'certificate']
8+
# Recommended fields for complete certificates (now empty - all promoted to mandatory)
9+
RECOMMENDED_FIELDS = []
1010

1111
# Optional but recognized fields
12-
OPTIONAL_FIELDS = ['summary', 'source']
12+
OPTIONAL_FIELDS = ['source']
1313

1414
# Placeholder patterns that indicate incomplete configuration
1515
PLACEHOLDER_PATTERNS = {

.github/workflows/test.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,31 @@ jobs:
1818
with:
1919
python-version: '3.11'
2020

21-
- name: Install dependencies
21+
- name: Install system dependencies
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y texlive-xetex texlive-fonts-recommended texlive-plain-generic pandoc
25+
26+
- name: Install Python dependencies
2227
run: |
2328
python -m pip install --upgrade pip
24-
pip install pytest pytest-cov pyyaml pandas requests
29+
pip install pytest pytest-cov pyyaml pandas requests jupyter nbconvert
2530
2631
- name: Run tests with pytest
2732
run: |
2833
pytest tests/ -v --cov=. --cov-report=term-missing
34+
env:
35+
CI: true
2936

3037
- name: Display coverage summary
3138
run: |
3239
coverage report
40+
41+
- name: Upload test PDF artifact
42+
if: always()
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: test-codecheck-certificate
46+
path: test-artifacts/test-codecheck-certificate.pdf
47+
if-no-files-found: warn
48+
retention-days: 30

0 commit comments

Comments
 (0)