Skip to content
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

Update dodo.py #3746

Closed
wants to merge 1 commit into from
Closed

Update dodo.py #3746

wants to merge 1 commit into from

Conversation

boyhominid
Copy link

Pull Request Checklist

  • I’ve read the guidelines for contributing.
  • I updated AUTHORS.txt and CHANGES.txt (if the change is non-trivial) and documentation (if applicable).
  • I tested my changes.

Description

Added script annotations to functions

Added script annotations to functions
@@ -8,45 +8,45 @@
}


def recursive_glob(path, pattern):
def recursive_glob(path, pattern) -> str:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function does not return a single string.

"""recursively walk path directories and return files matching the pattern"""
for root, dirnames, filenames in os.walk(path, followlinks=True):
for filename in fnmatch.filter(filenames, pattern):
yield os.path.join(root, filename)


def task_flake8():
def task_flake8() -> str:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function does not return a string.

"""flake8 - static check for python files"""
yield {
'name': os.path.join(os.getcwd(), 'nikola'),
'actions': ['flake8 nikola/'],
}


def task_pydocstyle():
def task_pydocstyle() -> str:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function does not return a string.

"""pydocstyle -- static check for docstring style"""
yield {
'name': os.path.join(os.getcwd(), 'nikola'),
'actions': ["pydocstyle --count --match-dir='(?!^\\.)(?!data).*' nikola/"],
}


def task_test():
def task_test() -> str:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function does not return a string.

"""run unit-tests using py.test"""
return {
'actions': ['py.test tests/'],
}


def task_coverage():
def task_coverage() -> str:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function does not return a string.

}


def task_gen_completion():
def task_gen_completion() -> str:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function does not return a string.

"""run unit-tests using py.test, with coverage reporting"""
return {
'actions': ['py.test --cov nikola --cov-report term-missing tests/'],
'verbosity': 2,
'verbosity' int: 2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is invalid syntax.

@boyhominid
Copy link
Author

Super apologetic here, just getting started and I want to help. I'll take a look at things before I re-submit changes you've requested

@boyhominid boyhominid closed this Jan 20, 2024
@boyhominid boyhominid deleted the master branch January 20, 2024 16:49
@Kwpolska
Copy link
Member

It is OK to make mistakes. It is also important to test your changes before opening a pull request. For type annotations, this would mean checking the code with mypy or pyright. I would also recommend focusing on the main codebase in the nikola folder.

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

Successfully merging this pull request may close these issues.

None yet

2 participants