sonar/api.py
def repo(args):
        """
        Create a new sonar repo in the current working directory.

        Args:
            args (object): Should have "name" attribute
        """
        curr_dir = Path(os.getcwd())

        repo_dir = curr_dir.joinpath(args.name)
        repo_dir.mkdir()

        src_dir = os.path.join(
            os.path.dirname(__file__), "files_to_copy/repo/.sonar"
        )
        sonar_dir = repo_dir.joinpath(".sonar")
        shutil.copytree(
            src_dir, sonar_dir, ignore=shutil.ignore_patterns("__pycache__*")
        )

        src_file = os.path.join(
            os.path.dirname(__file__), "files_to_copy/repo/.gitignore"
        )
        shutil.copy(src_file, repo_dir)

        init_toml = repo_dir.joinpath(Constants.SONAR_CONFIG_FILE_PATH)
        init = toml.load(init_toml)
        init["project"]["name"] = args.name
        with open(init_toml, "w") as f:
            toml.dump(init, f)

        os.chdir(repo_dir)
        args = sonar.include.DotDict({"name": args.name})
        Repo.add(args)
        os.chdir(curr_dir)

        Create a new sonar repo in the current working directory.

        Args:
            args (object): Should have "name" attribute
        
Create a new sonar repo in the current working directory.
Create a new sonar repo in the current working directory .
def repo(args):
        curr_dir = Path(os.getcwd())
        repo_dir = curr_dir.joinpath(args.name)
        repo_dir.mkdir()
        src_dir = os.path.join(
            os.path.dirname(__file__), "files_to_copy/repo/.sonar"
        )
        sonar_dir = repo_dir.joinpath(".sonar")
        shutil.copytree(
            src_dir, sonar_dir, ignore=shutil.ignore_patterns("__pycache__*")
        )
        src_file = os.path.join(
            os.path.dirname(__file__), "files_to_copy/repo/.gitignore"
        )
        shutil.copy(src_file, repo_dir)
        init_toml = repo_dir.joinpath(Constants.SONAR_CONFIG_FILE_PATH)
        init = toml.load(init_toml)
        init["project"]["name"] = args.name
        with open(init_toml, "w") as f:
            toml.dump(init, f)
        os.chdir(repo_dir)
        args = sonar.include.DotDict({"name": args.name})
        Repo.add(args)
        os.chdir(curr_dir)
def repo ( args ) : curr_dir = Path ( os . getcwd ( ) ) repo_dir = curr_dir . joinpath ( args . name ) repo_dir . mkdir ( ) src_dir = os . path . join ( os . path . dirname ( __file__ ) , "files_to_copy/repo/.sonar" ) sonar_dir = repo_dir . joinpath ( ".sonar" ) shutil . copytree ( src_dir , sonar_dir , ignore = shutil . ignore_patterns ( "__pycache__*" ) ) src_file = os . path . join ( os . path . dirname ( __file__ ) , "files_to_copy/repo/.gitignore" ) shutil . copy ( src_file , repo_dir ) init_toml = repo_dir . joinpath ( Constants . SONAR_CONFIG_FILE_PATH ) init = toml . load ( init_toml ) init [ "project" ] [ "name" ] = args . name with open ( init_toml , "w" ) as f : toml . dump ( init , f ) os . chdir ( repo_dir ) args = sonar . include . DotDict ( { "name" : args . name } ) Repo . add ( args ) os . chdir ( curr_dir )
Create a new sonar repo in the current working directory.
Create a new sonar repo in the current working directory .
"""
        Create a new sonar repo in the current working directory.

        Args:
            args (object): Should have "name" attribute
        """
args
Should have "name" attribute
Should have " name " attribute