Skip to content

Commit

Permalink
Clear Jupyter notebook cells for string checks
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosavola committed Aug 17, 2022
1 parent 4cdf7ba commit 326c3b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,19 @@ check_confidential_strings:
variables:
GIT_DEPTH: 0
GIT_STRATEGY: clone
FILTER_BRANCH_SQUELCH_WARNING: 1
script:
- pip install nbconvert
- git checkout "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
# go through relevant history and clear output from notebooks
- >
git filter-branch --tree-filter
'python3 -m nbconvert --clear-output --inplace notebooks/*.ipynb || true'
-- $(git merge-base remotes/origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME HEAD)..HEAD
- python3 -m nbconvert --clear-output --inplace notebooks/*.ipynb
- >
bash ci/check_files_for_strings.sh "$KQC_CONFIDENTIAL_STRINGS"
"remotes/origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" "remotes/origin/$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
"remotes/origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
only:
refs:
- merge_requests
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ commands_post =
[testenv:static_analysis]
commands =
python -m pylint klayout_package/ tests/ {posargs}{env:CODEQUALITY_JSON:}
python -m nbqa pylint notebooks/ --disable=W0104 {posargs}{env:CODEQUALITY_NB_JSON:}
python -m nbqa pylint notebooks/ --disable="W0104,C0103" {posargs}{env:CODEQUALITY_NB_JSON:}

0 comments on commit 326c3b0

Please sign in to comment.