-
Notifications
You must be signed in to change notification settings - Fork 0
Sourcery refactored master branch #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| self.path = os.path.relpath(path, local.root) | ||
| else: | ||
| self.path = path | ||
| self.path = os.path.relpath(path, local.root) if path.startswith('/') else path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function LocalResource.__init__ refactored with the following changes:
- Replace if statement with if expression
| while len(paths_to_get) > 0: | ||
| while paths_to_get: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function Local.all_resources refactored with the following changes:
- Simplify sequence comparison
|
|
||
| def remote_names_from_config(config): | ||
| return set(d['remote'] for d in config if 'remote' in d) | ||
| return {d['remote'] for d in config if 'remote' in d} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function remote_names_from_config refactored with the following changes:
- Replace list(), dict() or set() with comprehension
| root = SunVoxDir(self, top) | ||
| paths_to_get = [root] | ||
| while len(paths_to_get) > 0: | ||
| while paths_to_get: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function SunVoxRemote.all_resources refactored with the following changes:
- Simplify sequence comparison
| hrefs = {a.attrib['href'] for a in doc('a')} | ||
| names = {href for href in hrefs if not href.startswith('?')} | ||
| return names | ||
| return {href for href in hrefs if not href.startswith('?')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function SunVoxRemote.names_in_page refactored with the following changes:
- Inline variable that is only used once
| doc = PQ(response.content) | ||
| return doc | ||
| return PQ(response.content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function SunVoxRemote.page_for_path refactored with the following changes:
- Inline variable that is only used once
| print() | ||
| print('Ensuring directories:') | ||
| dest_paths = set(r.path for r in dest_resources if r.is_dir) | ||
| dest_paths = {r.path for r in dest_resources if r.is_dir} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function Sync.perform refactored with the following changes:
- Replace list(), dict() or set() with comprehension
Branch
masterrefactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
masterbranch, then run: