<commit_before>#lang scheme/base
(require racket/file
         racket/path
         setup/dirs)

(provide links)

(define (links #:error [error error]
               #:user? [user? #t]
               #:file [in-file #f]
               #:name [name #f]
               #:version-regexp [version-regexp #f]
               #:root? [root? #f]
               #:remove? [remove? #f]
               #:show? [show? #f]
               #:repair? [repair? #f]
               . dirs)
  (define (check-name name)
    (unless (and (regexp-match #rx"^[a-zA-z+_%-]+$" name)
                 (module-path? name))
      (error 'links "name is not valid as a top-level collection name: ~e"
             name)))

  (when name
    (check-name name))

  (define file (or in-file<commit_msg>fix `raco link' collection-name checking<commit_after>#lang scheme/base
(require racket/file
         racket/path
         setup/dirs)

(provide links)

(define (links #:error [error error]
               #:user? [user? #t]
               #:file [in-file #f]
               #:name [name #f]
               #:version-regexp [version-regexp #f]
               #:root? [root? #f]
               #:remove? [remove? #f]
               #:show? [show? #f]
               #:repair? [repair? #f]
               . dirs)
  (define (check-name name)
    (unless (and (regexp-match #rx"^[a-zA-z0-9+_%-]+$" name)
                 (module-path? name))
      (error 'links "name is not valid as a top-level collection name: ~e"
             name)))

  (when name
    (check-name name))

  (define file (or in-file
{'fraction_non_alphanumeric': 0.1534526854219949, 'fraction_numerical': 0.0012787723785166241, 'mean_word_length': 1.639123102866779, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2095767', 'n_tokens_mistral': 535, 'n_tokens_neox': 502, 'n_words': 141}