Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Support a --dry-run flag, to say what we would do but not do it #28

Open
LittleKey opened this issue Apr 16, 2018 · 4 comments
Open

Support a --dry-run flag, to say what we would do but not do it #28

LittleKey opened this issue Apr 16, 2018 · 4 comments

Comments

@LittleKey
Copy link

python: 2.7.13
slicker: 0.9.3
os: macOS 10.12.5

code snippet:

#!/usr/bin/env python
# encoding: utf-8

print('hello slicker')

def func(*args, **kwargs):
    pass

print('this is a func \'{}\''.format(func))

image

detail:
the function definition has no change. but the function print has been changed.

@benjaminjkraft
Copy link
Contributor

Hm, interesting. This is more or less intended behavior -- we are in fact not moving the definition but just fixing up references that happen to be in the same file -- but the question of what to do to the file with the definition when --no-automove is specified is a thorny one and I'm open to changing the behavior. What would you expect to get here? Should we specifically avoid fixing up references in the moved file if --no-automove is passed?

@LittleKey
Copy link
Author

I expect the function definition and references don't changing if --no-automove is passed.
just tell me what should i do, such as

1. def func(*args, **kwargs):  # --> def new_func(*args, **kwargs):
2. print('this is a func \'{}\''.format(func))  # --> print('this is a func \'{}\''.format(new_func))

The most importance that show me the references place should i care
thx a lot

@benjaminjkraft
Copy link
Contributor

Ah, ok! That's not what it does at all -- what you're proposing is a --dry-run flag, I guess, which we could add! I'll update the issue title to match.

@benjaminjkraft benjaminjkraft changed the title [BUG] with --no-automove argument, slicker also change my file Support a --dry-run flag, to say what we would do but not do it Apr 16, 2018
@LittleKey
Copy link
Author

Yes! that i need! thanks~

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants