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

Warning cleanup. #42

Merged
merged 9 commits into from
Jun 20, 2019
Merged

Warning cleanup. #42

merged 9 commits into from
Jun 20, 2019

Commits on Jun 10, 2019

  1. Fix remaining escape sequence warnings in lex patterns.

    Raw strings (marked by the `r` prefix) are normally used for
    regular expression patterns to allow that module to expand
    any backslash-escape sequences without interference from
    the Python interpreter's string expansion, and thus the
    requirement for extra quoting.
    
    This practice is further encouraged by python 3.5 and later
    raising a `DepreciationWarning` when encountering escape sequences
    it can't expand, as is common is re patterns.
    
    However, in python 2.7, the `re` module doesn't expand \u and \U
    escapes for unicode codepoints, so patterns with non-ascii
    characters can only be used in raw strings when using python 3.3
    or later, or the external `regex` module, and neither `u` nor `r`
    quoted strings will work for patterns in both languages.
    
    However, Python will concatenate whitespace-separated string
    literals even if they use different quoting. Take advantage
    of this to split the lexer patterns into raw- and unicode-quoted
    segments as appropriate.
    
    Also remove some unnecessary escape sequences.
    rillian committed Jun 10, 2019
    Configuration menu
    Copy the full SHA
    14e01ba View commit details
    Browse the repository at this point in the history
  2. travis: Replace pep8 with pycodestyle.

    The pep8 name is deprecated, and the tool continues under
    the new name.
    rillian committed Jun 10, 2019
    Configuration menu
    Copy the full SHA
    f2bdbe1 View commit details
    Browse the repository at this point in the history
  3. travis: Use pytest invocation.

    Now that we're using a newer pytest, we can invoke it as such
    even in the jython build, instead of using the older `py.test`.
    rillian committed Jun 10, 2019
    Configuration menu
    Copy the full SHA
    50d7165 View commit details
    Browse the repository at this point in the history
  4. Sanitize lexer pattern regex escapes.

    The parser's  token pattern strings escaped almost all punctuation
    characters, but the Python `re` module has a fairly limited set
    of special characters which must be backslash-escaped.
    
    In particular, characters like @ ! : and space do not need escapes,
    and even more are fine inside a [] environment describing a set
    of characters.
    
    Audit the expression strings and remove most unnecessary escapes.
    I left some sequences like `[^\^\[]` which aren't ambiguous without
    escapes for clarity of reading.
    rillian committed Jun 10, 2019
    Configuration menu
    Copy the full SHA
    508473f View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2019

  1. travis: Use the default python3 on macOS.

    The default osx image on travis doesn't have an up-to-date
    set of homebrew packages, so the `brew upgrade` step must
    compile many packages from source and takes tens of minutes
    to complete. This makes for very slow test feedback and
    occasionally failures when the job times out.
    
    Travis itself doesn't provide python3 packages through
    the `language` and `python` yaml keys like it does on
    Linux. Setting these keys fails trying to download the
    requested tarball.
    
    Give up therefore, and just use whatever python3 was installed
    on the image by default. Currently that is 3.6.5 from homebrew.
    This significantly speeds up test feedback.
    rillian committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    86a99d4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9b189a1 View commit details
    Browse the repository at this point in the history
  3. Make wrapper/cli.py callable directly.

    The main function here is decorated with command-line options
    through the click library, but as far as I can tell, this
    change is needed to actually invoke it as a python executable
    when testing.
    rillian committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    603f6db View commit details
    Browse the repository at this point in the history
  4. Mark the segmentor's output directory with -segment-.

    I find this more readable than running it together with
    the filename extension and the timestamp.
    rillian committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    63d09f1 View commit details
    Browse the repository at this point in the history
  5. Fix some pycodestyle warnings.

    Mostly reformatting the code to fit in 80 characters.
    Also change some variable names, split out function argument tuple
    unpacking, move some info messages to the --verbose options, and
    handle all-success in the summary report.
    rillian committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    afbbd27 View commit details
    Browse the repository at this point in the history