anti-work / shortest

Have AI write and update tests for you
https://shortest.com
MIT License
187 stars 21 forks source link

Per-repo settings via shortest.config.ts for finding spec files #33

Closed slavingia closed 1 month ago

slavingia commented 1 month ago

And more...

poudelprakash commented 1 month ago

This feature feels super urgent!

Most missed configuration are: test framework of choice(eg in rails: RSpec, MiniTest) and preferred placement of test(whether tests go alongside components or in a separate tests/ directory)

slavingia commented 1 month ago

I think a simple regex for test files names should work, so one could say:

*.test.*

// Or

**/*_spec.rb

// Or

spec/
slavingia commented 1 month ago

Example generated by AI:

shortest:
  # Test file patterns
  test_patterns:
    - "*.test.*"
    - "**/*_spec.rb"
    - "spec/"

  # Test framework
  test_framework: "rspec"  # Options: rspec, minitest

  # Test file location
  test_location: "separate"  # Options: alongside, separate

  # Additional configuration
  ignore_patterns:
    - "node_modules/"
    - "vendor/"

  # Custom commands
  commands:
    run_tests: "bundle exec rspec"
    generate_test: "rails generate rspec:model"

  # Editor settings
  editor:
    tab_size: 2
    insert_final_newline: true
    trim_trailing_whitespace: true
juniusfree commented 1 month ago

I'll try this

juniusfree commented 1 month ago

@slavingia I have a proof of concept at #65 that uses YAML for configurations, zod for validation, and minimatch for glob pattern matching. So far, I have implemented the test_patterns configuration. I plan to add more configurations before finalizing the PR, but I would appreciate any early feedback you may have.

slavingia commented 1 month ago

Looks good! One comment

juniusfree commented 1 month ago

@slavingia I updated the PR to address the comments. 🙌🏽