Giter VIP home page Giter VIP logo

vscode-extension-verifier's Introduction

Copilot Chat @verifier

A Github Copilot Chat agent that does its best to verify Python code suggestions.

This extension is a tool designed to enforce Design by Contract principles in Python code samples generated by the corresponding Github Copilot chat participant, using the icontract package. It verifies the provided code blocks using CrossHair, a symbolic execution tool for Python. If a code block violates the pre or postconditions, the extension provides a warning message.

Features

  • Verifies Python code blocks in real-time
  • Supports Design by Contract principles using the icontract package
  • Uses CrossHair for symbolic execution of Python code
  • Provides warning messages for generated code blocks that violate pre or postconditions

How to Use

  1. Start VSCode specifically enabling proposed APIs for the extension to work as expected:
    code --enable-proposed-api phoevos.verifier .
  2. Install the extension from the VS Code marketplace
  3. Open the Github Copilot chat
  4. Invoke the verifier chat participant using the @verifier handle
  5. Ask the @verifier to create a Python function. You can provide more information about the conditions that should hold true before and after the execution of the function.
  6. The @verifier will attempt to generate the requested code, using icontract for adding pre and postconditions, and verify it using CrossHair. If the verification of the generated code fails, this will be noted in the chat response as a warning.

Note: The pre and post conditions are there to explicitly define the function specification. Feel free to remove them if you decide to use the code suggestion.

Requirements

  • Python: The extension is designed to work with Python code
  • Docker: The extension uses a Docker container to run the verifier, packaging the tools used for verification (currently CrossHair and icontract). The Docker daemon should be running at startup. If running the verifier in a container fails, the extension will attempt to install the required packages locally.
  • pip: The extension defaults to using pip for installing crosshair-tool and icontract locally if the preferred container approach fails.

Known Issues

  • The extension currently only supports Python.

vscode-extension-verifier's People

Contributors

phoevos avatar

Watchers

 avatar

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.