Skip to content

Commit

Permalink
style(hmnrandomread): super-linter, clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-gricourt committed Jan 10, 2023
1 parent 72e7f06 commit 72ffe39
Show file tree
Hide file tree
Showing 33 changed files with 1,985 additions and 1,870 deletions.
166 changes: 166 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
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
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
StatementAttributeLikeMacros:
- Q_EMIT
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: false
IndentWidth: 2
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...

96 changes: 48 additions & 48 deletions include/args.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,62 +12,62 @@

class Args {
private:
std::string soft_name;
std::vector<std::unique_ptr<Reference>> references;
int mean_insert_size = 500;
int std_insert_size = 50;
int length_reads = 150;
bool usage_visible = false;
std::string read1 = "";
std::string read2 = "";
long long int seed = 0;
std::string soft_name;
std::vector<std::unique_ptr<Reference>> references;
int mean_insert_size = 500;
int std_insert_size = 50;
int length_reads = 150;
bool usage_visible = false;
std::string read1 = "";
std::string read2 = "";
long long int seed = 0;

std::string profile_error_id = "";
std::string profile_error_id = "";

std::shared_ptr<ProfileDiversity> profile_diversity = nullptr;
std::shared_ptr<ProfileError> profile_error = nullptr;
std::shared_ptr<ProfileDiversity> profile_diversity = nullptr;
std::shared_ptr<ProfileError> profile_error = nullptr;

public:
Args(std::string);
~Args() = default;
Args(std::string);
~Args() = default;

// Getters Setters
int getNbReads() const noexcept;
int getMeanInsertSize() const noexcept;
int getStdInsertSize() const noexcept;
int getLengthReads() const noexcept;
bool getUsageVisible() const noexcept;
std::string getRead1() const noexcept;
std::string getRead2() const noexcept;
std::string getProfileErrorId() const noexcept;
long long int getSeed() const noexcept;
// Getters Setters
int getNbReads() const noexcept;
int getMeanInsertSize() const noexcept;
int getStdInsertSize() const noexcept;
int getLengthReads() const noexcept;
bool getUsageVisible() const noexcept;
std::string getRead1() const noexcept;
std::string getRead2() const noexcept;
std::string getProfileErrorId() const noexcept;
long long int getSeed() const noexcept;

std::shared_ptr<ProfileError> getProfileError() noexcept;
std::shared_ptr<ProfileDiversity> getProfileDiversity() noexcept;
std::shared_ptr<ProfileError> getProfileError() noexcept;
std::shared_ptr<ProfileDiversity> getProfileDiversity() noexcept;

void setNbReads(const std::string);
void setMeanInsertSize(const std::string);
void setStdInsertSize(const std::string);
void setLengthReads(const std::string);
void setRead1(const std::string &);
void setRead2(const std::string &);
void setSeed(const std::string &);
void setNbReads(const std::string);
void setMeanInsertSize(const std::string);
void setStdInsertSize(const std::string);
void setLengthReads(const std::string);
void setRead1(const std::string &);
void setRead2(const std::string &);
void setSeed(const std::string &);

void setProfileDiversity(const std::string &n);
void setProfileError(const std::string &n);
void setProfileErrorId(const std::string &n);
void setProfileDiversity(const std::string &n);
void setProfileError(const std::string &n);
void setProfileErrorId(const std::string &n);

// Intermediary
std::vector<std::unique_ptr<Reference>> *getReferences() noexcept;
int addReference(std::string);
bool isValid() const noexcept;
bool isOutputPaired() const noexcept;
bool isProfileError() const noexcept;
bool isProfileDiversity() const noexcept;
void removeReferences(int);
// Intermediary
std::vector<std::unique_ptr<Reference>> *getReferences() noexcept;
int addReference(std::string);
bool isValid() const noexcept;
bool isOutputPaired() const noexcept;
bool isProfileError() const noexcept;
bool isProfileDiversity() const noexcept;
void removeReferences(int);

// Others
void showUsage(const std::string);
void showVersion(const std::string) const;
// Others
void showUsage(const std::string);
void showVersion(const std::string) const;
};
#endif // INCLUDE_ARGS_HPP_
#endif // INCLUDE_ARGS_HPP_
26 changes: 13 additions & 13 deletions include/diversity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

class Diversity {
private:
double mut_rate;
double indel_frac;
double indel_extend;
int max_ins_size;
double mut_rate;
double indel_frac;
double indel_extend;
int max_ins_size;

public:
double getMutRate() const noexcept;
double getIndelFrac() const noexcept;
double getIndelExtend() const noexcept;
int getMaxInsSize() const noexcept;
double getMutRate() const noexcept;
double getIndelFrac() const noexcept;
double getIndelExtend() const noexcept;
int getMaxInsSize() const noexcept;

void setMutRate(double);
void setIndelFrac(double);
void setIndelExtend(double);
void setMaxInsSize(double);
void setMutRate(double);
void setIndelFrac(double);
void setIndelExtend(double);
void setMaxInsSize(double);
};

#endif // INCLUDE_DIVERSITY_HPP_
#endif // INCLUDE_DIVERSITY_HPP_
32 changes: 16 additions & 16 deletions include/faidxh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@

class Faidx {
private:
std::string name;
long long int len;
long long int seq_offset;
int line_blen;
int line_len;
int qual_offset;
std::string name;
long long int len;
long long int seq_offset;
int line_blen;
int line_len;
int qual_offset;

public:
Faidx();
Faidx(std::string, long long int, long long int, int, int, int);
Faidx();
Faidx(std::string, long long int, long long int, int, int, int);

// inherit
std::string getName() const noexcept;
int getLineLen() const noexcept;
int getLineBlen() const noexcept;
long long int getLen() const noexcept;
long long int getSeqOffset() const noexcept;
int getQualOffset() const noexcept;
// inherit
std::string getName() const noexcept;
int getLineLen() const noexcept;
int getLineBlen() const noexcept;
long long int getLen() const noexcept;
long long int getSeqOffset() const noexcept;
int getQualOffset() const noexcept;
};

#endif // INLUDE_FAIDXH_HPP_
#endif // INLUDE_FAIDXH_HPP_
Loading

0 comments on commit 72ffe39

Please sign in to comment.