Skip to content

Commit

Permalink
Merge pull request #558 from kianmeng/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
lieryan committed Nov 30, 2022
2 parents ecf503f + 2d427e0 commit a86d708
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 44 deletions.
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -42,7 +42,7 @@ releases.
Getting Started
===============

* `Documentatation <https://rope.readthedocs.io/en/latest/overview.html>`_
* `Documentation <https://rope.readthedocs.io/en/latest/overview.html>`_
* `How to use Rope in my IDE or Text editor? <https://github.com/python-rope/rope/wiki/How-to-use-Rope-in-my-IDE-or-Text-editor%3F>`_
* `Configuration <https://rope.readthedocs.io/en/latest/configuration.html>`_
* `List of features <https://rope.readthedocs.io/en/latest/rope.html>`_
Expand Down
4 changes: 2 additions & 2 deletions docs/library.rst
Expand Up @@ -711,7 +711,7 @@ The ``get_changes()`` method of refactoring classes return a
calling ``Project.do()``. But as explained above some IDEs need to
perform the changes themselves.

Every change to the file-system in rope is commited using an object that
Every change to the file-system in rope is committed using an object that
provides a ``rope.base.fscommands.FileSystemCommands`` interface. As
explained above in `rope.base.fscommands`_ section, rope uses this
interface to handle different VCSs.
Expand Down Expand Up @@ -897,7 +897,7 @@ an example consider that we want to perform a rename refactoring:
projects)
Here ``projects`` is the list of dependant projects. It does not
Here ``projects`` is the list of dependent projects. It does not
include the main project. The first argument is the refactoring class
(such as ``Rename``) or factory function (like ``create_move``).
Expand Down
2 changes: 1 addition & 1 deletion rope/base/arguments.py
Expand Up @@ -74,7 +74,7 @@ def get_instance_pyname(self):

class MixedArguments:
def __init__(self, pyname, arguments, scope):
"""`argumens` is an instance of `Arguments`"""
"""`arguments` is an instance of `Arguments`"""
self.pyname = pyname
self.args = arguments

Expand Down
4 changes: 2 additions & 2 deletions rope/contrib/fixsyntax.py
Expand Up @@ -62,7 +62,7 @@ def old_pyname():
new_code = pymodule.source_code

def new_pyname():
newoffset = self.commenter.transfered_offset(offset)
newoffset = self.commenter.transferred_offset(offset)
return rope.base.evaluate.eval_location(pymodule, newoffset)

if new_code.startswith(self.code[: offset + 1]):
Expand Down Expand Up @@ -97,7 +97,7 @@ def comment(self, lineno):
self._set(line, self.lines[start])
self._fix_incomplete_try_blocks(lineno, indents)

def transfered_offset(self, offset):
def transferred_offset(self, offset):
lineno = self.code.count("\n", 0, offset)
diff = sum(self.diffs[:lineno])
return offset + diff
Expand Down
10 changes: 5 additions & 5 deletions rope/refactor/extract.py
Expand Up @@ -98,7 +98,7 @@ def _validate_kind_prefix(kind, selected_kind):

@classmethod
def _get_kind(cls, kind):
raise NotImplementedError(f"You have to sublass {cls}")
raise NotImplementedError(f"You have to subclass {cls}")


class ExtractMethod(_ExtractRefactoring):
Expand Down Expand Up @@ -222,13 +222,13 @@ def scope_indents(self):
def extracted(self):
return self.source[self.region[0] : self.region[1]]

_cached_parsed_extraced = None
_cached_parsed_extracted = None

@property
def _parsed_extracted(self):
if self._cached_parsed_extraced is None:
self._cached_parsed_extraced = _parse_text(self.extracted)
return self._cached_parsed_extraced
if self._cached_parsed_extracted is None:
self._cached_parsed_extracted = _parse_text(self.extracted)
return self._cached_parsed_extracted

_returned = None

Expand Down
2 changes: 1 addition & 1 deletion rope/refactor/inline.py
Expand Up @@ -403,7 +403,7 @@ def _get_definition_params(self):
or definition_info.keywords_arg is not None
):
raise rope.base.exceptions.RefactoringError(
"Cannot inline functions with list and keyword arguements."
"Cannot inline functions with list and keyword arguments."
)
if self.pyfunction.get_kind() == "classmethod":
paramdict[
Expand Down
12 changes: 6 additions & 6 deletions ropetest/codeanalyzetest.py
Expand Up @@ -219,31 +219,31 @@ def test_functions_on_ending_parens(self):
code = "A()"
self.assertEqual("A()", self._find_primary(code, 2))

def test_splitted_statement(self):
def test_split_statement(self):
word_finder = worder.Worder("an_object.an_attr")
self.assertEqual(
("an_object", "an_at", 10), word_finder.get_splitted_primary_before(15)
)

def test_empty_splitted_statement(self):
def test_empty_split_statement(self):
word_finder = worder.Worder("an_attr")
self.assertEqual(("", "an_at", 0), word_finder.get_splitted_primary_before(5))

def test_empty_splitted_statement2(self):
def test_empty_split_statement2(self):
word_finder = worder.Worder("an_object.")
self.assertEqual(
("an_object", "", 10), word_finder.get_splitted_primary_before(10)
)

def test_empty_splitted_statement3(self):
def test_empty_split_statement3(self):
word_finder = worder.Worder("")
self.assertEqual(("", "", 0), word_finder.get_splitted_primary_before(0))

def test_empty_splitted_statement4(self):
def test_empty_split_statement4(self):
word_finder = worder.Worder("a_var = ")
self.assertEqual(("", "", 8), word_finder.get_splitted_primary_before(8))

def test_empty_splitted_statement5(self):
def test_empty_split_statement5(self):
word_finder = worder.Worder("a.")
self.assertEqual(("a", "", 2), word_finder.get_splitted_primary_before(2))

Expand Down
12 changes: 6 additions & 6 deletions ropetest/contrib/codeassisttest.py
Expand Up @@ -835,15 +835,15 @@ def test_proposing_variables_defined_till_the_end_of_scope(self):
result = self._assist(code, code.index("a_v") + 3)
self.assert_completion_in_result("a_var", "global", result)

def test_completing_in_uncomplete_try_blocks(self):
def test_completing_in_incomplete_try_blocks(self):
code = dedent("""\
try:
a_var = 10
a_""")
result = self._assist(code)
self.assert_completion_in_result("a_var", "global", result)

def test_completing_in_uncomplete_try_blocks_in_functions(self):
def test_completing_in_incomplete_try_blocks_in_functions(self):
code = dedent("""\
def a_func():
try:
Expand Down Expand Up @@ -895,7 +895,7 @@ def test_already_complete_try_blocks_with_except2(self):
result = self._assist(code, code.rindex("a_") + 2)
self.assert_completion_in_result("a_var", "global", result)

def test_completing_ifs_in_uncomplete_try_blocks(self):
def test_completing_ifs_in_incomplete_try_blocks(self):
code = dedent("""\
try:
if True:
Expand All @@ -904,7 +904,7 @@ def test_completing_ifs_in_uncomplete_try_blocks(self):
result = self._assist(code)
self.assert_completion_in_result("a_var", "global", result)

def test_completing_ifs_in_uncomplete_try_blocks2(self):
def test_completing_ifs_in_incomplete_try_blocks2(self):
code = dedent("""\
try:
if True:
Expand All @@ -913,7 +913,7 @@ def test_completing_ifs_in_uncomplete_try_blocks2(self):
result = self._assist(code)
self.assert_completion_in_result("a_var", "global", result)

def test_completing_excepts_in_uncomplete_try_blocks(self):
def test_completing_excepts_in_incomplete_try_blocks(self):
code = dedent("""\
try:
pass
Expand Down Expand Up @@ -1415,7 +1415,7 @@ def test_from_import_star2(self):
self.assert_completion_in_result("sample_func", "imported", result)
self.assert_completion_in_result("sample_var", "imported", result)

def test_from_import_star_not_imporing_underlined(self):
def test_from_import_star_not_importing_underlined(self):
code = dedent("""\
from samplemod import *
_under""")
Expand Down
10 changes: 5 additions & 5 deletions ropetest/historytest.py
Expand Up @@ -133,22 +133,22 @@ def test_dropping_undone_changes(self):
self.history.undo(drop=True)
self.history.redo()

def test_undoing_choosen_changes(self):
def test_undoing_chosen_changes(self):
change = rope.base.change.ChangeContents(self.file1, "1")
self.history.do(change)
self.history.undo(change)
self.assertEqual("", self.file1.read())
self.assertFalse(self.history.undo_list)

def test_undoing_choosen_changes2(self):
def test_undoing_chosen_changes2(self):
change1 = rope.base.change.ChangeContents(self.file1, "1")
self.history.do(change1)
self.history.do(rope.base.change.ChangeContents(self.file1, "2"))
self.history.undo(change1)
self.assertEqual("", self.file1.read())
self.assertFalse(self.history.undo_list)

def test_undoing_choosen_changes_not_undoing_others(self):
def test_undoing_chosen_changes_not_undoing_others(self):
change1 = rope.base.change.ChangeContents(self.file1, "1")
self.history.do(change1)
self.history.do(rope.base.change.ChangeContents(self.file2, "2"))
Expand Down Expand Up @@ -226,7 +226,7 @@ def test_get_file_undo_list_for_moves(self):
self.assertEqual({change}, set(self.history.get_file_undo_list(self.file1)))

# XXX: What happens for moves before the file is created?
def xxx_test_get_file_undo_list_and_moving_its_contining_folder(self):
def xxx_test_get_file_undo_list_and_moving_its_containing_folder(self):
folder = self.project.root.create_folder("folder")
old_file = folder.create_file("file3.txt")
change1 = rope.base.change.MoveResource(folder, "new_folder")
Expand Down Expand Up @@ -256,7 +256,7 @@ def test_clearing_up_the_history(self):
self.assertEqual(0, len(self.history.undo_list))
self.assertEqual(0, len(self.history.redo_list))

def test_redoing_choosen_changes_not_undoing_others(self):
def test_redoing_chosen_changes_not_undoing_others(self):
change1 = rope.base.change.ChangeContents(self.file1, "1")
change2 = rope.base.change.ChangeContents(self.file2, "2")
self.history.do(change1)
Expand Down
5 changes: 3 additions & 2 deletions ropetest/objectinfertest.py
Expand Up @@ -398,11 +398,12 @@ class C2(object):
self.assertEqual(c1_class, a_var.get_type())
self.assertEqual(c2_class, b_var.get_type())

def test_we_know_the_type_of_catched_exceptions(self):
def test_we_know_the_type_of_caught_exceptions(self):
code = dedent("""\
class MyError(Exception):
pass
try:
raise MyError()
except MyError as e:
pass
Expand All @@ -412,7 +413,7 @@ class MyError(Exception):
e_var = mod["e"].get_object()
self.assertEqual(my_error, e_var.get_type())

def test_we_know_the_type_of_catched_multiple_excepts(self):
def test_we_know_the_type_of_caught_multiple_excepts(self):
code = dedent("""\
class MyError(Exception):
pass
Expand Down
2 changes: 1 addition & 1 deletion ropetest/projecttest.py
Expand Up @@ -833,7 +833,7 @@ def test_validating_get_files_list(self):
self.project.validate()
self.assertEqual(1, len(self.project.get_files()))

def test_clear_observered_resources_for_filtered_observers(self):
def test_clear_observed_resources_for_filtered_observers(self):
sample_file = self.project.root.create_file("myfile.txt")
sample_observer = _SampleObserver()
filtered = FilteredResourceObserver(sample_observer)
Expand Down
4 changes: 2 additions & 2 deletions ropetest/pycoretest.py
Expand Up @@ -388,7 +388,7 @@ def test_get_pyname_definition_location_reassigning(self):
a_var = mod["a_var"]
self.assertEqual((mod, 1), a_var.get_definition_location())

def test_get_pyname_definition_location_importes(self):
def test_get_pyname_definition_location_imported(self):
testutils.create_module(self.project, "mod")
code = "import mod\n"
mod = libutils.get_string_module(self.project, code)
Expand Down Expand Up @@ -838,7 +838,7 @@ class SampleClass(object):
sample_class, mod.get_attributes()["SampleClass"].get_object()
)

def test_from_import_star_not_imporing_underlined(self):
def test_from_import_star_not_importing_underlined(self):
code = "from samplemod import *"
mod = libutils.get_string_module(self.project, code)
self.assertTrue("_underlined_func" not in mod.get_attributes())
Expand Down
6 changes: 3 additions & 3 deletions ropetest/refactor/__init__.py
Expand Up @@ -517,7 +517,7 @@ def create(*args, **kwds):
self._introduce_factory(mod, mod.read().index("a_class") + 1, "create")
self.assertEqual(expected, mod.read())

def test_changing_occurrs_in_the_same_module_with_conflict_ranges(self):
def test_changing_occurs_in_the_same_module_with_conflict_ranges(self):
mod = testutils.create_module(self.project, "mod")
code = dedent("""\
class C(object):
Expand Down Expand Up @@ -908,9 +908,9 @@ def a_func(self, var):
self.mod, self.mod.read().index("var") + 1
)

# NOTE: This situation happens alot and is normally not an error
# NOTE: This situation happens a lot and is normally not an error
# @testutils.assert_raises(RefactoringError)
def test_not_rais_exception_when_there_is_a_field_with_the_same_name(self):
def test_not_raise_exception_when_there_is_a_field_with_the_same_name(self):
code = dedent("""\
class A(object):
def __init__(self):
Expand Down
8 changes: 4 additions & 4 deletions ropetest/refactor/extracttest.py
Expand Up @@ -457,7 +457,7 @@ def a_func(arg):
with self.assertRaises(rope.base.exceptions.RefactoringError):
self.do_extract_method(code, start, end, "new_func")

def test_extract_method_containing_uncomplete_lines(self):
def test_extract_method_containing_incomplete_lines(self):
code = dedent("""\
a_var = 20
another_var = 30
Expand All @@ -467,7 +467,7 @@ def test_extract_method_containing_uncomplete_lines(self):
with self.assertRaises(rope.base.exceptions.RefactoringError):
self.do_extract_method(code, start, end, "new_func")

def test_extract_method_containing_uncomplete_lines2(self):
def test_extract_method_containing_incomplete_lines2(self):
code = dedent("""\
a_var = 20
another_var = 30
Expand All @@ -477,7 +477,7 @@ def test_extract_method_containing_uncomplete_lines2(self):
with self.assertRaises(rope.base.exceptions.RefactoringError):
self.do_extract_method(code, start, end, "new_func")

def test_extract_function_and_argument_as_paramenter(self):
def test_extract_function_and_argument_as_parameter(self):
code = dedent("""\
def a_func(arg):
print(arg)
Expand Down Expand Up @@ -1666,7 +1666,7 @@ def new_func():
""")
self.assertEqual(expected, refactored)

def test_where_to_seach_when_extracting_global_names(self):
def test_where_to_search_when_extracting_global_names(self):
code = dedent("""\
def a():
return 1
Expand Down
4 changes: 2 additions & 2 deletions ropetest/refactor/movetest.py
Expand Up @@ -315,7 +315,7 @@ class TestClass:
self.project, self.mod1, code.index("CONSTANT") + 1
)

def test_raising_exception_for_mov_glob_elemnts_to_the_same_module(self):
def test_raising_exception_for_moving_glob_elements_to_the_same_module(self):
self.mod1.write("def a_func():\n pass\n")
with self.assertRaises(exceptions.RefactoringError):
self._move(self.mod1, self.mod1.read().index("a_func"), self.mod1)
Expand Down Expand Up @@ -808,7 +808,7 @@ def new_method(self):
mover.get_new_method("new_method"),
)

def test_moving_methods_getting_new_method_passing_simple_paremters(self):
def test_moving_methods_getting_new_method_passing_simple_parameters(self):
code = dedent("""\
class A(object):
def a_method(self, p):
Expand Down
2 changes: 1 addition & 1 deletion ropetest/refactor/renametest.py
Expand Up @@ -272,7 +272,7 @@ def __init__(self, new_param):
""")
self.assertEqual(expected, refactored)

def test_rename_functions_parameters_and_occurences_in_other_modules(self):
def test_rename_functions_parameters_and_occurrences_in_other_modules(self):
mod1 = testutils.create_module(self.project, "mod1")
mod2 = testutils.create_module(self.project, "mod2")
mod1.write(dedent("""\
Expand Down

0 comments on commit a86d708

Please sign in to comment.