>
dijkstra(const string &startLabel) const;
// minimum spanning tree using Prim’s algorithm
// ONLY works for NONDIRECTED graphs
// ASSUMES the edge [P->Q] has the same weight as [Q->P]
// @return length of the minimum spanning tree or -1 if start vertex not
int mstPrim(const string &startLabel,
void visit(const string &from, const string &to,
int weight)) const;
// minimum spanning tree using Kruskal’s algorithm
// ONLY works for NONDIRECTED graphs
// ASSUMES the edge [P->Q] has the same weight as [Q->P]
// @return length of the minimum spanning tree or -1 if start vertex not
int mstKruskal(const string &startLabel,
void visit(const string &from, const string &to,
int weight)) const;
};
#endif // GRAPH_H
2022win343d-graph-samsyl916/README.md
# Graph
Graph class with several graph algorithms including depth-first search,
breadth-first search, dijkstra’s shortest path, minimum spanning tree
## Included Files
– `graph.h, graph.cpp`: Graph class
– `graphtest.cpp`: Test functions
– `main.cpp`: A generic main file to call testAll() to run all tests
2022win343d-graph-samsyl916/create-output.sh
#!/bin/bash
# Run this script as `./create-output.sh > output.txt 2>&1`
# How we want to call our executable,
# possibly with some command line parameters
EXEC_PROGRAM=”./a.out ”
# Timestamp for starting this script
date
MACHINE=””
# Display machine name if uname command is available
if hash uname 2>/dev/null; then
uname -a
MACHINE=`uname -a`
fi
# Display user name if id command is available
if hash id 2>/dev/null; then
id
fi
# If we are running as a GitHub action, install programs
GITHUB_MACHINE=’Linux fv-az’
if [[ $MACHINE == *”${GITHUB_MACHINE}”* ]]; then
echo “=====================================================”
echo “Running as a GitHub action, attempting to install programs”
echo “=====================================================”
sudo apt-get update
sudo apt-get install llvm clang-tidy valgrind
fi
# If we are running on CSSLAB and
# clang-tidy is not active, print a message
CSSLAB_MACHINE=’Linux csslab’
CLANG_TIDY_EXE=’/opt/rh/llvm-toolset-7.0/root/bin/clang-tidy’
if [[ $MACHINE == *”${CSSLAB_MACHINE}”* ]]; then
if ! hash clang-tidy 2>/dev/null && [ -e “${CLANG_TIDY_EXE}” ] ; then
echo “=====================================================”
echo “ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ”
echo “clang-tidy NOT found in path (but is in $CLANG_TIDY_EXE )”
echo “Add the following command to ~/.bashrc file”
echo ” source scl_source enable llvm-toolset-7.0″
echo “You can add the command by executing the following line”
echo ” echo \”source scl_source enable llvm-toolset-7.0\” >> ~/.bashrc”
echo “=====================================================”
exit
fi
fi
# delete a.out, do not give any errors if it does not exist
rm ./a.out 2>/dev/null
echo “=====================================================”
echo “1. Compiles without warnings with -Wall -Wextra flags”
echo “=====================================================”
g++ -g -std=c++11 -Wall -Wextra -Wno-sign-compare *.cpp
echo “=====================================================”
echo “2. Runs and produces correct output”
echo “=====================================================”
# Execute program
$EXEC_PROGRAM
echo “=====================================================”
echo “3. clang-tidy warnings are fixed”
echo “=====================================================”
if hash clang-tidy 2>/dev/null; then
clang-tidy *.cpp — -std=c++11
else
echo “WARNING: clang-tidy not available.”
fi
echo “=====================================================”
echo “4. clang-format does not find any formatting issues”
echo “=====================================================”
if hash clang-format 2>/dev/null; then
# different LLVMs have slightly different configurations which can break things, so regenerate
echo “# generated using: clang-format -style=llvm -dump-config > .clang-format” > .clang-format
clang-format -style=llvm -dump-config >> .clang-format
for f in ./*.cpp; do
echo “Running clang-format on $f”
clang-format $f | diff $f –
done
else
echo “WARNING: clang-format not available”
fi
echo “=====================================================”
echo “5. No memory leaks using g++”
echo “=====================================================”
rm ./a.out 2>/dev/null
g++ -std=c++11 -fsanitize=address -fno-omit-frame-pointer -g *.cpp
# Execute program
$EXEC_PROGRAM > /dev/null 2> /dev/null
echo “=====================================================”
echo “6. No memory leaks using valgrind, look for \”definitely lost\” ”
echo “=====================================================”
rm ./a.out 2>/dev/null
if hash valgrind 2>/dev/null; then
g++ -g -std=c++11 *.cpp
# redirect program output to /dev/null will running valgrind
valgrind –log-file=”valgrind-output.txt” $EXEC_PROGRAM > /dev/null 2>/dev/null
cat valgrind-output.txt
rm valgrind-output.txt 2>/dev/null
else
echo “WARNING: valgrind not available”
fi
echo “=====================================================”
echo “7. Tests have full code coverage”
echo “=====================================================”
if [ -f “check-code-coverage.sh” ]; then
./check-code-coverage.sh
else
echo “WARNING: check-code-coverage.sh script is missing”
fi
# Remove the executable
rm -rf ./a.out* 2>/dev/null
date
echo “=====================================================”
echo “To create an output.txt file with all the output from this script”
echo “Run the below command”
echo ” ./create-output.sh > output.txt 2>&1 ”
echo “=====================================================”
2022win343d-graph-samsyl916/.gitignore
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Mac
Info.plist
# VSCode
.vscode/settings.json
2022win343d-graph-samsyl916/.clang-format
# generated using: clang-format -style=llvm -dump-config > .clang-format
—
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: ‘^ IWYU pragma:’
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
– foreach
– Q_FOREACH
– BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
– Regex: ‘^”(llvm|llvm-c|clang|clang-c)/’
Priority: 2
– Regex: ‘^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...
__MACOSX/2022win343d-graph-samsyl916/._.github
2022win343d-graph-samsyl916/.gitattributes
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Always have LF for unix script
simplecompile.sh eol=lf
2022win343d-graph-samsyl916/graph4.txt
17
A B 6
A E 2
A F 2
A H 8
B D 9
B E 1
B H 5
C K 4
C L 3
D K 1
E G 1
E I 1
E J 3
F G 6
H L 3
I J 3
I K 1
__MACOSX/2022win343d-graph-samsyl916/._.git
2022win343d-graph-samsyl916/check-code-coverage.sh
#!/bin/bash
# Compile the program with code coverage flags and generate report
# Basedon information from
# https://github.com/mapbox/cpp/blob/master/docs/coverage.md
# How we want to call our executable,
# possibly with some command line parameters
EXEC_PROGRAM="./a.out "
######################################################################
PROG=$0
EXE="a.out"
PROFDATA=$EXE.profdata
CC=clang++
rm $EXE $PROFDATA default.profraw 2>/dev/null
programs=($CC “llvm-profdata” “llvm-cov”)
for p in “${programs[@]}”; do
if ! hash $CC 2>/dev/null; then
echo “ERROR: $PROG: cannot find $CC executable”
exit 1
fi
done
$CC -g -std=c++11 -fprofile-instr-generate -fcoverage-mapping *.cpp -o $EXE
if [ ! -f $EXE ]; then
echo “ERROR: $PROG: Failed to create executable”
exit 1
fi
# Execute the program
$EXEC_PROGRAM > /dev/null 2>/dev/null
if [ ! -f “default.profraw” ]; then
echo “ERROR: $PROG: Failed to create default.profraw data”
rm -rf ./a.out*
exit 1
fi
llvm-profdata merge default.profraw -output=$PROFDATA
if [ ! -f $PROFDATA ]; then
echo “ERROR: $PROG: Failed to create $PROFDATA”
rm -rf ./a.out* default.profraw
exit 1
fi
# GitHub actions do not have demangler program
if hash llvm-cxxfilt 2>/dev/null; then
llvm-cov report -show-functions=1 -Xdemangler=llvm-cxxfilt $EXE -instr-profile=$PROFDATA *.cpp
else
llvm-cov report -show-functions=1 $EXE -instr-profile=$PROFDATA *.cpp
fi
echo “=====================================================”
echo “The lines below were never executed”
echo “=====================================================”
llvm-cov show $EXE -instr-profile=$PROFDATA | grep ” 0|”
rm -rf ./a.out* $EXE $PROFDATA default.profraw 2>/dev/null
2022win343d-graph-samsyl916/graph3.txt
7
K F 0
F C 0
F J 0
K N 0
N L 0
L M 0
N O 0
2022win343d-graph-samsyl916/graph2.txt
24
A B 0
A C 0
A D 0
B E 0
B F 0
C G 0
D H 0
D I 0
F J 0
G K 0
G L 0
H M 0
I M 0
I N 0
O P 5
O Q 2
P R 2
Q R 1
R O 1
R S 3
S R 1
S T 2
S U 3
T O 8
2022win343d-graph-samsyl916/main.cpp
2022win343d-graph-samsyl916/main.cpp
/**
* Driver for tests
*/
#include
<
iostream
>
using
namespace
std
;
// forward declaration, implementation in xxxtest.cpp
void
testAll
();
int
main
()
{
testAll
();
cout
<<
"Done!"
<<
endl
;
return
0
;
}
2022win343d-graph-samsyl916/output.txt
Sun Jan 24 08:54:43 PST 2021
Darwin silvery 17.7.0 Darwin Kernel Version 17.7.0: Fri Oct 30 13:34:27 PDT 2020; root:xnu-4570.71.82.8~1/RELEASE_X86_64 x86_64
uid=501(yusuf) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),701(com.apple.sharepoint.group.1),702(com.apple.sharepoint.group.2)
=====================================================
1. Compiles without warnings with -Wall -Wextra flags
=====================================================
=====================================================
2. Runs and produces correct output
=====================================================
testGraph0DFS
testGraph0BFS
testGraph0Dijkstra
testGraph0NotDirected
testGraph1
Done!
=====================================================
3. clang-tidy warnings are fixed
=====================================================
6 warnings generated.
25715 warnings generated.
47959 warnings generated.
67631 warnings generated.
88632 warnings generated.
/Users/yusuf/bitbucket/pisan343/graph-solution/edge.h:20:16: warning: invalid case style for parameter 'from' [readability-identifier-naming]
Edge(Vertex *from, Vertex *to, int weight)
^~~~
From
/Users/yusuf/bitbucket/pisan343/graph-solution/edge.h:20:30: warning: invalid case style for parameter 'to' [readability-identifier-naming]
Edge(Vertex *from, Vertex *to, int weight)
^~
To
/Users/yusuf/bitbucket/pisan343/graph-solution/edge.h:20:38: warning: invalid case style for parameter 'weight' [readability-identifier-naming]
Edge(Vertex *from, Vertex *to, int weight)
^~~~~~
Weight
/Users/yusuf/bitbucket/pisan343/graph-solution/edge.h:24:11: warning: invalid case style for member 'from' [readability-identifier-naming]
Vertex *from;
^~~~
From
/Users/yusuf/bitbucket/pisan343/graph-solution/edge.h:27:11: warning: invalid case style for member 'to' [readability-identifier-naming]
Vertex *to;
^~
To
/Users/yusuf/bitbucket/pisan343/graph-solution/edge.h:30:7: warning: invalid case style for member 'weight' [readability-identifier-naming]
int weight;
^~~~~~
Weight
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:14:19: warning: invalid case style for parameter 'directionalEdges' [readability-identifier-naming]
Graph::Graph(bool directionalEdges)
^~~~~~~~~~~~~~~~
DirectionalEdges
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:18:14: warning: invalid case style for variable 'vp' [readability-identifier-naming]
for (auto &vp : vertices)
^~
Vp
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:26:40: warning: invalid case style for parameter 'label' [readability-identifier-naming]
int Graph::neighborsSize(const string &label) const {
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:27:11: warning: invalid case style for variable 'v' [readability-identifier-naming]
Vertex *v = findVertex(label);
^
V
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:31:31: warning: invalid case style for parameter 'label' [readability-identifier-naming]
bool Graph::add(const string &label) {
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:32:11: warning: invalid case style for variable 'v' [readability-identifier-naming]
Vertex *v = findVertex(label);
^
V
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:39:36: warning: invalid case style for parameter 'label' [readability-identifier-naming]
bool Graph::contains(const string &label) const {
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:40:10: warning: invalid case style for variable 'vLabel' [readability-identifier-naming]
string vLabel = modifyIfAllDigits(label);
^~~~~~
VLabel
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:44:46: warning: invalid case style for parameter 'label' [readability-identifier-naming]
string Graph::getEdgesAsString(const string &label) const {
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:45:3: warning: 'auto V' can be declared as 'auto *V' [llvm-qualified-auto]
auto V = findVertex(label);
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:45:3: warning: 'auto V' can be declared as 'auto *V' [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:51:35: warning: invalid case style for parameter 'from' [readability-identifier-naming]
bool Graph::connect(const string &from, const string &to, int weight) {
^~~~
From
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:51:55: warning: invalid case style for parameter 'to' [readability-identifier-naming]
bool Graph::connect(const string &from, const string &to, int weight) {
^~
To
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:51:63: warning: invalid case style for parameter 'weight' [readability-identifier-naming]
bool Graph::connect(const string &from, const string &to, int weight) {
^~~~~~
Weight
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:54:3: warning: 'auto fx' can be declared as 'auto *fx' [llvm-qualified-auto]
auto fx = findVertex(from);
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:54:3: warning: 'auto fx' can be declared as 'auto *fx' [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:54:8: warning: invalid case style for variable 'fx' [readability-identifier-naming]
auto fx = findVertex(from);
^~
Fx
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:57:3: warning: 'auto tx' can be declared as 'auto *tx' [llvm-qualified-auto]
auto tx = findVertex(to);
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:57:3: warning: 'auto tx' can be declared as 'auto *tx' [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:57:8: warning: invalid case style for variable 'tx' [readability-identifier-naming]
auto tx = findVertex(to);
^~
Tx
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:73:38: warning: invalid case style for parameter 'from' [readability-identifier-naming]
bool Graph::disconnect(const string &from, const string &to) {
^~~~
From
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:73:58: warning: invalid case style for parameter 'to' [readability-identifier-naming]
bool Graph::disconnect(const string &from, const string &to) {
^~
To
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:74:3: warning: 'auto fx' can be declared as 'auto *fx' [llvm-qualified-auto]
auto fx = findVertex(from);
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:74:3: warning: 'auto fx' can be declared as 'auto *fx' [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:74:8: warning: invalid case style for variable 'fx' [readability-identifier-naming]
auto fx = findVertex(from);
^~
Fx
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:75:3: warning: 'auto tx' can be declared as 'auto *tx' [llvm-qualified-auto]
auto tx = findVertex(to);
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:75:3: warning: 'auto tx' can be declared as 'auto *tx' [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:75:8: warning: invalid case style for variable 'tx' [readability-identifier-naming]
auto tx = findVertex(to);
^~
Tx
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:78:8: warning: invalid case style for variable 'successfullyDisconnected' [readability-identifier-naming]
bool successfullyDisconnected = fx->disconnect(tx);
^~~~~~~~~~~~~~~~~~~~~~~~
SuccessfullyDisconnected
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:84:41: warning: invalid case style for parameter ‘label’ [readability-identifier-naming]
Vertex *Graph::findVertex(const string &label) const {
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:85:10: warning: invalid case style for variable ‘vLabel’ [readability-identifier-naming]
string vLabel = modifyIfAllDigits(label);
^~~~~~
VLabel
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:86:8: warning: invalid case style for variable ‘vp’ [readability-identifier-naming]
auto vp = vertices.find(vLabel);
^~
Vp
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:90:47: warning: invalid case style for parameter ‘label’ [readability-identifier-naming]
string Graph::modifyIfAllDigits(const string &label) {
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:95:8: warning: invalid case style for variable ‘allD’ [readability-identifier-naming]
bool allD = true;
^~~~
AllD
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:96:7: warning: invalid case style for variable ‘i’ [readability-identifier-naming]
int i = 0;
^
I
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:102:10: warning: invalid case style for variable ‘c’ [readability-identifier-naming]
char c = static_cast(‘A’ + stoi(label));
^
C
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:108:43: warning: invalid case style for parameter ‘label’ [readability-identifier-naming]
Vertex *Graph::createVertex(const string &label) {
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:109:10: warning: invalid case style for variable ‘vLabel’ [readability-identifier-naming]
string vLabel = modifyIfAllDigits(label);
^~~~~~
VLabel
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:110:3: warning: ‘auto v’ can be declared as ‘auto *v’ [llvm-qualified-auto]
auto v = new Vertex(vLabel);
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:110:3: warning: ‘auto v’ can be declared as ‘auto *v’ [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:110:8: warning: invalid case style for variable ‘v’ [readability-identifier-naming]
auto v = new Vertex(vLabel);
^
V
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:116:14: warning: invalid case style for variable ‘vp’ [readability-identifier-naming]
for (auto &vp : vertices)
^~
Vp
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:120:31: warning: invalid case style for parameter ‘startLabel’ [readability-identifier-naming]
void Graph::dfs(const string &startLabel, void visit(const string &label)) {
^~~~~~~~~~
StartLabel
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:120:48: warning: invalid case style for parameter ‘visit’ [readability-identifier-naming]
void Graph::dfs(const string &startLabel, void visit(const string &label)) {
^~~~~
Visit
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:120:68: warning: invalid case style for parameter ‘label’ [readability-identifier-naming]
void Graph::dfs(const string &startLabel, void visit(const string &label)) {
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:121:3: warning: ‘auto v’ can be declared as ‘auto *v’ [llvm-qualified-auto]
auto v = findVertex(startLabel);
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:121:3: warning: ‘auto v’ can be declared as ‘auto *v’ [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:121:8: warning: invalid case style for variable ‘v’ [readability-identifier-naming]
auto v = findVertex(startLabel);
^
V
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:128:31: warning: invalid case style for parameter ‘v’ [readability-identifier-naming]
void Graph::dfsHelper(Vertex *v, void visit(const string &label)) {
^
V
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:128:39: warning: invalid case style for parameter ‘visit’ [readability-identifier-naming]
void Graph::dfsHelper(Vertex *v, void visit(const string &label)) {
^~~~~
Visit
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:128:59: warning: invalid case style for parameter ‘label’ [readability-identifier-naming]
void Graph::dfsHelper(Vertex *v, void visit(const string &label)) {
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:130:10: warning: invalid case style for variable ‘label’ [readability-identifier-naming]
string label = v->label;
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:132:14: warning: invalid case style for variable ‘e’ [readability-identifier-naming]
for (auto &e : v->edges) {
^
E
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:138:31: warning: invalid case style for parameter ‘startLabel’ [readability-identifier-naming]
void Graph::bfs(const string &startLabel, void visit(const string &label)) {
^~~~~~~~~~
StartLabel
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:138:48: warning: invalid case style for parameter ‘visit’ [readability-identifier-naming]
void Graph::bfs(const string &startLabel, void visit(const string &label)) {
^~~~~
Visit
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:138:68: warning: invalid case style for parameter ‘label’ [readability-identifier-naming]
void Graph::bfs(const string &startLabel, void visit(const string &label)) {
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:139:11: warning: invalid case style for variable ‘v’ [readability-identifier-naming]
Vertex *v = findVertex(startLabel);
^
V
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:146:31: warning: invalid case style for parameter ‘v’ [readability-identifier-naming]
void Graph::bfsHelper(Vertex *v, void visit(const string &label)) {
^
V
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:146:39: warning: invalid case style for parameter ‘visit’ [readability-identifier-naming]
void Graph::bfsHelper(Vertex *v, void visit(const string &label)) {
^~~~~
Visit
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:146:59: warning: invalid case style for parameter ‘label’ [readability-identifier-naming]
void Graph::bfsHelper(Vertex *v, void visit(const string &label)) {
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:147:19: warning: invalid case style for variable ‘vertexQueue’ [readability-identifier-naming]
queue vertexQueue;
^~~~~~~~~~~
VertexQueue
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:152:5: warning: ‘auto front’ can be declared as ‘auto *front’ [llvm-qualified-auto]
auto front = vertexQueue.front();
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:152:5: warning: ‘auto front’ can be declared as ‘auto *front’ [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:152:10: warning: invalid case style for variable ‘front’ [readability-identifier-naming]
auto front = vertexQueue.front();
^~~~~
Front
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:154:12: warning: invalid case style for variable ‘label’ [readability-identifier-naming]
string label = front->label;
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:156:16: warning: invalid case style for variable ‘e’ [readability-identifier-naming]
for (auto &e : front->edges) {
^
E
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:168:31: warning: invalid case style for parameter ‘startLabel’ [readability-identifier-naming]
Graph::dijkstra(const string &startLabel) const {
^~~~~~~~~~
StartLabel
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:169:20: warning: invalid case style for variable ‘weights’ [readability-identifier-naming]
map weights;
^~~~~~~
Weights
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:170:23: warning: invalid case style for variable ‘previous’ [readability-identifier-naming]
map previous;
^~~~~~~~
Previous
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:171:11: warning: invalid case style for variable ‘startVertex’ [readability-identifier-naming]
Vertex *startVertex = findVertex(startLabel);
^~~~~~~~~~~
StartVertex
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:175:47: warning: invalid case style for variable ‘pq’ [readability-identifier-naming]
priority_queue, greater> pq;
^~
Pq
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:176:17: warning: invalid case style for variable ‘vertexSet’ [readability-identifier-naming]
set vertexSet;
^~~~~~~~~
VertexSet
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:179:20: warning: invalid case style for variable ‘e’ [readability-identifier-naming]
for (const auto &e : startVertex->edges) {
^
E
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:185:5: warning: ‘auto v’ can be declared as ‘auto *v’ [llvm-qualified-auto]
auto v = pq.top().second;
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:185:5: warning: ‘auto v’ can be declared as ‘auto *v’ [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:185:10: warning: invalid case style for variable ‘v’ [readability-identifier-naming]
auto v = pq.top().second;
^
V
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:190:22: warning: invalid case style for variable ‘e’ [readability-identifier-naming]
for (const auto &e : v->edges) {
^
E
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:191:7: warning: ‘auto u’ can be declared as ‘auto *u’ [llvm-qualified-auto]
auto u = e->to;
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:191:7: warning: ‘auto u’ can be declared as ‘auto *u’ [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:191:12: warning: invalid case style for variable ‘u’ [readability-identifier-naming]
auto u = e->to;
^
U
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:194:11: warning: invalid case style for variable ‘newPathCost’ [readability-identifier-naming]
int newPathCost = weights[v->label] + e->weight;
^~~~~~~~~~~
NewPathCost
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:195:14: warning: invalid case style for variable ‘uLabel’ [readability-identifier-naming]
string uLabel = u->label;
^~~~~~
ULabel
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:212:30: warning: invalid case style for parameter ‘startLabel’ [readability-identifier-naming]
int Graph::mst(const string &startLabel,
^~~~~~~~~~
StartLabel
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:213:21: warning: invalid case style for parameter ‘visit’ [readability-identifier-naming]
void visit(const string &from, const string &to,
^~~~~
Visit
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:213:41: warning: invalid case style for parameter ‘from’ [readability-identifier-naming]
void visit(const string &from, const string &to,
^~~~
From
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:213:61: warning: invalid case style for parameter ‘to’ [readability-identifier-naming]
void visit(const string &from, const string &to,
^~
To
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:214:31: warning: invalid case style for parameter ‘weight’ [readability-identifier-naming]
int weight)) const {
^~~~~~
Weight
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:215:3: warning: ‘auto v’ can be declared as ‘auto *v’ [llvm-qualified-auto]
auto v = findVertex(startLabel);
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:215:3: warning: ‘auto v’ can be declared as ‘auto *v’ [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:215:8: warning: invalid case style for variable ‘v’ [readability-identifier-naming]
auto v = findVertex(startLabel);
^
V
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:218:17: warning: invalid case style for variable ‘mstVertices’ [readability-identifier-naming]
set mstVertices;
^~~~~~~~~~~
MstVertices
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:220:53: warning: invalid case style for variable ‘potentials’ [readability-identifier-naming]
priority_queue, greater> potentials;
^~~~~~~~~~
Potentials
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:221:7: warning: invalid case style for variable ‘total’ [readability-identifier-naming]
int total = 0;
^~~~~
Total
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:223:8: warning: ‘auto E’ can be declared as ‘auto *E’ [llvm-qualified-auto]
for (auto E : v->edges)
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:223:8: warning: ‘auto E’ can be declared as ‘auto *E’ [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:226:5: warning: ‘auto e’ can be declared as ‘auto *e’ [llvm-qualified-auto]
auto e = potentials.top().second;
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:226:5: warning: ‘auto e’ can be declared as ‘auto *e’ [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:226:10: warning: invalid case style for variable ‘e’ [readability-identifier-naming]
auto e = potentials.top().second;
^
E
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:233:10: warning: ‘auto e2’ can be declared as ‘auto *e2’ [llvm-qualified-auto]
for (auto e2 : e->to->edges)
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:233:10: warning: ‘auto e2’ can be declared as ‘auto *e2’ [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:233:15: warning: invalid case style for variable ‘e2’ [readability-identifier-naming]
for (auto e2 : e->to->edges)
^~
E2
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:255:36: warning: invalid case style for parameter ‘filename’ [readability-identifier-naming]
bool Graph::readFile(const string &filename) {
^~~~~~~~
Filename
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:256:12: warning: invalid case style for variable ‘myfile’ [readability-identifier-naming]
ifstream myfile(filename);
^~~~~~
Myfile
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:261:7: warning: variable ‘edges’ is not initialized [cppcoreguidelines-init-variables]
int edges;
^
= 0
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:261:7: warning: invalid case style for variable ‘edges’ [readability-identifier-naming]
int edges;
^~~~~
Edges
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:262:7: warning: variable ‘weight’ is not initialized [cppcoreguidelines-init-variables]
int weight;
^
= 0
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:262:7: warning: invalid case style for variable ‘weight’ [readability-identifier-naming]
int weight;
^~~~~~
Weight
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:263:10: warning: invalid case style for variable ‘fromVertex’ [readability-identifier-naming]
string fromVertex;
^~~~~~~~~~
FromVertex
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:264:10: warning: invalid case style for variable ‘toVertex’ [readability-identifier-naming]
string toVertex;
^~~~~~~~
ToVertex
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.cpp:266:12: warning: invalid case style for variable ‘i’ [readability-identifier-naming]
for (int i = 0; i < edges; ++i) {
^ ~ ~
I I I
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:21:23: warning: invalid case style for parameter 'directionalEdges' [readability-identifier-naming]
explicit Graph(bool directionalEdges = true);
^~~~~~~~~~~~~~~~
DirectionalEdges
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:27:26: warning: invalid case style for parameter 'label' [readability-identifier-naming]
bool add(const string &label);
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:30:31: warning: invalid case style for parameter 'label' [readability-identifier-naming]
bool contains(const string &label) const;
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:40:30: warning: invalid case style for parameter 'from' [readability-identifier-naming]
bool connect(const string &from, const string &to, int weight = 0);
^~~~
From
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:40:50: warning: invalid case style for parameter 'to' [readability-identifier-naming]
bool connect(const string &from, const string &to, int weight = 0);
^~
To
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:40:58: warning: invalid case style for parameter 'weight' [readability-identifier-naming]
bool connect(const string &from, const string &to, int weight = 0);
^~~~~~
Weight
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:44:33: warning: invalid case style for parameter 'from' [readability-identifier-naming]
bool disconnect(const string &from, const string &to);
^~~~
From
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:44:53: warning: invalid case style for parameter 'to' [readability-identifier-naming]
bool disconnect(const string &from, const string &to);
^~
To
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:50:35: warning: invalid case style for parameter 'label' [readability-identifier-naming]
int neighborsSize(const string &label) const;
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:54:41: warning: invalid case style for parameter 'label' [readability-identifier-naming]
string getEdgesAsString(const string &label) const;
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:61:31: warning: invalid case style for parameter 'filename' [readability-identifier-naming]
bool readFile(const string &filename);
^~~~~~~~
Filename
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:64:26: warning: invalid case style for parameter 'startLabel' [readability-identifier-naming]
void dfs(const string &startLabel, void visit(const string &label));
^~~~~~~~~~
StartLabel
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:64:43: warning: invalid case style for parameter 'visit' [readability-identifier-naming]
void dfs(const string &startLabel, void visit(const string &label));
^~~~~
Visit
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:64:63: warning: invalid case style for parameter 'label' [readability-identifier-naming]
void dfs(const string &startLabel, void visit(const string &label));
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:68:26: warning: invalid case style for parameter 'startLabel' [readability-identifier-naming]
void bfs(const string &startLabel, void visit(const string &label));
^~~~~~~~~~
StartLabel
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:68:43: warning: invalid case style for parameter 'visit' [readability-identifier-naming]
void bfs(const string &startLabel, void visit(const string &label));
^~~~~
Visit
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:68:63: warning: invalid case style for parameter 'label' [readability-identifier-naming]
void bfs(const string &startLabel, void visit(const string &label));
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:76:26: warning: invalid case style for parameter 'startLabel' [readability-identifier-naming]
dijkstra(const string &startLabel) const;
^~~~~~~~~~
StartLabel
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:82:25: warning: invalid case style for parameter 'startLabel' [readability-identifier-naming]
int mst(const string &startLabel,
^~~~~~~~~~
StartLabel
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:83:16: warning: invalid case style for parameter 'visit' [readability-identifier-naming]
void visit(const string &from, const string &to, int weight)) const;
^~~~~
Visit
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:83:36: warning: invalid case style for parameter 'from' [readability-identifier-naming]
void visit(const string &from, const string &to, int weight)) const;
^~~~
From
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:83:56: warning: invalid case style for parameter 'to' [readability-identifier-naming]
void visit(const string &from, const string &to, int weight)) const;
^~
To
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:83:64: warning: invalid case style for parameter 'weight' [readability-identifier-naming]
void visit(const string &from, const string &to, int weight)) const;
^~~~~~
Weight
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:88:8: warning: invalid case style for member 'directionalEdges' [readability-identifier-naming]
bool directionalEdges;
^~~~~~~~~~~~~~~~
DirectionalEdges
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:94:33: warning: invalid case style for parameter 'v' [readability-identifier-naming]
static void dfsHelper(Vertex *v, void visit(const string &label));
^
V
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:94:41: warning: invalid case style for parameter 'visit' [readability-identifier-naming]
static void dfsHelper(Vertex *v, void visit(const string &label));
^~~~~
Visit
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:94:61: warning: invalid case style for parameter 'label' [readability-identifier-naming]
static void dfsHelper(Vertex *v, void visit(const string &label));
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:97:33: warning: invalid case style for parameter 'v' [readability-identifier-naming]
static void bfsHelper(Vertex *v, void visit(const string &label));
^
V
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:97:41: warning: invalid case style for parameter 'visit' [readability-identifier-naming]
static void bfsHelper(Vertex *v, void visit(const string &label));
^~~~~
Visit
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:97:61: warning: invalid case style for parameter 'label' [readability-identifier-naming]
static void bfsHelper(Vertex *v, void visit(const string &label));
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:101:36: warning: invalid case style for parameter 'label' [readability-identifier-naming]
Vertex *findVertex(const string &label) const;
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:104:38: warning: invalid case style for parameter 'label' [readability-identifier-naming]
Vertex *createVertex(const string &label);
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:107:7: warning: use default member initializer for 'numberOfEdges' [modernize-use-default-member-init]
int numberOfEdges;
^
{0}
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:107:7: warning: invalid case style for member 'numberOfEdges' [readability-identifier-naming]
int numberOfEdges;
^~~~~~~~~~~~~
NumberOfEdges
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:110:25: warning: invalid case style for member 'vertices' [readability-identifier-naming]
map vertices;
^~~~~~~~
Vertices
/Users/yusuf/bitbucket/pisan343/graph-solution/graph.h:112:49: warning: invalid case style for parameter ‘label’ [readability-identifier-naming]
static string modifyIfAllDigits(const string &label);
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:21:30: warning: invalid case style for parameter ‘os’ [readability-identifier-naming]
ostream &operator<<(ostream &os, const Vertex &v) {
^~
Os
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:21:48: warning: invalid case style for parameter 'v' [readability-identifier-naming]
ostream &operator<<(ostream &os, const Vertex &v) {
^
V
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:25:30: warning: invalid case style for parameter 'label' [readability-identifier-naming]
Vertex::Vertex(const string &label) : label{label} {}
^~~~~ ~~~~~
Label Label
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:28:8: warning: 'auto e' can be declared as 'auto *e' [llvm-qualified-auto]
for (auto e : edges)
^
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:28:8: warning: 'auto e' can be declared as 'auto *e' [readability-qualified-auto]
note: this fix will not be applied because it overlaps with another fix
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:28:13: warning: invalid case style for variable 'e' [readability-identifier-naming]
for (auto e : edges)
^
E
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:32:30: warning: invalid case style for parameter 'toVertex' [readability-identifier-naming]
bool Vertex::hasEdge(Vertex *toVertex) const {
^~~~~~~~
ToVertex
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:36:34: warning: invalid case style for parameter 'e' [readability-identifier-naming]
[toVertex](Edge *e) { return e->to == toVertex; });
^ ~
E E
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:47:9: warning: variable ‘e’ is not initialized [cppcoreguidelines-init-variables]
Edge *e;
^
= nullptr
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:47:9: warning: invalid case style for variable ‘e’ [readability-identifier-naming]
Edge *e;
^
E
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:49:16: warning: invalid case style for variable ‘ss’ [readability-identifier-naming]
stringstream ss;
^~
Ss
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:60:30: warning: invalid case style for parameter ‘to’ [readability-identifier-naming]
bool Vertex::connect(Vertex *to, int edgeWeight) {
^~
To
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:60:38: warning: invalid case style for parameter ‘edgeWeight’ [readability-identifier-naming]
bool Vertex::connect(Vertex *to, int edgeWeight) {
^~~~~~~~~~
EdgeWeight
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:61:9: warning: invalid case style for variable ‘myEdge’ [readability-identifier-naming]
auto *myEdge = new Edge(this, to, edgeWeight);
^~~~~~
MyEdge
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:63:51: warning: invalid case style for parameter ‘a’ [readability-identifier-naming]
sort(edges.begin(), edges.end(), [](class Edge *a, class Edge *b) {
^
A
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:63:66: warning: invalid case style for parameter ‘b’ [readability-identifier-naming]
sort(edges.begin(), edges.end(), [](class Edge *a, class Edge *b) {
^
B
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:71:33: warning: invalid case style for parameter ‘to’ [readability-identifier-naming]
bool Vertex::disconnect(Vertex *to) {
^~
To
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.cpp:74:7: warning: invalid case style for variable ‘index’ [readability-identifier-naming]
int index = 0;
^~~~~
Index
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.h:24:39: warning: invalid case style for parameter ‘os’ [readability-identifier-naming]
friend ostream &operator<<(ostream &os, const Vertex &v);
^~
Os
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.h:24:57: warning: invalid case style for parameter 'v' [readability-identifier-naming]
friend ostream &operator<<(ostream &os, const Vertex &v);
^
V
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.h:30:33: warning: invalid case style for parameter 'label' [readability-identifier-naming]
explicit Vertex(const string &label);
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.h:37:10: warning: invalid case style for member 'label' [readability-identifier-naming]
string label;
^~~~~
Label
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.h:40:8: warning: invalid case style for member 'isVisited' [readability-identifier-naming]
bool isVisited{false};
^~~~~~~~~
IsVisited
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.h:42:24: warning: invalid case style for parameter 'to' [readability-identifier-naming]
bool connect(Vertex *to, int edgeWeight = 0);
^~
To
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.h:42:32: warning: invalid case style for parameter 'edgeWeight' [readability-identifier-naming]
bool connect(Vertex *to, int edgeWeight = 0);
^~~~~~~~~~
EdgeWeight
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.h:43:27: warning: invalid case style for parameter 'to' [readability-identifier-naming]
bool disconnect(Vertex *to);
^~
To
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.h:45:24: warning: invalid case style for parameter 'toVertex' [readability-identifier-naming]
bool hasEdge(Vertex *toVertex) const;
^~~~~~~~
ToVertex
/Users/yusuf/bitbucket/pisan343/graph-solution/vertex.h:51:18: warning: invalid case style for member 'edges' [readability-identifier-naming]
vector edges;
^~~~~
Edges
Suppressed 88380 warnings (88379 in non-user code, 1 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
=====================================================
4. clang-format does not find any formatting issues
=====================================================
Running clang-format on ./edge.cpp
Running clang-format on ./graph.cpp
Running clang-format on ./graphtest.cpp
Running clang-format on ./main.cpp
Running clang-format on ./vertex.cpp
=====================================================
5. No memory leaks using g++
=====================================================
=====================================================
6. No memory leaks using valgrind, look for “definitely lost”
=====================================================
==77354== Memcheck, a memory error detector
==77354== Copyright (C) 2002-2017, and GNU GPL’d, by Julian Seward et al.
==77354== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==77354== Command: ./a.out
==77354== Parent PID: 77148
==77354==
==77354==
==77354== HEAP SUMMARY:
==77354== in use at exit: 84,039 bytes in 168 blocks
==77354== total heap usage: 432 allocs, 264 frees, 160,759 bytes allocated
==77354==
==77354== LEAK SUMMARY:
==77354== definitely lost: 0 bytes in 0 blocks
==77354== indirectly lost: 0 bytes in 0 blocks
==77354== possibly lost: 72 bytes in 3 blocks
==77354== still reachable: 65,736 bytes in 7 blocks
==77354== suppressed: 18,231 bytes in 158 blocks
==77354== Rerun with –leak-check=full to see details of leaked memory
==77354==
==77354== For lists of detected and suppressed errors, rerun with: -s
==77354== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 1 from 1)
=====================================================
7. Tests have full code coverage
=====================================================
warning: default.profraw: Unsupported instrumentation profile format version
error: No profiles could be merged.
ERROR: ./check-code-coverage.sh: Failed to create a.out.profdata
Sun Jan 24 08:55:46 PST 2021
=====================================================
To create an output.txt file with all the output from this script
Run the below command
./create-output.sh > output.txt 2>&1
=====================================================
2022win343d-graph-samsyl916/graph0.txt
3
A C 8
A B 1
B C 3
# we can write comments since only reading 3 lines
A —->——-> C
\ /
\ /
\-> B ->-
2022win343d-graph-samsyl916/graph1.txt
9
A B 1
B C 1
C D 1
D E 1
E F 1
F G 1
A H 3
H G 1
X Y 10
# we can write comments since only reading 9 lines
A –1–> B –1–> C –1–> D –1–> E –1–> F –1–> G
| ^
| |
3 1
| |
| |
V |
H————————->———>—————–^
X–10–>Y
__MACOSX/2022win343d-graph-samsyl916/._.idea
__MACOSX/2022win343d-graph-samsyl916/.github/._workflows
2022win343d-graph-samsyl916/.git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[submodule]
active = .
[remote “origin”]
url = https://github.com/uwbclass/2022win343d-graph-samsyl916.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch “master”]
remote = origin
merge = refs/heads/master
__MACOSX/2022win343d-graph-samsyl916/.git/._objects
2022win343d-graph-samsyl916/.git/HEAD
ref: refs/heads/master
__MACOSX/2022win343d-graph-samsyl916/.git/._info
__MACOSX/2022win343d-graph-samsyl916/.git/._logs
2022win343d-graph-samsyl916/.git/description
Unnamed repository; edit this file ‘description’ to name the repository.
__MACOSX/2022win343d-graph-samsyl916/.git/._hooks
__MACOSX/2022win343d-graph-samsyl916/.git/._refs
2022win343d-graph-samsyl916/.git/index
2022win343d-graph-samsyl916/.git/packed-refs
# pack-refs with: peeled fully-peeled sorted
edd34264e9d5bbba90854ea9f3ee6f02ff139475 refs/remotes/origin/master
2022win343d-graph-samsyl916/.idea/2022win343d-graph-samsyl916.iml
__MACOSX/2022win343d-graph-samsyl916/.idea/._codeStyles
2022win343d-graph-samsyl916/.idea/vcs.xml
2022win343d-graph-samsyl916/.idea/.gitignore
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
2022win343d-graph-samsyl916/.idea/workspace.xml
1643535254524
1643535254524
2022win343d-graph-samsyl916/.idea/modules.xml
2022win343d-graph-samsyl916/.github/workflows/buildrun.yml
name: Basic compile, code checks, and test run
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
– uses: actions/checkout@v2
– name: Run create-output.sh file
run: chmod 755 create-output.sh; ./create-output.sh
__MACOSX/2022win343d-graph-samsyl916/.git/objects/._pack
__MACOSX/2022win343d-graph-samsyl916/.git/objects/._6e
__MACOSX/2022win343d-graph-samsyl916/.git/objects/._info
2022win343d-graph-samsyl916/.git/info/exclude
# git ls-files –others –exclude-from=.git/info/exclude
# Lines that start with ‘#’ are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
2022win343d-graph-samsyl916/.git/logs/HEAD
0000000000000000000000000000000000000000 edd34264e9d5bbba90854ea9f3ee6f02ff139475 samsyl916 1643535245 -0800 clone: from https://github.com/uwbclass/2022win343d-graph-samsyl916.git
__MACOSX/2022win343d-graph-samsyl916/.git/logs/._refs
2022win343d-graph-samsyl916/.git/hooks/commit-msg.sample
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by “git commit” with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to “commit-msg”.
# Uncomment the below to add a Signed-off-by line to the message.
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
# hook is more suited to it.
#
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n ‘s/^\(.*>\).*$/Signed-off-by: \1/p’)
# grep -qs “^$SOB” “$1” || echo “$SOB” >> “$1”
# This example catches duplicate Signed-off-by lines.
test “” = “$(grep ‘^Signed-off-by: ‘ “$1″ |
sort | uniq -c | sed -e ‘/^[ ]*1[ ]/d’)” || {
echo >&2 Duplicate Signed-off-by lines.
exit 1
}
2022win343d-graph-samsyl916/.git/hooks/pre-rebase.sample
#!/bin/sh
#
# Copyright (c) 2006, 2008 Junio C Hamano
#
# The “pre-rebase” hook is run just before “git rebase” starts doing
# its job, and can prevent the command from running by exiting with
# non-zero status.
#
# The hook is called with the following parameters:
#
# $1 — the upstream the series was forked from.
# $2 — the branch being rebased (or empty when rebasing the current branch).
#
# This sample shows how to prevent topic branches that are already
# merged to ‘next’ branch from getting rebased, because allowing it
# would result in rebasing already published history.
publish=next
basebranch=”$1″
if test “$#” = 2
then
topic=”refs/heads/$2″
else
topic=`git symbolic-ref HEAD` ||
exit 0 ;# we do not interrupt rebasing detached HEAD
fi
case “$topic” in
refs/heads/??/*)
;;
*)
exit 0 ;# we do not interrupt others.
;;
esac
# Now we are dealing with a topic branch being rebased
# on top of master. Is it OK to rebase it?
# Does the topic really exist?
git show-ref -q “$topic” || {
echo >&2 “No such branch $topic”
exit 1
}
# Is topic fully merged to master?
not_in_master=`git rev-list –pretty=oneline ^master “$topic”`
if test -z “$not_in_master”
then
echo >&2 “$topic is fully merged to master; better remove it.”
exit 1 ;# we could allow it, but there is no point.
fi
# Is topic ever merged to next? If so you should not be rebasing it.
only_next_1=`git rev-list ^master “^$topic” ${publish} | sort`
only_next_2=`git rev-list ^master ${publish} | sort`
if test “$only_next_1” = “$only_next_2”
then
not_in_topic=`git rev-list “^$topic” master`
if test -z “$not_in_topic”
then
echo >&2 “$topic is already up to date with master”
exit 1 ;# we could allow it, but there is no point.
else
exit 0
fi
else
not_in_next=`git rev-list –pretty=oneline ^${publish} “$topic”`
/usr/bin/perl -e ‘
my $topic = $ARGV[0];
my $msg = “* $topic has commits already merged to public branch:\n”;
my (%not_in_next) = map {
/^([0-9a-f]+) /;
($1 => 1);
} split(/\n/, $ARGV[1]);
for my $elem (map {
/^([0-9a-f]+) (.*)$/;
[$1 => $2];
} split(/\n/, $ARGV[2])) {
if (!exists $not_in_next{$elem->[0]}) {
if ($msg) {
print STDERR $msg;
undef $msg;
}
print STDERR ” $elem->[1]\n”;
}
}
‘ “$topic” “$not_in_next” “$not_in_master”
exit 1
fi
<<\DOC_END
This sample hook safeguards topic branches that have been
published from being rewound.
The workflow assumed here is:
* Once a topic branch forks from "master", "master" is never
merged into it again (either directly or indirectly).
* Once a topic branch is fully cooked and merged into "master",
it is deleted. If you need to build on top of it to correct
earlier mistakes, a new topic branch is created by forking at
the tip of the "master". This is not strictly necessary, but
it makes it easier to keep your history simple.
* Whenever you need to test or publish your changes to topic
branches, merge them into "next" branch.
The script, being an example, hardcodes the publish branch name
to be "next", but it is trivial to make it configurable via
$GIT_DIR/config mechanism.
With this workflow, you would want to know:
(1) ... if a topic branch has ever been merged to "next". Young
topic branches can have stupid mistakes you would rather
clean up before publishing, and things that have not been
merged into other branches can be easily rebased without
affecting other people. But once it is published, you would
not want to rewind it.
(2) ... if a topic branch has been fully merged to "master".
Then you can delete it. More importantly, you should not
build on top of it -- other people may already want to
change things related to the topic as patches against your
"master", so if you need further changes, it is better to
fork the topic (perhaps with the same name) afresh from the
tip of "master".
Let's look at this example:
o---o---o---o---o---o---o---o---o---o "next"
/ / / /
/ a---a---b A / /
/ / / /
/ / c---c---c---c B /
/ / / \ /
/ / / b---b C \ /
/ / / / \ /
---o---o---o---o---o---o---o---o---o---o---o "master"
A, B and C are topic branches.
* A has one fix since it was merged up to "next".
* B has finished. It has been fully merged up to "master" and "next",
and is ready to be deleted.
* C has not merged to "next" at all.
We would want to allow C to be rebased, refuse A, and encourage
B to be deleted.
To compute (1):
git rev-list ^master ^topic next
git rev-list ^master next
if these match, topic has not merged in next at all.
To compute (2):
git rev-list master..topic
if this is empty, it is fully merged to "master".
DOC_END
2022win343d-graph-samsyl916/.git/hooks/pre-commit.sample
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(git hash-object -t tree /dev/null)
fi
# If you want to allow non-ASCII filenames set this variable to true.
allownonascii=$(git config –type=bool hooks.allownonascii)
# Redirect output to stderr.
exec 1>&2
# Cross platform projects tend to avoid non-ASCII filenames; prevent
# them from being added to the repository. We exploit the fact that the
# printable range starts at the space character and ends with tilde.
if [ “$allownonascii” != “true” ] &&
# Note that the use of brackets around a tr range is ok here, (it’s
# even required, for portability to Solaris 10’s /usr/bin/tr), since
# the square bracket bytes happen to fall in the designated range.
test $(git diff –cached –name-only –diff-filter=A -z $against |
LC_ALL=C tr -d ‘[ -~]\0’ | wc -c) != 0
then
cat <<\EOF
Error: Attempt to add a non-ASCII file name.
This can cause problems if you want to work with people on other platforms.
To be portable it is advisable to rename the file.
If you know what you are doing you can disable this check using:
git config hooks.allownonascii true
EOF
exit 1
fi
# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached $against --
2022win343d-graph-samsyl916/.git/hooks/applypatch-msg.sample
#!/bin/sh
#
# An example hook script to check the commit log message taken by
# applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit. The hook is
# allowed to edit the commit message file.
#
# To enable this hook, rename this file to "applypatch-msg".
. git-sh-setup
commitmsg="$(git rev-parse --git-path hooks/commit-msg)"
test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"}
:
2022win343d-graph-samsyl916/.git/hooks/fsmonitor-watchman.sample
#!/usr/bin/perl
use strict;
use warnings;
use IPC::Open2;
# An example hook script to integrate Watchman
# (https://facebook.github.io/watchman/) with git to speed up detecting
# new and modified files.
#
# The hook is passed a version (currently 2) and last update token
# formatted as a string and outputs to stdout a new update token and
# all files that have been modified since the update token. Paths must
# be relative to the root of the working tree and separated by a single NUL.
#
# To enable this hook, rename this file to "query-watchman" and set
# 'git config core.fsmonitor .git/hooks/query-watchman'
#
my ($version, $last_update_token) = @ARGV;
# Uncomment for debugging
# print STDERR "$0 $version $last_update_token\n";
# Check the hook interface version
if ($version ne 2) {
die "Unsupported query-fsmonitor hook version '$version'.\n" .
"Falling back to scanning...\n";
}
my $git_work_tree = get_working_dir();
my $retry = 1;
my $json_pkg;
eval {
require JSON::XS;
$json_pkg = "JSON::XS";
1;
} or do {
require JSON::PP;
$json_pkg = "JSON::PP";
};
launch_watchman();
sub launch_watchman {
my $o = watchman_query();
if (is_work_tree_watched($o)) {
output_result($o->{clock}, @{$o->{files}});
}
}
sub output_result {
my ($clockid, @files) = @_;
# Uncomment for debugging watchman output
# open (my $fh, “>”, “.git/watchman-output.out”);
# binmode $fh, “:utf8”;
# print $fh “$clockid\n@files\n”;
# close $fh;
binmode STDOUT, “:utf8”;
print $clockid;
print “\0”;
local $, = “\0”;
print @files;
}
sub watchman_clock {
my $response = qx/watchman clock “$git_work_tree”/;
die “Failed to get clock id on ‘$git_work_tree’.\n” .
“Falling back to scanning…\n” if $? != 0;
return $json_pkg->new->utf8->decode($response);
}
sub watchman_query {
my $pid = open2(\*CHLD_OUT, \*CHLD_IN, ‘watchman -j –no-pretty’)
or die “open2() failed: $!\n” .
“Falling back to scanning…\n”;
# In the query expression below we’re asking for names of files that
# changed since $last_update_token but not from the .git folder.
#
# To accomplish this, we’re using the “since” generator to use the
# recency index to select candidate nodes and “fields” to limit the
# output to file names only. Then we’re using the “expression” term to
# further constrain the results.
if (substr($last_update_token, 0, 1) eq “c”) {
$last_update_token = “\”$last_update_token\””;
}
my $query = <<" END";
["query", "$git_work_tree", {
"since": $last_update_token,
"fields": ["name"],
"expression": ["not", ["dirname", ".git"]]
}]
END
# Uncomment for debugging the watchman query
# open (my $fh, ">“, “.git/watchman-query.json”);
# print $fh $query;
# close $fh;
print CHLD_IN $query;
close CHLD_IN;
my $response = do {local $/; };
# Uncomment for debugging the watch response
# open ($fh, “>”, “.git/watchman-response.json”);
# print $fh $response;
# close $fh;
die “Watchman: command returned no output.\n” .
“Falling back to scanning…\n” if $response eq “”;
die “Watchman: command returned invalid output: $response\n” .
“Falling back to scanning…\n” unless $response =~ /^\{/;
return $json_pkg->new->utf8->decode($response);
}
sub is_work_tree_watched {
my ($output) = @_;
my $error = $output->{error};
if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) {
$retry–;
my $response = qx/watchman watch “$git_work_tree”/;
die “Failed to make watchman watch ‘$git_work_tree’.\n” .
“Falling back to scanning…\n” if $? != 0;
$output = $json_pkg->new->utf8->decode($response);
$error = $output->{error};
die “Watchman: $error.\n” .
“Falling back to scanning…\n” if $error;
# Uncomment for debugging watchman output
# open (my $fh, “>”, “.git/watchman-output.out”);
# close $fh;
# Watchman will always return all files on the first query so
# return the fast “everything is dirty” flag to git and do the
# Watchman query just to get it over with now so we won’t pay
# the cost in git to look up each individual file.
my $o = watchman_clock();
$error = $output->{error};
die “Watchman: $error.\n” .
“Falling back to scanning…\n” if $error;
output_result($o->{clock}, (“/”));
$last_update_token = $o->{clock};
eval { launch_watchman() };
return 0;
}
die “Watchman: $error.\n” .
“Falling back to scanning…\n” if $error;
return 1;
}
sub get_working_dir {
my $working_dir;
if ($^O =~ ‘msys’ || $^O =~ ‘cygwin’) {
$working_dir = Win32::GetCwd();
$working_dir =~ tr/\\/\//;
} else {
require Cwd;
$working_dir = Cwd::cwd();
}
return $working_dir;
}
2022win343d-graph-samsyl916/.git/hooks/pre-receive.sample
#!/bin/sh
#
# An example hook script to make use of push options.
# The example simply echoes all push options that start with ‘echoback=’
# and rejects all pushes when the “reject” push option is used.
#
# To enable this hook, rename this file to “pre-receive”.
if test -n “$GIT_PUSH_OPTION_COUNT”
then
i=0
while test “$i” -lt “$GIT_PUSH_OPTION_COUNT”
do
eval “value=\$GIT_PUSH_OPTION_$i”
case “$value” in
echoback=*)
echo “echo from the pre-receive-hook: ${value#*=}” >&2
;;
reject)
exit 1
esac
i=$((i + 1))
done
fi
2022win343d-graph-samsyl916/.git/hooks/prepare-commit-msg.sample
#!/bin/sh
#
# An example hook script to prepare the commit log message.
# Called by “git commit” with the name of the file that has the
# commit message, followed by the description of the commit
# message’s source. The hook’s purpose is to edit the commit
# message file. If the hook fails with a non-zero status,
# the commit is aborted.
#
# To enable this hook, rename this file to “prepare-commit-msg”.
# This hook includes three examples. The first one removes the
# “# Please enter the commit message…” help message.
#
# The second includes the output of “git diff –name-status -r”
# into the message, just before the “git status” output. It is
# commented because it doesn’t cope with –amend or with squashed
# commits.
#
# The third example adds a Signed-off-by line to the message, that can
# still be edited. This is rarely a good idea.
COMMIT_MSG_FILE=$1
COMMIT_SOURCE=$2
SHA1=$3
/usr/bin/perl -i.bak -ne ‘print unless(m/^. Please enter the commit message/..m/^#$/)’ “$COMMIT_MSG_FILE”
# case “$COMMIT_SOURCE,$SHA1” in
# ,|template,)
# /usr/bin/perl -i.bak -pe ‘
# print “\n” . `git diff –cached –name-status -r`
# if /^#/ && $first++ == 0’ “$COMMIT_MSG_FILE” ;;
# *) ;;
# esac
# SOB=$(git var GIT_COMMITTER_IDENT | sed -n ‘s/^\(.*>\).*$/Signed-off-by: \1/p’)
# git interpret-trailers –in-place –trailer “$SOB” “$COMMIT_MSG_FILE”
# if test -z “$COMMIT_SOURCE”
# then
# /usr/bin/perl -i.bak -pe ‘print “\n” if !$first_line++’ “$COMMIT_MSG_FILE”
# fi
2022win343d-graph-samsyl916/.git/hooks/post-update.sample
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to “post-update”.
exec git update-server-info
2022win343d-graph-samsyl916/.git/hooks/pre-merge-commit.sample
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by “git merge” with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message to
# stderr if it wants to stop the merge commit.
#
# To enable this hook, rename this file to “pre-merge-commit”.
. git-sh-setup
test -x “$GIT_DIR/hooks/pre-commit” &&
exec “$GIT_DIR/hooks/pre-commit”
:
2022win343d-graph-samsyl916/.git/hooks/pre-applypatch.sample
#!/bin/sh
#
# An example hook script to verify what is about to be committed
# by applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit.
#
# To enable this hook, rename this file to “pre-applypatch”.
. git-sh-setup
precommit=”$(git rev-parse –git-path hooks/pre-commit)”
test -x “$precommit” && exec “$precommit” ${1+”$@”}
:
2022win343d-graph-samsyl916/.git/hooks/pre-push.sample
#!/bin/sh
# An example hook script to verify what is about to be pushed. Called by “git
# push” after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
# $1 — Name of the remote to which the push is being done
# $2 — URL to which the push is being done
#
# If pushing without using a named remote those arguments will be equal.
#
# Information about the commits which are being pushed is supplied as lines to
# the standard input in the form:
#
#
#
# This sample shows how to prevent push of commits where the log message starts
# with “WIP” (work in progress).
remote=”$1″
url=”$2″
zero=$(git hash-object –stdin &2 “Found WIP commit in $local_ref, not pushing”
exit 1
fi
fi
done
exit 0
2022win343d-graph-samsyl916/.git/hooks/update.sample
#!/bin/sh
#
# An example hook script to block unannotated tags from entering.
# Called by “git receive-pack” with arguments: refname sha1-old sha1-new
#
# To enable this hook, rename this file to “update”.
#
# Config
# ——
# hooks.allowunannotated
# This boolean sets whether unannotated tags will be allowed into the
# repository. By default they won’t be.
# hooks.allowdeletetag
# This boolean sets whether deleting tags will be allowed in the
# repository. By default they won’t be.
# hooks.allowmodifytag
# This boolean sets whether a tag may be modified after creation. By default
# it won’t be.
# hooks.allowdeletebranch
# This boolean sets whether deleting branches will be allowed in the
# repository. By default they won’t be.
# hooks.denycreatebranch
# This boolean sets whether remotely creating branches will be denied
# in the repository. By default this is allowed.
#
# — Command line
refname=”$1″
oldrev=”$2″
newrev=”$3″
# — Safety check
if [ -z “$GIT_DIR” ]; then
echo “Don’t run this script from the command line.” >&2
echo ” (if you want, you could supply GIT_DIR then run” >&2
echo ” $0 [ )” >&2]
exit 1
fi
if [ -z “$refname” -o -z “$oldrev” -o -z “$newrev” ]; then
echo “usage: $0 [ ” >&2]
exit 1
fi
# — Config
allowunannotated=$(git config –type=bool hooks.allowunannotated)
allowdeletebranch=$(git config –type=bool hooks.allowdeletebranch)
denycreatebranch=$(git config –type=bool hooks.denycreatebranch)
allowdeletetag=$(git config –type=bool hooks.allowdeletetag)
allowmodifytag=$(git config –type=bool hooks.allowmodifytag)
# check for no description
projectdesc=$(sed -e ‘1q’ “$GIT_DIR/description”)
case “$projectdesc” in
“Unnamed repository”* | “”)
echo “*** Project description file hasn’t been set” >&2
exit 1
;;
esac
# — Check types
# if $newrev is 0000…0000, it’s a commit to delete a ref.
zero=$(git hash-object –stdin &2
echo “*** Use ‘git tag [ -a | -s ]’ for tags you want to propagate.” >&2
exit 1
fi
;;
refs/tags/*,delete)
# delete tag
if [ “$allowdeletetag” != “true” ]; then
echo “*** Deleting a tag is not allowed in this repository” >&2
exit 1
fi
;;
refs/tags/*,tag)
# annotated tag
if [ “$allowmodifytag” != “true” ] && git rev-parse $refname > /dev/null 2>&1
then
echo “*** Tag ‘$refname’ already exists.” >&2
echo “*** Modifying a tag is not allowed in this repository.” >&2
exit 1
fi
;;
refs/heads/*,commit)
# branch
if [ “$oldrev” = “$zero” -a “$denycreatebranch” = “true” ]; then
echo “*** Creating a branch is not allowed in this repository” >&2
exit 1
fi
;;
refs/heads/*,delete)
# delete branch
if [ “$allowdeletebranch” != “true” ]; then
echo “*** Deleting a branch is not allowed in this repository” >&2
exit 1
fi
;;
refs/remotes/*,commit)
# tracking branch
;;
refs/remotes/*,delete)
# delete tracking branch
if [ “$allowdeletebranch” != “true” ]; then
echo “*** Deleting a tracking branch is not allowed in this repository” >&2
exit 1
fi
;;
*)
# Anything else (is there anything else?)
echo “*** Update hook: unknown type of update to ref $refname of type $newrev_type” >&2
exit 1
;;
esac
# — Finished
exit 0
2022win343d-graph-samsyl916/.git/hooks/push-to-checkout.sample
#!/bin/sh
# An example hook script to update a checked-out tree on a git push.
#
# This hook is invoked by git-receive-pack(1) when it reacts to git
# push and updates reference(s) in its repository, and when the push
# tries to update the branch that is currently checked out and the
# receive.denyCurrentBranch configuration variable is set to
# updateInstead.
#
# By default, such a push is refused if the working tree and the index
# of the remote repository has any difference from the currently
# checked out commit; when both the working tree and the index match
# the current commit, they are updated to match the newly pushed tip
# of the branch. This hook is to be used to override the default
# behaviour; however the code below reimplements the default behaviour
# as a starting point for convenient modification.
#
# The hook receives the commit with which the tip of the current
# branch is going to be updated:
commit=$1
# It can exit with a non-zero status to refuse the push (when it does
# so, it must not modify the index or the working tree).
die () {
echo >&2 “$*”
exit 1
}
# Or it can make any necessary changes to the working tree and to the
# index to bring them to the desired state when the tip of the current
# branch is updated to the new commit, and exit with a zero status.
#
# For example, the hook can simply run git read-tree -u -m HEAD “$1”
# in order to emulate git fetch that is run in the reverse direction
# with git push, as the two-tree form of git read-tree -u -m is
# essentially the same as git switch or git checkout that switches
# branches while keeping the local changes in the working tree that do
# not interfere with the difference between the branches.
# The below is a more-or-less exact translation to shell of the C code
# for the default behaviour for git’s push-to-checkout hook defined in
# the push_to_deploy() function in builtin/receive-pack.c.
#
# Note that the hook will be executed from the repository directory,
# not from the working tree, so if you want to perform operations on
# the working tree, you will have to adapt your code accordingly, e.g.
# by adding “cd ..” or using relative paths.
if ! git update-index -q –ignore-submodules –refresh
then
die “Up-to-date check failed”
fi
if ! git diff-files –quiet –ignore-submodules —
then
die “Working directory has unstaged changes”
fi
# This is a rough translation of:
#
# head_has_history() ? “HEAD” : EMPTY_TREE_SHA1_HEX
if git cat-file -e HEAD 2>/dev/null
then
head=HEAD
else
head=$(git hash-object -t tree –stdin 1643535245 -0800 clone: from https://github.com/uwbclass/2022win343d-graph-samsyl916.git
__MACOSX/2022win343d-graph-samsyl916/.git/logs/refs/remotes/._origin
2022win343d-graph-samsyl916/.git/refs/remotes/origin/HEAD
ref: refs/remotes/origin/master
2022win343d-graph-samsyl916/.git/logs/refs/remotes/origin/HEAD
0000000000000000000000000000000000000000 edd34264e9d5bbba90854ea9f3ee6f02ff139475 samsyl916 1643535245 -0800 clone: from https://github.com/uwbclass/2022win343d-graph-samsyl916.git
Turn in your highest-quality paper
Get a qualified writer to help you with
“ Implement Graph ”
Get high-quality paper
NEW! AI matching with writer