@@ -2,8 +2,6 @@ package ruler
22
33import (
44 "bytes"
5- "crypto/sha256"
6- "encoding/hex"
75 "errors"
86 "fmt"
97 "os"
@@ -246,31 +244,18 @@ func _build(vers, inPath, outPath, packageName string) error {
246244 return err
247245 }
248246
249- hash := _sha256 (doc )
250-
251- fileName := makeFilename (packageName , vers , hash )
247+ fileName := makeFilename (packageName , vers )
252248 fullPath := filepath .Join (outPath , fileName )
253249
254250 if err = writeFile (fullPath , doc ); err != nil {
255251 return err
256252 }
257253
258- hashPath := fmt .Sprintf ("%s.sha256" , fullPath )
259- if err = writeFile (hashPath , []byte (hash )); err != nil {
260- return err
261- }
262-
263- fmt .Printf ("Wrote file [sha256 %s]: %s\n " , hash , fileName )
264- fmt .Printf ("Wrote hash file: %s\n " , hashPath )
254+ fmt .Printf ("Wrote file: %s\n " , fileName )
265255
266256 return nil
267257}
268258
269- func _sha256 (data []byte ) string {
270- sum := sha256 .Sum256 (data )
271- return hex .EncodeToString (sum [:])
272- }
273-
274259func writeFile (fn string , data []byte ) error {
275260 fh , err := os .OpenFile (fn , os .O_RDWR | os .O_CREATE , 0644 )
276261 if err != nil {
@@ -284,23 +269,17 @@ func writeFile(fn string, data []byte) error {
284269 return fh .Close ()
285270}
286271
287- func makeFilename (name , vers , hash string ) string {
272+ func makeFilename (name , vers string ) string {
288273 name = strings .TrimSuffix (name , ".yaml" )
289274 vers = strings .TrimPrefix (vers , "v" )
290275
291- buildMeta := fmt .Sprintf (".%s" , hash [:8 ])
292-
293- return fmt .Sprintf ("%s.%s%s.yaml" , name , vers , buildMeta )
276+ return fmt .Sprintf ("%s.%s.yaml" , name , vers )
294277}
295278
296279// Convert to document per section
297280
298281func generateDocument (rules map [string ]parser.ParseRuleT , terms map [string ]parser.ParseTermT ) ([]byte , error ) {
299282
300- type docT struct {
301- Rules []any `yaml:"rules,omitempty"`
302- }
303-
304283 // Gather keys to produce consistent order output
305284 ruleKeys := make ([]string , 0 , len (rules ))
306285 for k := range rules {
0 commit comments