KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
dotcodegen
★ 37
Open GitHub ↗
Generate tests for your code using LLMs.
Download README (.md)
Explore Similar Repositories
Wasteland-Reborn
:
Fallout: Wasteland Reborn is a Wabbajack modlist that aims to create a fully featured, lore friendly rebuild of Fallout 4 from the ground up.
Understanding-Transformers-Step-by-Step-math-example
:
Understanding Large Language Transformer Architecture like a child
nanoGPT-moe
:
Enable moe for nanogpt.
Dinos-Hyperspace-Wrapper-for-Mac
:
An Application for MacOS that allows Running FTL: Hyperspace noob friendly with the usage of Wine
CateringManagement
:
基于Java+SSM餐饮管理系统(源代码+数据库+配套论文+ppt) java毕业设计,基于微信小程序,基于安卓毕业设计,机器学习,协同过滤推荐算法,大数据毕业设计,Python+Django+Vue ,php ,Flask,node.js ,SpringBoot Vue,SSM,JSP ,Uniapp,hadoop和spark框架,hive框架角色:管理员、用户 管理员:管理员登录进入餐饮管理系统可以查看首页、个人中心、用户管理、菜品分类管理、菜品信息管理、系统管理、订单管理等信息, 用户:当游客打开系统的网址后,首先看到的就是首页界面。在这里,游客能够看到餐饮管理系统的导航条显示首页、菜品信息、 公告资讯、购物车、在线客服等
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
dotcodegen
?
Download (.md)
# .codegen - Automatic test generation for your projects [](https://badge.fury.io/rb/dotcodegen) [](https://codeclimate.com/github/ferrucc-io/dotcodegen/test_coverage) **DEPRECATION NOTICE - This project is no longer maintained. See [.cursorrules](https://docs.cursor.com/context/rules-for-ai) as a more natively integrated way of passing file path specific context to LLMs** Never write a test from scratch again. Automatically generate tests for any file you open in your codebase. Keep your team up to date with the latest best practices and conventions you adopt. Customize the templates to fit your team's needs. We've built this tool internally to speed up writing tests for our monolith at [June](https://june.so). The main idea is that across your codebase, you can have a set of instructions that are used to generate tests. These templates are configurable so no matter what framework or language your current file is in, you can generate tests that fit your team's needs. Now we're open-sourcing it so you can use it too. https://github.com/ferrucc-io/dotcodegen/assets/8315559/aca74a87-5123-4305-88ff-cc3be3f34a9f ## Get started 1. Install our CLI via Homebrew: ```bash brew tap ferrucc-io/dotcodegen-tap brew install dotcodegen ``` Or via RubyGems, this requires Ruby 3.3.0: ```bash gem install dotcodegen ``` 2. Initialise the `.codegen` directory in your codebase: ```bash codegen --init ``` 3. Configure the templates to fit your team's needs. See the [configuration](./docs/configuration.md) section for more details. 4. Run the codegen command in your terminal: ```bash codegen path/to/the/file/you/want/to/test --openai_key <your_openai_key> ``` 5. That's it! You're ready to start generating tests for your codebase. **Extra**: This code becomes very powerful when you integrate it with your editor, so you can open a file and generate tests with a single command. In order to do that you can add a task to your `tasks.json` file in the `.vscode` directory of your project: ```json { "version": "2.0.0", "tasks": [ { "label": "Generate test for the current file", "type": "shell", // Alternatively you can specify the OPENAI_KEY environment variable in your .env file "command": "codegen ${relativeFile} --openai_key your_openai_key", "group": "test", "problemMatcher": [], "options": { "cwd": "${workspaceFolder}" }, } ] } ``` We're currently building a VSCode extension to be able to generate tests directly from your editor. Stay tuned! ## Organisation Id CLI takes an optional openai_org_id parameter. Used to specify the organisation to which the user making the API request belongs, especially in cases where the user is part of multiple organisations. This can be important for billing and access control, ensuring that the API usage is attributed to the correct organisation. ```bash codegen path/to/the/file/you/want/to/test --openai_key <your_openai_key> --openai_org_id <your_openai_organisation_id> ``` ## Linting When testing .rb code, then Rubocop or StandardRB will automatically be applied to the generated test code, if these gems are in your GemFile. For Rubocop, a .rubocop.yml needs to be on the top-level also. If both Rubocop and StandardRB are correctly set up, only StandardRB runs against the generated test code. ## How it works The extension uses AI to generate tests for any file you open in your codebase. It uses a set of customizable templates to generate the tests. You can customize the templates to fit your team's needs. ## Features - **Easy to learn**: Get started in minutes. - **AI powered scaffolding**: Generate smart tests for any file you open in your codebase. - **Fully customisable**: Customize the templates to fit your team's needs. - **Bring your own API key**: Use your own OpenAI API key to generate the tests. - **🚧 Integrates with VSCode**: Use the extension to generate tests directly from your editor. ## Contributing If you want to add some default templates for your language, feel free to open a PR. See the [config/default](./config/default) directory for the ones we have already. Bug reports and pull requests are welcome on GitHub at https://github.com/ferrucc-io/dotcodegen. ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org). ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).