Giter Club home page Giter Club logo

bitrise-step-swiftlint's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bitrise-step-swiftlint's Issues

Ignores custom configuration file

I set Linting configuration file in Options section, but it ignores the configuration file.

My config's file name is swiftlint.yml

Log:

INFO[08:09:27]  * [OK] Step dependency (swiftlint) installed, available. 
+ '[' -z /Users/vagrant/git ']'
+ cd /Users/vagrant/git
+ '[' -z /Users/vagrant/git/swiftlint.yml ']'
+ swiftlint lint --reporter xcode
Loading configuration from '.swiftlint.yml'

The new lint_range property causes the step to fail silently

The new lint_range property is defined as required, but it doesn't have a default value set in the .yml and if it is undefined, it just fails the linting silently.

I just stumbled upon this while working on something else, I fear that when users on Bitrise update to the new version, it's going to fail silently for everybody.

Funny thing is, the default value was originally there, but for some reason it was removed in this commit.

Lint step failing

Hi.

We have a problem with the linter step for 2-3w roughly.
On our repo we have a branch on which this step wasn't problematic on the 2nd of November:
We haven't touched this branch (no new commit) since then as I've been in holidays. Now that I'm back, the same flow doesn't work anymore and fails on the linter step SwiftLint.

The log is now showing violations and stuff it didn't use to bring up:

Done linting! Found 451 violations, 10 serious in 862 files.
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | [email protected] (exit code: 2)                                  | 23.66 sec|
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://github.com/kimdv/bitrise-step-swiftlint/issues        |
| Source: https://github.com/kimdv/bitrise-step-swiftlint                      |
+---+---------------------------------------------------------------+----------+

Before:

Done linting! Found 2 violations, 0 serious in 862 files.
Saved swiftlint output in SWIFTLINT_REPORT
Saved swiftlint output in file at path SWIFTLINT_REPORT_PATH
|                                                                              |
+---+---------------------------------------------------------------+----------+
| ✓ | [email protected]                                                 | 24.01 sec|
+---+---------------------------------------------------------------+----------+

To me it looks like the linter isn't taking our swiftlint.yml file as a reference for the linting anymore but the default one.

Bitrise support recommended me to contact you as they couldn't find anything in their stack changes that could have had this impact.

Can you help please?

Thanks.

Swiftlint produces a different report from the Step compared to local machine.

When we run Swiftlint from the Bitrise step and locally, we have two different reports.

Locally we only have 1 violation:

/Users/../Documents/git/tt-mobi/TTMobi/TTMobi/Application/Common Views/Table View/Cells/HighlightableCell.swift:14:8: warning: Todo Violation: TODOs should be resolved (Set colour IBInspectables back...) (todo)
Done linting! Found 1 violation, 0 serious in 682 files.

And on the CI we have 27. See attachment swiftlint_report.txt

In order for us to compare the differences, we need your help to identify the Swiftlint version used in the step. We looked into the logs and the steps and did not find the information.

Locally: 0.53.0

Step exits before copying artifacts

If we set the mode to strict and linting fails, the script exits before having the chance to copy the report to SWIFTLINT_REPORT_PATH.
This obfuscates the results and doesn't provide clear feedback to developers what went wrong.

Test Reports Add-on shows no reports if SwiftLint step installed

I didn't dig too much into this, but when I found the (new to me) "Test Reports Add-on" always showed no reports despite many runs, I removed this SwiftLint step (version 0.4.2) and replaced it with a simple shell script:

export HOMEBREW_NO_INSTALL_CLEANUP=1
brew install swiftlint

After this change, the test reports started showing up in the add-on as expected. (My SwiftLint validation is already done in an Xcode build step, so I didn't need the "run tests" part of this step).

Add `--strict` option

Hey.

It would be great to add a checkbox in the bitrise config which enabled the --strict command line option to the lint command. This would default to false, to keep backwards compatibility.

When using lint_range only the first linting error will be reported

I may be wrong with this one, but when I think that because of this:
set -ex
the script will exit when it encounters an error. So, when reading line by line using the lint_range like so:

git diff --name-only | while read filename; do run_swiftlint "${filename}" "${reporter}" "${FLAGS}"; done
git diff --cached --name-only | while read filename; do run_swiftlint "${filename}" "${FLAGS}"; done

it's gonna exit on the first line with an error. So only one error maximum can be printed to the console at a time, right? Btw. why do we have 2 loops here? Sorry if this is a noob question but bash is not my native language ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.