1. 18 Dec, 2016 1 commit
    • David H's avatar
      Got mercurial hook working, with improvements · d1b77726
      David H authored
      This commit fixes a problem that caused "flake8 --install-hook mercurial" to
      die with this message:
      
          Could not find the mercurial directory
      
      Also fixes two usages of configparser (can't supply a non-text value when
      calling .set(), and need to use .getboolean() to convert the value to a
      boolean.)
      
      This commit converts the hook itself from a function hook to a script hook.
      This enables the hook to run even when flake8 is installed in a virtual
      environment and Mercurial is installed globally (a common case.) This also
      makes it possible for flake8 to be installed for Python 3; Mercurial is
      Python 2.x only.
      
      Also convert the hook event from "commit" to "pretxncommit" so that strict
      mode would actually work. A regular commit hook runs only after the commit
      is completed; a pretxncommit hook will cause the transaction to be rolled
      back if it exits with a non-zero code.
      
      Finally, put extensions on the hook names: pretxncommit.flake8 and
      qrefresh.flake8. This allows the flake8 hook to coexist with other hooks the
      user might have put in place.
      
      I tested flake8 mercurial hook installation and execution on both Python 2.7
      and Python 3.5. I did *not* test the qrefresh.flake8 hook. I could not find
      documentation on qrefresh hook event; I presume it has something to do with
      the Mercurial MQ extension, which I have never used. Probably this commit
      does not make it any worse than it was before.
      
      For more info see:
      http://hgbook.red-bean.com/read/handling-repository-events-with-hooks.html
      
      Closes #283
      d1b77726
  2. 29 Nov, 2016 1 commit
    • Ian Stapleton Cordasco's avatar
      Merge branch 'pyflakes_missing_codes' into 'master' · 348722d7
      Ian Stapleton Cordasco authored
      Assign missing codes to PyFlakes messages
      
      Some PyFlakes messages weren't covered by unique messages, making them
      impossible to select/ignore. This is now fixed.
      
      To ensure we don't regress in the future, a test has been added that fails if
      there's any uncovered messages.
      
      See merge request !159
      348722d7
  3. 28 Nov, 2016 1 commit
    • Lukasz Langa's avatar
      Assign missing codes to PyFlakes messages · 2f1338c3
      Lukasz Langa authored
      Some PyFlakes messages weren't covered by unique messages, making them
      impossible to select/ignore. This is now fixed.
      
      To ensure we don't regress in the future, a test has been added that fails if
      there's any uncovered messages.
      2f1338c3
  4. 23 Nov, 2016 2 commits
    • Ian Stapleton Cordasco's avatar
      Merge branch 'bug/268' into 'master' · b8ce1334
      Ian Stapleton Cordasco authored
      Only force files to be included when run from CLI
      
      Previously we added support so users can do:
      
          $ flake8 bin/executable
      
      But this broke the fact that git hooks shouldn't check things like
      reStructuredText doc files. This commit restores that functionality but
      will cause bin/executable to be ignored in the git hook. This seems fair
      since folks can amend their filename patterns to include it explicitly.
      
      Closes #268
      
      See merge request !157
      b8ce1334
    • Ian Stapleton Cordasco's avatar
      Only force files to be included when run from CLI · e4582ef4
      Ian Stapleton Cordasco authored
      Previously we added support so users can do:
      
          $ flake8 bin/executable
      
      But this broke the fact that git hooks shouldn't check things like
      reStructuredText doc files. This commit restores that functionality but
      will cause bin/executable to be ignored in the git hook. This seems fair
      since folks can amend their filename patterns to include it explicitly.
      
      Closes #268
      e4582ef4
  5. 22 Nov, 2016 2 commits
  6. 21 Nov, 2016 1 commit
  7. 20 Nov, 2016 2 commits
    • Ian Stapleton Cordasco's avatar
    • Ian Stapleton Cordasco's avatar
      Merge branch 'bug/259' into 'master' · ae9e832c
      Ian Stapleton Cordasco authored
      Handle SyntaxErrors in a slightly smarter way
      
      SyntaxErrors are strange and mystical beasts. On top of the problems we
      encountered previously in GitLab#237, it's now apparent that
      SyntaxErrors can also occur across multiple lines (in fact, across the
      rest of a file). In the event of a "multi-line" SyntaxError, we need to
      determine what row to report and what the column number is.
      
      For now, we're going to use the row number of the first line and limit
      the column number to be less than the end of the line. It may not be
      perfect, but it is slightly better.
      
      Related-to #237  
      Closes #259 
      
      cc @arcanemagus
      
      See merge request !151
      ae9e832c
  8. 19 Nov, 2016 2 commits
    • Ian Stapleton Cordasco's avatar
      Merge branch 'bug/266' into 'master' · a7fb8061
      Ian Stapleton Cordasco authored
      Skip filename pattern check for provided files
      
      By default, when discovering files for users, we use the filename
      patterns to determine whether or not we should check that file. However,
      when a user provides the path to a file, we should instead skip checking
      the name against the filename patterns provided.
      
      For example, in Flake8 2.6 this worked:
      
          $ flake8 bin/script.py
          $ flake8 bin/script
      
      But prior to this commit only
      
          $ flake8 bin/script.py
      
      works. This commit will skip the filename pattern check if the user
      provides the path explicitly which allows
      
          $ flake8 bin/script
      
      to work again as expected.
      
      Closes #266
      
      See merge request !153
      a7fb8061
    • Ian Stapleton Cordasco's avatar
      Skip filename pattern check for provided files · 78e8165b
      Ian Stapleton Cordasco authored
      By default, when discovering files for users, we use the filename
      patterns to determine whether or not we should check that file. However,
      when a user provides the path to a file, we should instead skip checking
      the name against the filename patterns provided.
      
      For example, in Flake8 2.6 this worked:
      
          $ flake8 bin/script.py
          $ flake8 bin/script
      
      But prior to this commit only
      
          $ flake8 bin/script.py
      
      works. This commit will skip the filename pattern check if the user
      provides the path explicitly which allows
      
          $ flake8 bin/script
      
      to work again as expected.
      
      Closes #266
      78e8165b
  9. 17 Nov, 2016 4 commits
  10. 16 Nov, 2016 4 commits
    • tim smith's avatar
      Grammar nit · bf47a504
      tim smith authored
      bf47a504
    • Ian Stapleton Cordasco's avatar
      Merge branch 'bug/257' into 'master' · fd1cc384
      Ian Stapleton Cordasco authored
      Fix subtle reporting bug for default on plugins
      
      When we refactored our decision process to fix #239, we broke a subtle
      corner case where extensions that are not off-by-default are to be
      reported.
      
      This further refactors that logic and adds specific tests around it to
      ensure it works as expected and doesn't regress.
      
      Closes #257
      
      See merge request !148
      fd1cc384
    • Ian Stapleton Cordasco's avatar
      Fix subtle reporting bug for default on plugins · c50b747a
      Ian Stapleton Cordasco authored
      When we refactored our decision process to fix #239, we broke a subtle
      corner case where extensions that are not off-by-default are to be
      reported.
      
      This further refactors that logic and adds specific tests around it to
      ensure it works as expected and doesn't regress.
      
      Closes #257
      c50b747a
    • Ian Stapleton Cordasco's avatar
      Prepare for 3.2.1 development · 8e490527
      Ian Stapleton Cordasco authored
      8e490527
  11. 15 Nov, 2016 1 commit
  12. 14 Nov, 2016 6 commits
  13. 13 Nov, 2016 6 commits
    • Ian Stapleton Cordasco's avatar
      Merge branch 'refactor-release-notes' into 'master' · 7e44b47c
      Ian Stapleton Cordasco authored
      Create sub-sections for different release series
      
      When looking at the documentation, the release notes section on the
      sidebar was incredibly long, due to the number of releases available.
      To make this more usable, I've split the release notes index into
      sections for each release series (e.g., 3.x, 2.x, etc.). This allows
      documentation users to open the release notes sidebar section, and then
      select which series they want. That will expand and let them pick the
      version.
      
      See merge request !145
      7e44b47c
    • Ian Stapleton Cordasco's avatar
      Merge branch 'bug/247' into 'master' · 741d60c2
      Ian Stapleton Cordasco authored
      Add a man page for Flake8
      
      Document Flake8 for users expecting `man flake8` to work and include the
      man page in Flake8's documentation.
      
      Closes #247
      
      See merge request !146
      741d60c2
    • Ian Stapleton Cordasco's avatar
      Merge branch 'bug/223' into 'master' · 7800351f
      Ian Stapleton Cordasco authored
      Correct exclude paths in git hook
      
      When running the git hook, even though the appropriate config file is
      found and processed, the exclude patterns and paths were not being
      corrected to account for the temporary directory that we copy the files
      into.
      
      Related-to #223
      
      See merge request !147
      7800351f
    • Ian Stapleton Cordasco's avatar
      Correct exclude paths in git hook · 2197c2ea
      Ian Stapleton Cordasco authored
      When running the git hook, even though the appropriate config file is
      found and processed, the exclude patterns and paths were not being
      corrected to account for the temporary directory that we copy the files
      into.
      
      Related-to #223
      2197c2ea
    • Ian Stapleton Cordasco's avatar
      Add a man page for Flake8 · e3806655
      Ian Stapleton Cordasco authored
      Document Flake8 for users expecting `man flake8` to work and include the
      man page in Flake8's documentation.
      
      Closes #247
      e3806655
    • Ian Stapleton Cordasco's avatar
      Create sub-sections for different release series · 879768db
      Ian Stapleton Cordasco authored
      When looking at the documentation, the release notes section on the
      sidebar was incredibly long, due to the number of releases available.
      To make this more usable, I've split the release notes index into
      sections for each release series (e.g., 3.x, 2.x, etc.). This allows
      documentation users to open the release notes sidebar section, and then
      select which series they want. That will expand and let them pick the
      version.
      879768db
  14. 12 Nov, 2016 7 commits