Skip to content

Commit 73dbb99

Browse files
James Mitchelljames-d-mitchell
authored andcommitted
Linting
1 parent 3d07a49 commit 73dbb99

39 files changed

+271
-276
lines changed

.gaplint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
disable:
2+
- align-assignments

.gaplint_ignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

PackageInfo.g

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#############################################################################
22
##
3-
#W PackageInfo.g
4-
#Y Copyright (C) 2015-18 James D. Mitchell
3+
## PackageInfo.g
4+
## Copyright (C) 2015-18 James D. Mitchell
55
##
66
## Licensing information can be found in the README.md file of this package.
77
##

doc/cliques.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
determining the clique number of a digraph.
2424
<Example><![CDATA[
2525
gap> gr := CompleteDigraph(4);;
26-
gap> CliqueNumber(gr);
26+
gap> CliqueNumber(gr);
2727
4
2828
gap> gr := Digraph([[1, 2, 4, 4], [1, 3, 4], [2, 1], [1, 2]]);
2929
<multidigraph with 4 vertices, 11 edges>
30-
gap> CliqueNumber(gr);
30+
gap> CliqueNumber(gr);
3131
3]]></Example>
3232
</Description>
3333
</ManSection>
@@ -571,10 +571,10 @@ gap> DigraphIndependentSets(gr, [], [4, 5], 1, 2);
571571
gap> gr := CompleteDigraph(5);
572572
<digraph with 5 vertices, 20 edges>
573573
gap> user_param := [];;
574-
gap> f := function(a, b) # Calculate size of clique
574+
gap> f := function(a, b) # Calculate size of clique
575575
> AddSet(user_param, Size(b));
576576
> end;;
577-
gap> CliquesFinder(gr, f, user_param, infinity, [], [], false, fail,
577+
gap> CliquesFinder(gr, f, user_param, infinity, [], [], false, fail,
578578
> true);
579579
[ 1, 2, 3, 4, 5 ]
580580
gap> CliquesFinder(gr, fail, [], 5, [2, 4], [3], false, fail, false);

doc/io.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ gap> ReadPlainTextDigraph(filename, ",", 1, ['/', '%']);
596596
<Example><![CDATA[
597597
gap> gr := Digraph([[2], [1, 3, 4], [2, 4], [2, 3]]);
598598
<digraph with 4 vertices, 8 edges>
599-
gap> filename := Concatenation(DIGRAPHS_Dir(),
599+
gap> filename := Concatenation(DIGRAPHS_Dir(),
600600
> "/tst/out/dimacs.dimacs");;
601601
gap> WriteDIMACSDigraph(filename, gr);;
602602
gap> ReadDIMACSDigraph(filename);

doc/isomorph.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ gap> gr := Digraph([[2], [3, 3], [3], [2]]);
161161
<multidigraph with 4 vertices, 5 edges>
162162
gap> G := AutomorphismGroup(gr);
163163
Group([ (1,2), (3,4) ])
164-
gap> P1 := Projection(G, 1);
164+
gap> P1 := Projection(G, 1);
165165
1st projection of Group([ (1,2), (3,4) ])
166166
gap> P2 := Projection(G, 2);
167167
2nd projection of Group([ (1,2), (3,4) ])
@@ -270,7 +270,7 @@ gap> gr := Digraph([[2], [3, 3], [3], [2], [2]]);
270270
<multidigraph with 5 vertices, 6 edges>
271271
gap> G := AutomorphismGroup(gr, [1, 1, 2, 3, 1]);
272272
Group([ (1,2), (3,4) ])
273-
gap> P1 := Projection(G, 1);
273+
gap> P1 := Projection(G, 1);
274274
1st projection of Group([ (1,2), (3,4) ])
275275
gap> P2 := Projection(G, 2);
276276
2nd projection of Group([ (1,2), (3,4) ])

doc/orbits.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ true
4848
gap> DigraphGroup(ddigraph);
4949
Group([ (1,2,3,4)(5,6,7,8), (1,5)(2,6)(3,7)(4,8) ])
5050
gap> AutomorphismGroup(ddigraph) =
51-
> Group([(6, 8), (5, 7), (4, 6), (3, 5), (2, 4),
51+
> Group([(6, 8), (5, 7), (4, 6), (3, 5), (2, 4),
5252
> (1, 2)(3, 4)(5, 6)(7, 8)]);
5353
true
5454
gap> digraph := Digraph([[2, 3], [], []]);

doc/prop.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ gap> IsJoinSemilatticeDigraph(gr);
179179
true
180180
gap> IsLatticeDigraph(gr);
181181
true
182-
gap> gr := Digraph([[1, 1, 1], [1, 1, 2, 2],
182+
gap> gr := Digraph([[1, 1, 1], [1, 1, 2, 2],
183183
> [1, 3, 3], [1, 2, 3, 3, 4]]);
184184
<multidigraph with 4 vertices, 15 edges>
185185
gap> IsMeetSemilatticeDigraph(gr);

gap/attr.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#############################################################################
22
##
3-
#W attr.gd
4-
#Y Copyright (C) 2014-17 James D. Mitchell
3+
## attr.gd
4+
## Copyright (C) 2014-17 James D. Mitchell
55
##
66
## Licensing information can be found in the README file of this package.
77
##

gap/attr.gi

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#############################################################################
22
##
3-
#W attr.gi
4-
#Y Copyright (C) 2014-17 James D. Mitchell
3+
## attr.gi
4+
## Copyright (C) 2014-17 James D. Mitchell
55
##
66
## Licensing information can be found in the README file of this package.
77
##
@@ -96,12 +96,12 @@ function(digraph)
9696
ErrorNoReturn("Digraphs: ChromaticNumber: usage,\n",
9797
"the digraph (1st argument) must not have loops,");
9898
elif nr = 0 then
99-
return 0; # chromatic number = 0 iff <digraph> has 0 verts
99+
return 0; # chromatic number = 0 iff <digraph> has 0 verts
100100
elif IsNullDigraph(digraph) then
101-
return 1; # chromatic number = 1 iff <digraph> has >= 1 verts & no edges
101+
return 1; # chromatic number = 1 iff <digraph> has >= 1 verts & no edges
102102
elif IsBipartiteDigraph(digraph) then
103-
return 2; # chromatic number = 2 iff <digraph> has >= 2 verts & is bipartite
104-
# <digraph> has at least 2 vertices at this stage
103+
return 2; # chromatic number = 2 iff <digraph> has >= 2 verts & is bipartite
104+
# <digraph> has at least 2 vertices at this stage
105105
fi;
106106

107107
# The chromatic number of <digraph> is at least 3 and at most nr
@@ -916,9 +916,9 @@ function(digraph)
916916
return rec(diameter := fail, girth := infinity);
917917
fi;
918918

919-
#TODO improve this, really check if the complexity is better with the group
920-
#or without, or if the group is not known, but the number of vertices makes
921-
#the usual algorithm impossible.
919+
# TODO improve this, really check if the complexity is better with the group
920+
# or without, or if the group is not known, but the number of vertices makes
921+
# the usual algorithm impossible.
922922

923923
outer_reps := DigraphOrbitReps(digraph);
924924
diameter := 0;
@@ -1052,7 +1052,7 @@ function(digraph)
10521052

10531053
# The average degree
10541054
m := Float(Sum(OutDegreeSequence(digraph)) / n);
1055-
verts := [1 .. n]; # We don't want DigraphVertices as that's immutable
1055+
verts := [1 .. n]; # We don't want DigraphVertices as that's immutable
10561056

10571057
if IsMultiDigraph(digraph) then
10581058
mat := List(verts, x -> verts * 0);
@@ -1153,7 +1153,7 @@ function(graph, reflexive)
11531153
# Try correct method vis-a-vis complexity
11541154
if m + n + (m * n) < (n * n * n) then
11551155
sorted := DigraphTopologicalSort(graph);
1156-
if sorted <> fail then # Method for big acyclic digraphs (loops allowed)
1156+
if sorted <> fail then # Method for big acyclic digraphs (loops allowed)
11571157
out := EmptyPlist(n);
11581158
trans := EmptyPlist(n);
11591159
for v in sorted do
@@ -1321,21 +1321,22 @@ function(digraph)
13211321
digraph := DigraphSymmetricClosure(DigraphRemoveAllMultipleEdges(digraph));
13221322
colour := ListWithIdenticalEntries(n, 0);
13231323

1324-
#This means there is a vertex we haven't visited yet
1324+
# This means there is a vertex we haven't visited yet
13251325
while 0 in colour do
13261326
root := Position(colour, 0);
13271327
colour[root] := 1;
13281328
queue := [root];
13291329
Append(queue, OutNeighboursOfVertex(digraph, root));
13301330
while queue <> [] do
1331-
#Explore the first element of queue
1331+
# Explore the first element of queue
13321332
node := queue[1];
13331333
node_neighbours := OutNeighboursOfVertex(digraph, node);
13341334
for i in node_neighbours do
1335-
#If node and its neighbour have the same colour, graph is not bipartite
1335+
# If node and its neighbour have the same colour, graph is not
1336+
# bipartite
13361337
if colour[node] = colour[i] then
13371338
return [false, fail, fail];
1338-
elif colour[i] = 0 then # Give i opposite colour to node
1339+
elif colour[i] = 0 then # Give i opposite colour to node
13391340
if colour[node] = 1 then
13401341
colour[i] := 2;
13411342
else

0 commit comments

Comments
 (0)