Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rcfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
nimrod
rcfiles
Commits
dc267a72
Commit
dc267a72
authored
3 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
Prospector fixes.
Updated Prospector because it's failing again. Found new issues, addressed them.
parent
45efc43a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.pre-commit-config.yaml
+1
-1
1 addition, 1 deletion
.pre-commit-config.yaml
Documents/bin/git-namespace-backup
+17
-15
17 additions, 15 deletions
Documents/bin/git-namespace-backup
with
18 additions
and
16 deletions
.pre-commit-config.yaml
+
1
−
1
View file @
dc267a72
...
...
@@ -46,7 +46,7 @@ repos:
--line-length=79
-
repo
:
https://github.com/PyCQA/prospector
rev
:
1.
5
.0
.1
rev
:
1.
6
.0
hooks
:
-
id
:
prospector
exclude
:
*excluded_pythonscripts
...
...
This diff is collapsed.
Click to expand it.
Documents/bin/git-namespace-backup
+
17
−
15
View file @
dc267a72
...
...
@@ -32,11 +32,9 @@ def namespace_path(namespace):
"""
path
=
pathlib
.
Path
(
os
.
path
.
expanduser
(
"
~/Repositories/
"
+
namespace
))
if
not
path
.
exists
():
raise
argparse
.
ArgumentTypeError
(
"
Path {} does not exit.
"
.
format
(
path
)
)
raise
argparse
.
ArgumentTypeError
(
f
"
Path
{
path
}
does not exit.
"
)
if
not
path
.
is_dir
():
raise
argparse
.
ArgumentTypeError
(
"
Path {} is not a directory.
"
.
format
(
path
)
)
raise
argparse
.
ArgumentTypeError
(
f
"
Path
{
path
}
is not a directory.
"
)
return
path
...
...
@@ -55,8 +53,9 @@ if __name__ == "__main__":
try
:
group
=
conn
.
groups
.
get
(
args
.
namespace
.
name
)
print
(
"
Using existing group id: {}, name: {}, path: {}.
"
.
format
(
group
.
id
,
group
.
name
,
group
.
path
(
f
"
Using existing group id:
{
group
.
id
}
,
"
f
"
name:
{
group
.
name
}
, path:
{
group
.
path
}
.
"
),
file
=
sys
.
stderr
,
)
...
...
@@ -69,8 +68,9 @@ if __name__ == "__main__":
}
)
print
(
"
Created new group id: {}, name: {}, path: {}.
"
.
format
(
group
.
id
,
group
.
name
,
group
.
path
(
f
"
Created new group id:
{
group
.
id
}
,
"
f
"
name:
{
group
.
name
}
, path:
{
group
.
path
}
.
"
),
file
=
sys
.
stderr
,
)
...
...
@@ -80,8 +80,9 @@ if __name__ == "__main__":
f
"
{
group
.
path
}
/
{
repo
.
name
}
"
)
print
(
"
Using existing project id: {}, name: {}, path: {}.
"
.
format
(
# noqa: E501
project
.
id
,
project
.
name
,
project
.
path
(
f
"
Using existing project id:
{
project
.
id
}
,
"
f
"
name:
{
project
.
name
}
, path:
{
project
.
path
}
.
"
),
file
=
sys
.
stderr
,
)
...
...
@@ -90,15 +91,16 @@ if __name__ == "__main__":
{
"
name
"
:
repo
.
name
,
"
namespace_id
"
:
group
.
id
}
)
print
(
"
Created new project id: {}, name: {}, path: {}.
"
.
format
(
project
.
id
,
project
.
name
,
project
.
path
(
f
"
Created new project id:
{
project
.
id
}
,
"
f
"
name:
{
project
.
name
}
, path:
{
project
.
path
}
.
"
),
file
=
sys
.
stderr
,
)
with
sh
.
pushd
(
repo
):
if
"
shore.co.il
"
in
git
.
remote
().
splitlines
():
print
(
"
Setting the remote URL in {
}.
"
.
format
(
repo
.
name
)
,
f
"
Setting the remote URL in
{
repo
.
name
}
.
"
,
file
=
sys
.
stderr
,
)
git
.
remote
(
...
...
@@ -106,12 +108,12 @@ if __name__ == "__main__":
)
else
:
print
(
"
Adding remote in {
}.
"
.
format
(
repo
.
name
)
,
f
"
Adding remote in
{
repo
.
name
}
.
"
,
file
=
sys
.
stderr
,
)
git
.
remote
(
"
add
"
,
"
shore.co.il
"
,
project
.
ssh_url_to_repo
)
print
(
"
Pushing to {
}.
"
.
format
(
project
.
ssh_url_to_repo
)
,
f
"
Pushing to
{
project
.
ssh_url_to_repo
}
.
"
,
file
=
sys
.
stderr
,
)
git
.
push
(
"
--all
"
,
"
shore.co.il
"
)
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