Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
0638bfd7
Unverified
Commit
0638bfd7
authored
3 years ago
by
Sergei Zharinov
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
refactor(workers): Strict nulls for CommitMessage class (#12863)
Co-authored-by:
Michael Kriese
<
michael.kriese@visualon.de
>
parent
e7a96901
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/workers/repository/model/commit-message.ts
+4
-4
4 additions, 4 deletions
lib/workers/repository/model/commit-message.ts
tsconfig.strict.json
+1
-0
1 addition, 0 deletions
tsconfig.strict.json
with
5 additions
and
4 deletions
lib/workers/repository/model/commit-message.ts
+
4
−
4
View file @
0638bfd7
export
class
CommitMessage
{
export
class
CommitMessage
{
public
static
readonly
SEPARATOR
:
string
=
'
:
'
;
public
static
readonly
SEPARATOR
:
string
=
'
:
'
;
private
message
:
string
;
private
message
=
''
;
private
prefix
:
string
;
private
prefix
=
''
;
constructor
(
message
=
''
)
{
constructor
(
message
=
''
)
{
this
.
setMessage
(
message
);
this
.
setMessage
(
message
);
...
@@ -26,11 +26,11 @@ export class CommitMessage {
...
@@ -26,11 +26,11 @@ export class CommitMessage {
}
}
public
setCustomPrefix
(
prefix
?:
string
):
void
{
public
setCustomPrefix
(
prefix
?:
string
):
void
{
this
.
prefix
=
(
prefix
||
''
).
trim
();
this
.
prefix
=
(
prefix
??
''
).
trim
();
}
}
public
setSemanticPrefix
(
type
?:
string
,
scope
?:
string
):
void
{
public
setSemanticPrefix
(
type
?:
string
,
scope
?:
string
):
void
{
this
.
prefix
=
(
type
||
''
).
trim
();
this
.
prefix
=
(
type
??
''
).
trim
();
if
(
scope
?.
trim
())
{
if
(
scope
?.
trim
())
{
this
.
prefix
+=
`(
${
scope
.
trim
()}
)`
;
this
.
prefix
+=
`(
${
scope
.
trim
()}
)`
;
...
...
This diff is collapsed.
Click to expand it.
tsconfig.strict.json
+
1
−
0
View file @
0638bfd7
...
@@ -122,6 +122,7 @@
...
@@ -122,6 +122,7 @@
"./lib/workers/pr/changelog/hbs-template.ts"
,
"./lib/workers/pr/changelog/hbs-template.ts"
,
"./lib/workers/pr/changelog/types.ts"
,
"./lib/workers/pr/changelog/types.ts"
,
"./lib/workers/repository/init/types.ts"
,
"./lib/workers/repository/init/types.ts"
,
"./lib/workers/repository/model/commit-message.ts"
,
"./test/graphql-snapshot.ts"
,
"./test/graphql-snapshot.ts"
,
"./test/json-schema.ts"
,
"./test/json-schema.ts"
,
"./test/newline-snapshot-serializer.ts"
,
"./test/newline-snapshot-serializer.ts"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment