Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snipper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tuhe
snipper
Commits
83f47098
Commit
83f47098
authored
2 years ago
by
tuhe
Browse files
Options
Downloads
Patches
Plain Diff
updates
parent
11b1ee00
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#13392
passed
2 years ago
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/snipper/fix_bf.py
+11
-2
11 additions, 2 deletions
src/snipper/fix_bf.py
src/snipper/snip_dir.py
+1
-1
1 addition, 1 deletion
src/snipper/snip_dir.py
src/snipper/snipper_main.py
+3
-1
3 additions, 1 deletion
src/snipper/snipper_main.py
with
15 additions
and
4 deletions
src/snipper/fix_bf.py
+
11
−
2
View file @
83f47098
...
...
@@ -80,7 +80,10 @@ def _block_fun(lines, start_extra, end_extra, keep=False, permute=False, questio
if
len
(
ee
)
>=
2
and
ee
[
0
]
==
'"'
:
ee
=
ee
[
1
:
-
1
]
if
len
(
ee
)
==
0
:
if
not
permute
:
ee
=
"
Insert your solution and remove this error.
"
else
:
ee
=
"
Remove this exception after the above lines have been uncommented and rearranged.
"
start_extra
=
start_extra
.
strip
()
if
keep
:
l2
=
[
'
GARBAGE
'
]
*
cc
...
...
@@ -93,15 +96,21 @@ def _block_fun(lines, start_extra, end_extra, keep=False, permute=False, questio
insert_lines
=
False
msg
=
[]
if
permute
:
msg
=
[
id
+
"
# TODO: The following lines have been permuted. Can you put them back in order?
"
]
sperm
=
f
"
# TODO: Oy veh, the following
{
cc
}
lines below have been permuted. Uncomment, rearrange to the correct order and remove the error.
"
msg
=
[
id
+
f
"
#
"
+
sperm
,
id
+
"
#
"
+
"
-
"
*
len
(
sperm
)]
# Permute all lines.
lines
=
f1
(
lines
)
insert_lines
=
True
pass
if
questionmarks
:
sperm
=
f
"
# TODO: The following
{
cc
}
lines have been obfuscated by having characters replaced by questionmarks. Make it work and remove the error.
"
msg
=
[
id
+
f
"
#
"
+
sperm
,
id
+
"
#
"
+
"
-
"
*
len
(
sperm
)]
lines
=
f2
(
lines
)
insert_lines
=
True
elif
halfquestionmarks
:
sperm
=
f
"
# TODO: Half of each line of code in the following
{
cc
}
lines have been replaced by garbage. Make it work and remove the error.
"
msg
=
[
id
+
f
"
#
"
+
sperm
,
id
+
"
#
"
+
"
-
"
*
len
(
sperm
)]
lines
=
f3
(
lines
)
insert_lines
=
True
if
not
insert_lines
:
...
...
This diff is collapsed.
Click to expand it.
src/snipper/snip_dir.py
+
1
−
1
View file @
83f47098
...
...
@@ -71,7 +71,7 @@ def snip_dir(source_dir, # Sources
if
os
.
path
.
isdir
(
f
)
or
str
(
f
).
endswith
(
"
_grade.py
"
):
continue
if
accept
and
(
str
(
f
).
endswith
(
"
.py
"
)
or
str
(
f
).
endswith
(
"
.rst
"
)):
if
accept
and
(
str
(
f
).
endswith
(
"
.py
"
)
or
str
(
f
).
endswith
(
"
.rst
"
)
or
str
(
f
).
endswith
(
"
.md
"
)
):
# if f.endswith("rst"):
# pass
solution_list
=
[]
...
...
This diff is collapsed.
Click to expand it.
src/snipper/snipper_main.py
+
3
−
1
View file @
83f47098
...
...
@@ -36,8 +36,10 @@ def censor_file(file, run_files=True, run_out_dirs=None, cut_files=True,
license_head
=
None
):
if
str
(
file
).
endswith
(
"
rst
"
):
assert
not
run_files
and
not
cut_files
and
not
censor_files
print
(
file
)
# if str(file).endswith("md"):
# assert not run_files and not cut_files
if
references
==
None
:
references
=
{}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment