dvershinin / lastversion

Consider using f-strings PYL-C0209
Performance
Minor
5 occurrences in this check
Formatting a regular string which could be a f-string
23            self.hostname = self.DEFAULT_HOSTNAME
24        if self.pa_token:
25            log.info('Using Personal Access token.')
26            self.headers.update({'Private-Token': "{}".format(self.pa_token)})27        self.api_base = 'https://{}/api/v4'.format(self.hostname)
28        self.set_repo(repo)
29        self.repo_id = self.repo.replace('/', '%2F')
Formatting a regular string which could be a f-string
24        if self.pa_token:
25            log.info('Using Personal Access token.')
26            self.headers.update({'Private-Token': "{}".format(self.pa_token)})
27        self.api_base = 'https://{}/api/v4'.format(self.hostname)28        self.set_repo(repo)
29        self.repo_id = self.repo.replace('/', '%2F')
30
Formatting a regular string which could be a f-string
29        self.repo_id = self.repo.replace('/', '%2F')
30
31    def repo_query(self, uri):
32        url = '{}/projects/{}/repository{}'.format(self.api_base, self.repo_id, uri)33        return self.get(url)
34
35    def get_latest(self, pre_ok=False, major=None):
Formatting a regular string which could be a f-string
45                if not version:
46                    continue
47                if ret and tag_date + timedelta(days=365) < ret['tag_date']:
48                    log.info('The version {} is newer, but is too old!'.format(version))49                    break
50                if not ret or ret and version > ret['version']:
51                    log.info("Setting version as current selection: {}.".format(version))
Formatting a regular string which could be a f-string
48                    log.info('The version {} is newer, but is too old!'.format(version))
49                    break
50                if not ret or ret and version > ret['version']:
51                    log.info("Setting version as current selection: {}.".format(version))52                    ret = t
53                    ret['tag_name'] = tag
54                    ret['tag_date'] = tag_date