Identify empty function blocks as code generation tasks - MVC

We want to identify freshly started functions which are empty and route such requests to our code generation model

e.g:

const validateCountryCode = (countryCode) => {}

becomes then (real model response)

const validateCountryCode = (countryCode) => {
  // Check if the country code is a valid ISO 3166-1 alpha-2 code
  if (!/^[A-Z]{2}$/.test(countryCode)) {
    return false;
  }

  // Check if the country code is a valid country
  if (!Object.keys(countries).includes(countryCode)) {
    return false;
  }

  return true;
};

Proposal

In the initial solution, let's use regex to identify function signatures in the following languages (in rough order of importance):

  • Python: !135564 (merged)
  • Typescript: !137107 (merged)
  • Javascript: !136439 (merged)
  • Golang: !136054 (merged)
  • Ruby: !135832 (merged)

Stretch Goals

  • C/C++: !137516 (closed)
  • C#: !137501 (merged)
  • PHP: !137413 (merged)
  • Java: !137284 (merged)

This list is from our current usage (see this comment) and the top languages at GitLab (see this dashboard)

Edited Dec 01, 2023 by Tim Zallmann
Assignee Loading
Time tracking Loading