You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a bug in my own code, which I eventually tracked down to something like:
rec(a := 1, b := 2, a := 3)
which ends up being equivalent to rec(b := 2, a : =3).
Now, this is clearly my fault, but (I'd argue) when someone writes a rec out like this explictly, they probably didn't mean to duplicate the keys!
I quickly hacked something together to see if any code exists like this in GAP. I didn't find any in the kernel, but there are a bunch in PackageInfo.gs. This makes sense, because those are fairly long records, written by hand. There are also more in packages. From my initial check, none of them seem to be a bug, but we could go through and report them all.
I could tidy up my for reporting these issues, the main problem is what should it do? Do we want to make this a warning? Should it be possible to disable that warning? Probably entering the break loop is most useful (as then you see where the issue is), but you wouldn't want that always turned on, as at the moment GAP wouldn't load many packages with that turned on.
Here, from my hacked up code, is all the places where this issue current occurs while loading GAP + packages, it shows keys and values. I have checked and these are all in PackageInfo.g files, most are obvious, for some dates you have to search for that date to find which package it is mentioned in.
#W Duplicate record member:
#w Key: PackageWWWHome
#W Value:"https://gap-packages.github.io/OrbitalGraphs"
#W Duplicate record member:
#w Key: Date
#W Value:"19/06/2023"
#W Duplicate record member:
#w Key: PackageWWWHome
#W Value:"https://gap-packages.github.io/AutoDoc"
#W Duplicate record member:
#w Key: Date
#W Value:"27/08/2024"
#W Duplicate record member:
#w Key: TestFile
#W Value:"tst/testall.g"
#W Duplicate record member:
#w Key: PackageWWWHome
#W Value:"https://gap-packages.github.io/float/"
#W Duplicate record member:
#w Key: TestFile
#W Value:"tst/testall.g"
#W Duplicate record member:
#w Key: Date
#W Value:"30/09/2022"
#W Duplicate record member:
#w Key: README_URL
#W Value:"https://gap-packages.github.io/tomlib/README.md"
#W Duplicate record member:
#w Key: PackageInfoURL
#W Value:"https://gap-packages.github.io/tomlib/PackageInfo.g"
#W Duplicate record member:
#w Key: Date
#W Value:"13/07/2022"
#W Duplicate record member:
#w Key: PackageWWWHome
#W Value:"https://gap-packages.github.io/walrus"
The text was updated successfully, but these errors were encountered:
Yes I think this would be a useful warning. Of course it then should print out more, specifically, in which file (and ideally in which line) the issue was encountered.
In light of a growing number of such warnings, I'd also like us to
add a "strict" mode in which these warning are treated as errors (e.g. --strict or --warnings=error or so)
add a way to disable them (e.g. --warnings=off?)
Strict mode would be useful for CI: once a package fixed all these warnings, it can configure its CI to run in strict mode, to make sure no regressions creep in.
See also #1191 for more ideas for things that we could warn about / that strict mode could turn into errors.
I had a bug in my own code, which I eventually tracked down to something like:
rec(a := 1, b := 2, a := 3)
which ends up being equivalent to
rec(b := 2, a : =3)
.Now, this is clearly my fault, but (I'd argue) when someone writes a
rec
out like this explictly, they probably didn't mean to duplicate the keys!I quickly hacked something together to see if any code exists like this in GAP. I didn't find any in the kernel, but there are a bunch in PackageInfo.gs. This makes sense, because those are fairly long records, written by hand. There are also more in packages. From my initial check, none of them seem to be a bug, but we could go through and report them all.
I could tidy up my for reporting these issues, the main problem is what should it do? Do we want to make this a warning? Should it be possible to disable that warning? Probably entering the break loop is most useful (as then you see where the issue is), but you wouldn't want that always turned on, as at the moment GAP wouldn't load many packages with that turned on.
Here, from my hacked up code, is all the places where this issue current occurs while loading GAP + packages, it shows keys and values. I have checked and these are all in PackageInfo.g files, most are obvious, for some dates you have to search for that date to find which package it is mentioned in.
The text was updated successfully, but these errors were encountered: