Giter VIP home page Giter VIP logo

Comments (4)

matthijssjansen avatar matthijssjansen commented on August 20, 2024

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:

  1. pylint for python linting
  2. black for python formatting
  3. yamllint for .yaml files linting
  4. 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.

matthijssjansen avatar matthijssjansen commented on August 20, 2024

We may want to do a 2-way setup:

  1. GitHub workflow that runs on every pull request; see the (incomplete) example at the bottom from Linus
  2. 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.

linuswagner avatar linuswagner commented on August 20, 2024

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.

matthijssjansen avatar matthijssjansen commented on August 20, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.