Skip to content

Commit

Permalink
feat: add example anonymization script
Browse files Browse the repository at this point in the history
  • Loading branch information
mbdevpl committed Oct 24, 2024
1 parent 39e7b58 commit f9d2f9f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ RUN set -Eeuxo pipefail && \
python3-numpy \
python3-pip \
python3-venv \
shellcheck \
sudo && \
apt-get -qy autoremove && \
apt-get clean && \
Expand Down
9 changes: 8 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pipeline {
stage('Lint') {
environment {
PYTHON_MODULES = "${env.PYTHON_PACKAGE} test *.py"
SHELL_SCRIPTS = '*.sh'
}
steps {
sh """#!/usr/bin/env bash
Expand All @@ -37,6 +38,8 @@ pipeline {
echo "\${PIPESTATUS[0]}" | tee flake518_status.log
python3 -m pydocstyle ${PYTHON_MODULES} |& tee pydocstyle.log
echo "\${PIPESTATUS[0]}" | tee pydocstyle_status.log
shellcheck ${SHELL_SCRIPTS} |& tee shellcheck.log
echo "\${PIPESTATUS[0]}" | tee shellcheck_status.log
"""
}
}
Expand All @@ -61,7 +64,11 @@ pipeline {
echo "${PIPESTATUS[0]}" | tee coverage_status.log
'''
script {
defaultHandlers.afterPythonBuild()
if (env.CHANGE_ID) {
HashMap toolResults = pythonUtils.prepareLintingReport()
toolResults['shellcheck'] = languageUtils.prepareToolReport('shellcheck')
repoUtils.postToolsReportOnPR(toolResults)
}
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions cleanup_examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -Eeuxo pipefail

HOSTNAME=$(hostname)
USER=$(whoami)

FILES=('README.rst' 'examples.ipynb')

for file in "${FILES[@]}" ; do
sed -i "s|${USER}|user|" "${file}"
sed -i "s|${HOSTNAME}|hostname|" "${file}"
done

0 comments on commit f9d2f9f

Please sign in to comment.