Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-scanner
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
Model registry
Operate
Environments
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
Platform
Development
swh-scanner
Merge requests
!84
cli: Fix AttributeError after config_[basepath|exists] removal
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
cli: Fix AttributeError after config_[basepath|exists] removal
anlambert/swh-scanner:remove-config-basepath-exists-use
into
master
Overview
2
Commits
1
Pipelines
1
Changes
1
Merged
Antoine Lambert
requested to merge
anlambert/swh-scanner:remove-config-basepath-exists-use
into
master
1 year ago
Overview
2
Commits
1
Pipelines
1
Changes
1
Expand
Those functions from swh.core.config were removed in
swh-core@2663c0a4
.
1
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
1967e48f
1 commit,
1 year ago
1 file
+
4
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
swh/scanner/cli.py
+
4
−
4
Options
@@ -104,22 +104,22 @@ def scanner(ctx, config_file: Optional[str]):
# read_raw_config do not fail if file does not exist, so check it beforehand
# while enforcing loading priority
if
config_file
:
if
not
config
.
config_exists
(
config_file
):
if
not
config
.
exists_accessible
(
config_file
):
raise
click
.
BadParameter
(
f
"
File
'
{
config_file
}
'
cannot be opened.
"
,
param_hint
=
"
--config-file
"
)
elif
env_config_path
:
if
not
config
.
config_exists
(
env_config_path
):
if
not
config
.
exists_accessible
(
env_config_path
):
raise
click
.
BadParameter
(
f
"
File
'
{
env_config_path
}
'
cannot be opened.
"
,
param_hint
=
CONFIG_ENVVAR
)
config_file
=
env_config_path
elif
config
.
config_exists
(
DEFAULT_CONFIG_PATH
):
elif
config
.
exists_accessible
(
DEFAULT_CONFIG_PATH
):
config_file
=
DEFAULT_CONFIG_PATH
conf
=
DEFAULT_CONFIG
if
config_file
is
not
None
:
conf
=
config
.
read_raw_config
(
config
.
config_basepath
(
config
_file
)
)
conf
=
config
.
read_raw_config
(
config_file
)
conf
=
config
.
merge_configs
(
DEFAULT_CONFIG
,
conf
)
else
:
config_file
=
DEFAULT_CONFIG_PATH
Loading