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

Fixes for #349 #350

Merged
merged 6 commits into from
Aug 23, 2017
Merged

Fixes for #349 #350

merged 6 commits into from
Aug 23, 2017

Conversation

pypmannetjies
Copy link
Contributor

Changed the excludes to use the string as a regular expression except in
the case where a "path" option is provided. Where a path is provided, it
should work as before. Removed the appended class name because the
simpler provided path will still match paths checked against it.

Changed the excludes to use the string as a regular expression except in
the case where a "path" option is provided. Where a path is provided, it
should work as before. Removed the appended class name because the
simpler provided path will still match paths checked against it.
@Gama11
Copy link
Member

Gama11 commented Aug 21, 2017

@Gama11 Gama11 changed the title Fixes for https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/349 Fixes for #349 Aug 21, 2017
@pypmannetjies
Copy link
Contributor Author

My bad! Some last minute refactoring I didn't check.

@AlexHaxe
Copy link
Member

@pypmannetjies
Copy link
Contributor Author

Ok now I'm not too sure why the build is failing:

haxe: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.17' not found (required by haxe)

@AlexHaxe
Copy link
Member

Don't worry about libc.so.6, it seems to be a problem with the development version of Haxe and / or Travis's Haxe support.
I don't think it has anything to do with your changes.

@Gama11
Copy link
Member

Gama11 commented Aug 21, 2017

That can be fixed by adding dist: trusty to the Travis config.

HaxeFlixel/flixel@9416bde

I'll do that in a separate PR.

@AlexHaxe
Copy link
Member

Was just about to do that, but you were faster... :)

@codecov-io
Copy link

codecov-io commented Aug 22, 2017

Codecov Report

Merging #350 into dev will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #350      +/-   ##
==========================================
- Coverage   89.78%   89.78%   -0.01%     
==========================================
  Files         116      116              
  Lines        7331     7330       -1     
  Branches      293      293              
==========================================
- Hits         6582     6581       -1     
  Misses        489      489              
  Partials      260      260
Impacted Files Coverage Δ
src/checkstyle/Checker.hx 82.66% <100%> (-0.06%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa81ca1...dab5a0e. Read the comment docs.

@pypmannetjies
Copy link
Contributor Author

@AlexHaxe for now I've got it so it uses straight regex if you don't specify "path" option in inside checkstyle.json. This may break existing configurations. Would you prefer we rather add a new option e.g. "regex": "true" or something like that, or is my approach acceptable?

@AlexHaxe
Copy link
Member

If we introduce a breaking change, then users have to change their config files. We would have to communicate it with the next release.
If there is a way to keep old configs working and make new functionality optional, then we should at least consider it.

I am not opposed to a breaking change - I personally don't use exclusions in my checkstyle.json (mainly because I use one config for many projects), so I am not personally affected.
And I do see a use case for having a regex to exclude files from checkstyle, but mostly in the phase where you start using checkstyle on a large codebase (there might be other use cases, that I am unaware of).
The number of checkstyle issues can be quite overwhelming, especially if you create a config that enables a lot of checks. But the goal of using checkstyle is to reduce the number of issues. If you have to exclude half of your codebase, then maybe just disable that particular check.

And we should make checkstyle not emit checkstyle warnings during build (either by fixing issues or by using limited exclusions).

@pypmannetjies
Copy link
Contributor Author

I don't think many users use excludes which is probably why this is only now becoming an issue. We need to apply different rules for tests vs source code. For example, tests may need to use long functions to mock out objects, etc. We don't want a separate checkstyle.json for tests because all the other rules are still shared.

The problem with using the excludes as-is is that you can't filter on a class name at all. It seems you can only specify a different package. I suppose we could get away with just refactoring how the paths work but regex is a nice to have and is actually pretty simple vs. the other "path" options.

@AlexHaxe
Copy link
Member

AlexHaxe commented Aug 22, 2017

Checkstyle supports a checkstyle-exclude.json and -e command line parameter, so you can share your checkstyle rules and still have individual exlcusions.

Also the current state of exclusion handling is a work in progress implementation of #120 that became a quasi "permanent" solution. I think before #120 you could only suppress checks using inline annotations e.g. @SuppressWarnings("checkstyle:<checkname>"), which only worked in places where annotations are part of the AST.

For the sake of this pull request I would say we update checkstyle.json so our build passes without checkstyle issues.

@AlexHaxe AlexHaxe merged commit 063a637 into HaxeCheckstyle:dev Aug 23, 2017
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.

4 participants