Comments (4)
An initial effort towards creating a unified coding style has been started here: dev_setup.py
This creates a pre-commit hook in .git/hooks/pre-commit, which automatically runs every time you commit.
The script runs the following tools:
- pylint for python linting
- black for python formatting
- yamllint for .yaml files linting
- ansible-lint for ansible .yaml linting (currently all .yaml files are Ansible files)
Each user has to execute this script once to create the hook.
The codebase has not yet been adapted to follow the advise from these tools, this is ongoing work.
An Ansible configuration file has been created in ansible.cfg. This should be used instead of the global Ansible files, which users currently have to modify according to the README.
Action points
- Update the README, remove the custom Ansible config file changes
- Make every Ansible call in the framework use the custom config file
from continuum.
We may want to do a 2-way setup:
- GitHub workflow that runs on every pull request; see the (incomplete) example at the bottom from Linus
- Pre-commit hook so people can locally check the status of their code; see dev_setup.py link in the previous post.
name: Pylint
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
from continuum.
just as a side-note: If that code comes from my reverted commit, this code is automatically generated by GitHub when you search and add the pylint action
from continuum.
The entire codebase has been formatted and linted: Before pulling a branch into main, run python3 dev_setup.py
, which will create a precommit file that runs a couple of formatters and linters before your commit. Make sure there are no complaints from these packages before pulling something onto main.
from continuum.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from continuum.