mirror of
https://github.com/arduino/library-registry.git
synced 2025-05-19 08:13:41 +03:00
Merge pull request #235 from per1234/production-duplicate-name
Add duplicate name check to registry data file validator
This commit is contained in:
commit
914b1f90f0
@ -39,7 +39,16 @@ func main() {
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(rawRepos, filteredRepos) {
|
||||
fmt.Fprintln(os.Stderr, "error: Registry data file contains duplicate entries")
|
||||
fmt.Fprintln(os.Stderr, "error: Registry data file contains duplicate URLs")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
nameMap := make(map[string]bool)
|
||||
for _, entry := range rawRepos {
|
||||
if _, found := nameMap[entry.LibraryName]; found {
|
||||
fmt.Fprintf(os.Stderr, "error: Registry data file contains duplicates of name %s\n", entry.LibraryName)
|
||||
os.Exit(1)
|
||||
}
|
||||
nameMap[entry.LibraryName] = true
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ test_data_path = pathlib.Path(__file__).resolve().parent.joinpath("testdata")
|
||||
("invalid-data-format.txt", False),
|
||||
("invalid-url-format.txt", False),
|
||||
("duplicate-url.txt", False),
|
||||
("duplicate-name.txt", False),
|
||||
("valid.txt", True),
|
||||
],
|
||||
)
|
||||
|
4
.github/workflows/assets/validate-registry/tests/testdata/duplicate-name.txt
vendored
Normal file
4
.github/workflows/assets/validate-registry/tests/testdata/duplicate-name.txt
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
https://github.com/arduino-libraries/Scheduler.git|Arduino|Scheduler
|
||||
https://github.com/arduino-libraries/SD.git|Partner|SD
|
||||
https://github.com/arduino-libraries/Servo.git|Recommended|Servo
|
||||
https://github.com/arduino-libraries/Foo.git|Contributed|SD
|
@ -7,7 +7,6 @@ https://github.com/arduino-libraries/AudioZero.git|Arduino|AudioZero
|
||||
https://github.com/arduino-libraries/Bridge.git|Arduino|Bridge
|
||||
https://github.com/arduino-libraries/Esplora.git|Arduino|Esplora
|
||||
https://github.com/arduino-libraries/Ethernet.git|Arduino|Ethernet
|
||||
https://github.com/arduino-libraries/Firmata-Old.git|Arduino|Firmata
|
||||
https://github.com/arduino-libraries/GSM.git|Arduino|GSM
|
||||
https://github.com/arduino-libraries/LiquidCrystal.git|Arduino|LiquidCrystal
|
||||
https://github.com/arduino-libraries/Robot_Control.git|Arduino|Robot Control
|
||||
@ -702,7 +701,6 @@ https://github.com/finson-release/FirmataWithDeviceFeature.git|Contributed|Firma
|
||||
https://github.com/iotpipe/esp8266-arduino-iotpipe.git|Contributed|IoT Pipe
|
||||
https://github.com/olikraus/U8g2_Arduino.git|Contributed|U8g2
|
||||
https://github.com/abderraouf-adjal/ArduinoSpritzCipher.git|Contributed|SpritzCipher
|
||||
https://github.com/EscaVic/ROKduino.git|Contributed|ROKduino
|
||||
https://github.com/dxinteractive/ResponsiveAnalogRead.git|Contributed|ResponsiveAnalogRead
|
||||
https://github.com/FaBoPlatform/FaBoBLE-BLE113-Library.git|Contributed|FaBo 301 BLE SiliconLabs
|
||||
|
||||
@ -1597,7 +1595,7 @@ https://github.com/elhayra/Strober.git|Contributed|Strober
|
||||
https://github.com/elhayra/SandTimer.git|Contributed|SandTimer
|
||||
https://github.com/elhayra/MilliStopper.git|Contributed|MilliStopper
|
||||
https://github.com/mike-matera/FastPID.git|Contributed|FastPID
|
||||
https://github.com/ettoreleandrotognoli/ArcPID.git|Contributed|PID
|
||||
https://github.com/ettoreleandrotognoli/ArcPID.git|Contributed|ArcPID
|
||||
https://github.com/nathanRamaNoodles/MusicWithoutDelay-LIbrary.git|Contributed|MusicWithoutDelay
|
||||
https://github.com/eagleSIA/eBoard.git|Contributed|eBoard shackle the Arduino
|
||||
https://github.com/ssilverman/TeensyDMX.git|Contributed|TeensyDMX
|
||||
|
Loading…
x
Reference in New Issue
Block a user