Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CI tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EOLE
Infra
CI tools
Commits
4c9f0456
Commit
4c9f0456
authored
2 years ago
by
Daniel Dehennin
Browse files
Options
Downloads
Patches
Plain Diff
feat(python): check code formatting using `black`
parent
6a4e4ccd
No related branches found
No related tags found
3 merge requests
!47
Publish new release
,
!46
Prepare new release
,
!45
feat(python): template jobs to build and upload source and wheel packages
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/Python.yaml
+58
-0
58 additions, 0 deletions
templates/Python.yaml
with
58 additions
and
0 deletions
templates/Python.yaml
0 → 100644
+
58
−
0
View file @
4c9f0456
# -*- coding: utf-8 -*-
# vim: ft=yaml
#
# Hidden template jobs to be used in `.gitlab-ci.yml`
#
# - `.python:black:check`: verify formatting of code with `black`
#
---
#
# .python:black:check
# ===================
#
# The Python code must match `black` standard.
#
# USAGE
# =====
#
# include:
# - project: EOLE/Infra/ci-tools
# ref: stable
# file: /templates/Python.yaml
#
# stages:
# - lint
#
# python:black: {extends: '.python:black:check'}
#
# REQUIREMENTS
# ============
#
# - a `lint` stage must be present in your pipeline or it must be
# overriden by the extending job to feet your need
#
# - the `.not-on-stable` rules templates
#
# OPTIONAL VARIABLES
# ==================
#
# - `PYTHON_BLACK_OPTS`: additional options to pass to `black`
#
# - `PYTHON_SOURCE_DIR`: top level directory where to run `black`,
# defaults to `.`
#
# - `PYTHON_BLACK_IMAGE`: name of the black docker image to use
#
.python:black:check
:
stage
:
lint
extends
:
.not-on-stable
image
:
"
${PYTHON_BLACK_IMAGE}"
variables
:
PYTHON_BLACK_IMAGE
:
"
hub.eole.education/proxyhub/pyfound/black:latest_release"
PYTHON_BLACK_OPTS
:
'
'
PYTHON_SOURCE_DIR
:
'
.'
script
:
-
echo -e "\e[0Ksection_start:`date +%s`:python-black\r\e[0KExecute 'black --check ${PYTHON_BLACK_OPTS} ${PYTHON_SOURCE_DIR}'"
-
black --check ${PYTHON_BLACK_OPTS} ${PYTHON_SOURCE_DIR}
-
echo -e "\e[0Ksection_end:`date +%s`:python-black\r\e[0K"
...
This diff is collapsed.
Click to expand it.
Ghost User
@ghost
mentioned in commit
1880d428
·
2 years ago
mentioned in commit
1880d428
mentioned in commit 1880d42821c7e091cddf6f2977d9458af0ca4246
Toggle commit list
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